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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X