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

SessionIterator sessionIterator;
protected override void OnStateChange()
{
if (State == State.Historical)
{
sessionIterator = new SessionIterator(Bars);
}
}
protected override void OnBarUpdate()
{
// on new bars session, find the next trading session
if (Bars.IsFirstBarOfSession)
{
// use the current bar time to calculate the next session
sessionIterator.GetNextSession(Time[0], true);
Print("The current session end time is " + sessionIterator.ActualSessionEnd);
}
}