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