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 cmoran13, Yesterday, 01:02 PM
        0 responses
        30 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        22 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X