Announcement

Collapse
No announcement yet.

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.

    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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X