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 usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      22 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      21 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X