Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar close question

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

    Bar close question

    This question is about daily historical bars and the On Bar Closed setting.

    I can understand why, during the trading day, the bar number of the last completed bar is Count - 2 and that is the last one passed to OnBarUpdate(). That makes sense because bar Count - 1 is still in progress and therefore has not closed.

    What I do not understand is why, after the trading day ends, OnBarUpdate() will not be called for that final bar. At that point, there will be no further changes to the bar other than updating any errors and/or lags. The bar is in fact closed.

    If I want my indicator to process the last bar showing on the chart, I have to set something other than On Bar Close. It seems strange to me that I can't set On Bar Close and expect my indicator to include that last bar in its processing even when, in the real world, it has closed.

    I'm not claiming there is a bug of some sort ... I'm just trying to understand the system a little better.
    Last edited by ETFVoyageur; 05-11-2024, 01:04 AM.

    #2
    The last bar at the end of the trading day is not always closed. If you uncheck the EOD in the settings, that bar can continue into the next day. This applies to charts like tick or unirenko. My guess this feature was implemented to ensure consistency between processing time-based charts, where the last bar is closed at the end of the trading day, and non-time-based charts, where the last bar can continue into the next day.

    Comment


      #3
      And for daily stock information the next "first tick" won't come in until the next trading day.

      May I suggest that there might be a better design for this case?

      It is logically clear that for many cases the bar is done when the trading session closes so for items where the trading session ending matters the system should go around and close any open end-of-day bars after the session closes.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X