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 DayTradingDEMON, Today, 09:28 AM
      2 responses
      15 views
      0 likes
      Last Post DayTradingDEMON  
      Started by Stanfillirenfro, Today, 07:23 AM
      6 responses
      23 views
      0 likes
      Last Post Stanfillirenfro  
      Started by navyguy06, Today, 09:28 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      8 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by helpwanted, Today, 03:06 AM
      2 responses
      22 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X