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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X