Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data Gobbler

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

    Data Gobbler

    I have a short simple indicator that defines a channel in the past ten bars and waits for a breakout. When the breakout happens the bar is painted. The indicator is causing an indexing error and disables my strategy. It seems to be in instruments with quite high volume and at very high bar numbers. I have traced the problem with Print statements and it seems to always be when something has caused the data to rewind to the limit of my loaded data and the next instruction is MAX(). There is an indexing error as there is no data for MAX(). I am at a loss as to what to look for.

    #2
    Hello galsermil,

    Thanks for your post.

    Adding prints will be necessary to find out which line of code the indicator is throwing the error. Once you identify the line, I recommend printing out the index being used in that line so you can observe what index is being given to an object which is throwing that error.

    With that information, you could add some error checking to ensure that an invalid index is not used as a reference.

    One particular type of indexing error that is commonly seen is when a BarsAgo reference is made before the NinjaScript processes that many bars.

    Making sure you have enough bars - https://ninjatrader.com/support/help...nough_bars.htm

    Publicly available information on C# indexing errors can be found here - https://stackoverflow.com/questions/...ow-do-i-fix-it

    Please let us know if we can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X