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 jxs_xrj, 01-12-2020, 09:49 AM
              5 responses
              3,290 views
              1 like
              Last Post jgualdronc  
              Started by Touch-Ups, Today, 10:36 AM
              0 responses
              7 views
              0 likes
              Last Post Touch-Ups  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              8 responses
              61 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by Option Whisperer, Today, 09:55 AM
              0 responses
              8 views
              0 likes
              Last Post Option Whisperer  
              Started by halgo_boulder, 04-20-2024, 08:44 AM
              2 responses
              24 views
              0 likes
              Last Post halgo_boulder  
              Working...
              X