Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error loading strategy

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

    error loading strategy

    good morning, I receive this error when loading the strategy, and I don't understand it well, I don't have a second series of data or anything, only the zigzag indicator is set and when I put another indicator or a simple input logic it gives me this error, help please
    Error calling 'OnBarUpdate' method on bar 0: You are accessing an index with a value that is invalid as it is out of range. That is to say; has access to an array [barsAgo] with a value of 5 when there are only 4 bars in the chart
    06/08/2023 2:03:09 CancelAllOrders: BarsInProgress=0
    06/08/2023 0:00:00 CancelAllOrders: BarsInProgress=1

    #2
    Hello franatas,

    That is a generic error that happens when you try to use data before its available. We would need more details on what you coded to know why that may be happening. You generally need a current bar check if you use any BarsAgo with an indicator or series:

    if(CurrentBar < 5) return;

    5 would be set to the maximum BarsAgo that was used.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    83 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    143 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    83 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    256 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    334 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X