Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Session Event

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

    New Session Event

    Is there an event that specifies when a new session has started? I am running some code with calculateOnBarClose = true, and I want to reset everything as soon as the session starts. I currently have OnMarketData in my code, and I would like to capture the new Session start in this function.

    How would I do that? I don't want to use Bars.FirstBarOfSession && FirstTickOfBar.

    #2
    Hello habibalex,

    Thank you for your post.

    You could use GetNextBeginEnd form the Bars object and then call the time you store in a variable to verify the new session start. Otherwise I would have recommended FirstBarOfSession.

    GetNextBeginEnd: http://ninjatrader.com/support/helpG...xtbeginend.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    20 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    11 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    622 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    420 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    293 views
    1 like
    Last Post charlesugo_1  
    Working...
    X