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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      57 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      39 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      61 views
      0 likes
      Last Post PaulMohn  
      Working...
      X