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

To use the MAX indicator for Bars Object other than [0], what is needed?

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

    To use the MAX indicator for Bars Object other than [0], what is needed?

    Hello,

    I have a multi-instrument, multi-time frame strategy that I need to look into the secondary bars array to check a condition before entry.

    I need to use a statement like this to add a condition for order entry:


    SMA(High,10)[1][0] > MAX(SMA(High,10)[1][1],30)
    The problem is that even though I have added the 2nd bars array, I cannot access it to use as a condition of entry for my strategy. The line above is designed to say that the SMA of the High for Bars Array 1 this bar must be higher than the Maximum of the SMA of the High for bars array 1, 1 bar ago and for the last 30 bars.

    I get errors that say something about IDataSeries but I don't know how to use this method. I have looked it up but have been unsuccessful at making changes that result in an error free compile.

    Thanks to anyone who can help,

    dendy.

    #2
    You likely want something like:

    Code:
    SMA(Highs[1], 10)[0] > MAX(SMA(Highs[1], 10), 30)[1]
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray!!!

      I believe that's it. I'll work with it for a while and see what happens.

      dendy.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Today, 03:20 PM
      0 responses
      5 views
      0 likes
      Last Post cre8able  
      Started by Fran888, 02-16-2024, 10:48 AM
      3 responses
      47 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by martin70, 03-24-2023, 04:58 AM
      15 responses
      114 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by The_Sec, Today, 02:29 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by jeronymite, 04-12-2024, 04:26 PM
      2 responses
      31 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X