Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate'

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

    Error on calling 'OnBarUpdate'

    Hi

    I keep getting these similar messages almost on a daily basis"-
    Indicator '': Error on calling 'OnBarUpdate' method on bar 206: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    The thing is it only happens on a 2 min, 5 min or 10 min chart. It doesn't happen on a 1 min, 3 min or 4 min chart. And to rectify the situation, I right click on the chart, select Data Series, and either increase of decrease the "Days to load" and the error is no longer there till the next day. Which 2 min, 5 min or 10 min chart produces the error is random.

    I've narrowed it down to 1 indicator. When you right click on the chart and select "Indicators...", in the configured section, the timeframe for the indicator is missing. And by either adding or subtracting the "Days to load", the timeframe on the said indicator reappears and all is well again.

    With respect to "Days to load", my default on 2 min is 7, 5 mins is 11 and 10 min is 17.

    How do I get to the bottom of this issue?

    Regards

    Kay Wai

    #2
    Hello Kay Wai,

    If this is a 3rd party script, please contact the vendor or developer that distributes that software to report the full error message with their software.

    If this is a script you have created, check any indexes used are less than the size of the collection. This means any bars ago values are less than CurrentBar, any list, array, or other collection, indexes are less than the array.Length or list.Count().

    Below is a link to a forum post that discusses invalid index errors.
    Hello, I want to create an indicator that show data in a chart but calculate in other charttime different to the time of the chart where is showed. For example:
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    69 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    42 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X