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

Error message index range

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

    Error message index range

    Hello,

    I´m working with different dataseries in scripts for long time now. Today appears the attached message and I have no idea why.

    I add the dataseries AddDataSeries("NQ 12-19", BarsPeriodType.Range, 4);
    and I have in OnBarUpdate if (CurrentBars[0] < 5 || CurrentBars[1] < 5) return;
    and as entry condtion
    if(Position.MarketPosition != MarketPosition.Short
    && Closes[1][1]>Opens[1][1]
    && Closes[1][0]<Opens[1][0])

    What might be the reason for this message please?

    Thank you!
    Tony
    Attached Files

    #2
    Hello tonynt,

    Thank you for your post.

    What is the primary data series you're running the script on?

    Are you able to reproduce this error if you're running this in a backtest over the same time frame on the same instrument? Using the playback connection on Historical data? With Market Replay data?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. In the meantime I figured it out I think. I had the code in the wrong part of my script where I have the OnButtonClick....
      So, I removed it there and use the bool from OnButtonClick to have it working in OnBarUpdate. Now there is no more error message.

      Best regards
      Tony

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      30 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      943 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      9 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by rocketman7, Today, 01:00 AM
      0 responses
      4 views
      0 likes
      Last Post rocketman7  
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      28 views
      0 likes
      Last Post wzgy0920  
      Working...
      X