Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Second Bars

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

    Second Bars

    Do I take it that one second bars are created from tick data, and if there's no data for a bar, the data series is somehow messed up?

    This code (having added one second bars for BarsInProgress == 2)

    if (Closes[2].Count < 11) {return;}

    Print("Count = "+Closes[2].Count);
    Print("Close = "+Closes[2][10]);

    gives me

    Count = 990833
    **NT** Error on calling 'OnBarUpdate' method for strategy 'Scalp2/717e69258c55485d9e4939cf13150f19': You are accessing an index with a value that is invalid since its out of range.

    #2
    Hi Dave, correct they would be created from tick data - do you have a CurrentBars check for all series in place at the OnBarUpdate() start?

    Comment


      #3
      Hi,

      Thanks, yes, currentbar will sort out that error. The second bars are not much use to me though since they only occur when there are ticks, which is I suppose understandable.

      thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      421 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      279 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      238 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      325 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      288 views
      0 likes
      Last Post CarlTrading  
      Working...
      X