Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries synchronization

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

    AddDataSeries synchronization

    I can't find this information....but I remember there was an issue that when BarsInProgress = 0 has not produced a bar yet and I try to access BarsInProgress = 1

    For example, my primary series is a 20 Range bar and my secondary data series is a 15 minute bar...if the data starts loading at midnight it is possible that there is not yet a BarsInProgress = 0 and then BarsinProgress = 2 (15 minute) is producing a bar.

    here is the error

    Indicator 'AAQuarter': Error on calling 'OnBarUpdate' method on bar -1: 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.

    #2
    ok, this works in OnBarUpdate to make sure both series have their first bar...thanks

    if (CurrentBars[0] <= 0 || CurrentBars[1] <= 0)
    return;

    Comment


      #3
      Hello llanqui,

      I just wanted to comment that you have reached the correct answer, the if condition you provided is the correct way to make sure both series have processed a bar.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      31 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X