Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

MultiTimeframe syntax

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MultiTimeframe syntax

    Hi,

    Could you please help me with the following syntax
    the next line work perfect in my current code, now I want reference an other TF, so BarsArray[1] need to be added, I've tried many different ways but can't get the right coding

    if (MyTS(Median, VC.NinjaScript.Utility.MovingAverageType.EMA, period, periodEnd, periodStart, step).MaTS[0] > 25

    Thank you very much

    Nico

    #2
    Following is an example using NT standard indicators -

    if (SMA(BarsArray[1], 20)[0] > myValue)
    // Do something

    The above snippert will check if the 20 period average of the close prices of secondard series (that you added by calling Add() method in Initialize() method) is greater than myValue.
    RayNinjaTrader Customer Service

    Comment


      #3
      Hi Ray,

      I've looked at many examples, like the one you are providing here,
      So I figured this line should work fine

      if (MyTS(BarsArray[1], Median, VC.NinjaScript.Utility.MovingAverageType.EMA, period, periodEnd, periodStart, step).MaTS[0] > 25)

      but I get an error message

      Nico
      Last edited by nico_p; 04-28-2008, 04:27 PM.

      Comment


        #4
        What error message?
        RayNinjaTrader Customer Service

        Comment


          #5
          No overload for method 'MyTS' takes 7 arguments

          Thx for your help here

          Nico
          Attached Files

          Comment


            #6
            Maybe try

            (MyTS(Medians[1], VC.NinjaScript.Utility.MovingAverageType.EMA, period, periodEnd, periodStart, step).MaTS[0] > 25)

            or

            (MyTS(BarsArray[1], VC.NinjaScript.Utility.MovingAverageType.EMA, period, periodEnd, periodStart, step).MaTS[0] > 25)
            RayNinjaTrader Customer Service

            Comment


              #7
              Thanks Ray,

              Both lines compiled,
              I'm using the second line you suggested, and working as expected

              Much appreciated

              Nico

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              2 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              5 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              12 views
              0 likes
              Last Post maybeimnotrader  
              Started by quantismo, Today, 05:13 PM
              0 responses
              7 views
              0 likes
              Last Post quantismo  
              Working...
              X