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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      608 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      355 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      561 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X