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.
    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 Jeremytang, 07-14-2018, 06:45 PM
      21 responses
      440 views
      0 likes
      Last Post mav8rick  
      Started by LeonK, Yesterday, 09:26 PM
      1 response
      10 views
      0 likes
      Last Post bltdavid  
      Started by NicholasJoannette, Yesterday, 03:01 PM
      2 responses
      12 views
      0 likes
      Last Post NicholasJoannette  
      Started by rach1994, Yesterday, 12:20 PM
      1 response
      35 views
      0 likes
      Last Post bltdavid  
      Started by litamm89, Yesterday, 11:00 AM
      5 responses
      22 views
      1 like
      Last Post rafael_delima86  
      Working...
      X