Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              576 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X