NinjaScript > Language Reference > Common > Data > TradingHours > Sessions
There's this example provided at the bottom of the page:
protected override void OnBarUpdate() { // When the current time is within 10 minutes of the first session close, do something (ToTime()'s format is hhmmss) if (Bars.TradingHours.Sessions[0].EndTime - ToTime(Time[0]) == 1000) // Do something }
Thought this might have been just because I was using minute bars, but it seems tick bars also cause Bars.TradingHours.Sessions[0].BeginTime and EndTime to return an int in hhmm format.
In addition, might be worth it to note in the help file that these both return exchange time rather than local time.
Comment