How can one get NinjaTrader 8's best guess for the next session's start date and time (not the current session's start date and time, i.e. the session containing Time[0]), including handling of partial and full planned holidays, and in a way that can handle cross-time zone issues?
I was hoping that SessionIterator.GetNextSession() would get an object containing the start date and time of the session that is predicted to occur directly after the current session if Time[0] was passed to it, but unfortunately it gets an object containing the start date and time of the current session, i.e. the session that contains the price bar with the time returned by Time[0].
Simply adding 1 day to Time[0] of a 1-day daily bar and calling SessionIterator.GetNextSession() with the new datetime also won't work because not only could the next day be a weekend or full holiday, but SessionIterator.GetNextSession() does not get an object containing the start date and time of a session if the datetime passed to it is outside of the session, and sometimes due to partial holidays or daylight savings time, adding 1 day or 24 hours to the end time of the current session's end time (Time[0] of the current 1-day daily bar) can return a time that is after the closing time of the next session and therefore not a time that should be passed to SessionIterator.GetNextSession() if an object containing the next session's start date and time is desired.
Thanks in advance!
EquityTrader
Comment