Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

if ( BarsInProgress == 1 ) ...starts 20 mins late

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

    if ( BarsInProgress == 1 ) ...starts 20 mins late

    I have the following code in my cs. Running market reply on 1 min and 1000 vol charts it only starts to print at 9:50:00 AM even though the chart session start is 9:30 AM.

    This only happens on a 6E and CL chart....for YM chart it works perfectly...even though I have recorded all 3 instruments for the same sessions for a week and I am replaying the last day of that week. Why?


    // Add second data series (1 minute Bars object) to pickup Open in a volume chart
    Add(PeriodType.Minute, 1);

    if ( BarsInProgress == 1 )
    Print("BarsInProgress == 1 "+Time);


    I am not using BarsRequired

    #2
    >> I am not using BarsRequired
    Not sure what you mean. BarsRequired is defaulted to 20 no matter if you "use" it or not.

    Comment


      #3
      I do not have the BarsRequired code in the cs. Are you saying that all charts require a min of 20 bars to start to plot?

      Why does the YM chart start from the open of the session instead of 20 1 min bars later like the 6E and CL charts?

      Comment


        #4
        BarsRequired is a property of a strategy and not a chart. It is defaulted to 20 no matter if you reference it in your code or no. You could try setting it e.g. to 0 in the Initialize() method.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X