Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get start date of current bar's session?

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

    How to get start date of current bar's session?

    Inside OnBarUpdate() as I am handling bars, how do I get the start DateTime of the session that the current bar is in?

    I see the below methods but I'm not sure if any of these will work.
    Session.GetNextBeginEnd()
    Session.GetSessionDate()
    Session.NextBeginTime()

    #2
    overflowing, you can use the GetNextBeginEnd() then with the bars overload offered - http://www.ninjatrader.com/support/h...xtbeginend.htm

    Comment


      #3
      Thanks. I was thrown off by the name, thinking it would only give me the begin datetime of the next session rather than the current one, so I didn't bother looking at the documentation for it. Now I see the docs say:

      Note: Returned values are paired for the same session. If the next DateTime is the session end time, the begin time returned will be the paired begin time corresponding with that session's end time. It is not the next begin time after the end time.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      51 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      31 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      99 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      177 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      170 views
      0 likes
      Last Post CarlTrading  
      Working...
      X