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 ?
Comment