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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        46 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        14 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X