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, 05-11-2026, 05:56 AM
      0 responses
      67 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      202 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      366 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      283 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X