Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to deal with the 'Session breaks'/'Multiple sessions' in a trading day ?

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

    How to deal with the 'Session breaks'/'Multiple sessions' in a trading day ?

    Hi

    I have developed a range break-out strategy for NT-7. It forms a range for the day during early market hours i.e. from MOT (Market open time) to n1 minutes after MOT. After forming the range it moves on to signal generation & execution part.

    It starts signal generation & execution n1 minutes after, from the MOT(Market open time) & it stops signal generation n2 minutes before to the MCT(Market close time). In this strategy I'm retrieving MOT & MCT using following NinjaScript function:
    //Set Market Open Time & Market Close Time for given time
    Bars.Session.GetNextBeginEnd(Time[0], out CurrentDayMOT, out CurrentDayMCT);

    When I back-test this strategy on US stock AAPL it works perfectly as I expected, it returned MOT = 09:30 AM & MCT = 04:00 PM. As there is only single session for a trading day in Session Template 'US Equities RTH'.




    But When I test it for the HKEx futures HHI(H-shares Index Futures) using Session Template 'HKFE New'. it went totally wrong. Here I was expecting MOT = 09:15 AM & MCT = 04:15 PM for current trading day, but Ninjascript returned MOT = 09:15 AM & MCT = 12:00 PM for 1st Session of the day after the Session break(12:00 PM to 1:30 PM) it returned MOT = 01:30 PM & MCT = 04:15 PM for 2nd Session.



    Due to this behavior
    I got two different ranges whether I was expecting only one range for that day.
    Also it stopped generating signal n2 minutes before to 'End time' of 1st session and started it again n1 minutes after from 'Start time' of 2nd session which I didn't expected


    So, How do I set MOT = 09:15 AM ('Strat time' of 1st session) & MCT = 04:15 PM ('End time' of 2nd session) in above discussed Multiple session case ?

    #2
    Hi there, the easiest way to do this would be to just create a new session template that doesn't include the break in the middle of the day. Please let me know if you have any other questions.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks Austin

      It works now. but; Is there another way to detect 'session breaks' or 'Multiple sessions' through strategy itself ?

      Comment


        #4
        Hello,

        Unfortunately there would not be another way to detect this. As NInjaTrader does not support multiple sessions in the same day at this time unfortunately. Only way to do it would be with a time filter with a session template that is open through the day.

        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X