ActualSessionEnd

View as Markdown

Definition

Obtains the session’s end date and end time converted to the user’s configured Time Zone.

In order to obtain historical ActualSessionEnd information, you must call GetNextSession from a stored SessionIterator object.

Property Value

A DateTime structure that represents end of a trading session.

Syntax

SessionIterator.ActualSessionEnd

Example

1SessionIterator sessionIterator;
2
3protected override void OnStateChange()
4{
5 if (State == State.Historical)
6 {
7 sessionIterator = new SessionIterator(Bars);
8 }
9}
10
11protected override void OnBarUpdate()
12{
13 // on new bars session, find the next trading session
14 if (Bars.IsFirstBarOfSession)
15 {
16 // use the current bar time to calculate the next session
17 sessionIterator.GetNextSession(Time[0], true);
18
19 Print("The current session end time is " + sessionIterator.ActualSessionEnd);
20 }
21}