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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      590 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X