ActualTradingDayExchange

View as Markdown

Definition

Obtains the date of a trading session defined by the exchange.

  1. In order to obtain historical ActualTradingDayExchange information, you must call GetNextSession from a stored SessionIterator object.
  2. The calculated value may differ from the current date as some trading sessions will begin before the actual calendar date changes. For example, the “CME US Index Futures ETH” actual session started on 3/30/2015 at 5:00PM Central Time, however the actual exchange trading day would be considered 3/31/2015 12:00:00AM.

Property Value

A DateTime structure that represents the trading day.

Syntax

SessionIterator.ActualTradingDayExchange

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 exchange trading day is " + sessionIterator.ActualTradingDayExchange);
20 }
21}