IsResetOnNewTradingDay

View as Markdown

Definition

Indicates if the bars series is using the Break EOD data series property.

Property Value

This property returns true if the bars series should reset on a new trading day; otherwise, false. This property is read-only.

Syntax

Bars.IsResetOnNewTradingDay

Tip: This property can be helpful in determining how to amend new bar data when working with a BarType.

Examples

1protected override void OnDataPoint(Bars bars, double open, double high, double low, double close, DateTime time, long volume, bool isBar, double bid, double ask)
2{
3 // create a session iterator to keep track of session related information
4 if(SessionIterator == null)
5 SessionIterator = new SessionIterator(bars);
6
7 // determine if the bars are in a new session
8 bool isNewSession = SessionIterator.IsNewSession(time, isBar);
9
10 if(isNewSession)
11 SessionIterator.GetNextSession(time, isBar);
12
13 // If bars are using "Break end of day", add a new bar for next session
14 if(bars.IsResetOnNewTradingDay && isNewSession)
15 AddBar(bars, open, high, low, close, time, volume);
16 else
17 {
18 // do something with existing bar values
19 }
20}