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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      153 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      306 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      176 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X