IsLastBarOfSession

View as Markdown

Definition

Indicates if the current bar processing is the last bar updated in a trading session.

Notes:

  • This property will always return false on non-intraday bar periods (e.g., Day, Month, etc.)
  • When running Calculate.OnEachTick / OnPriceChange, this property will always return true on the most current real-time bar since it is the last bar that is updating in the trading session. If you need to find a bar which coincides with the session end time, please use the SessionIterator.ActualSessionEnd.

Property Value

This property returns true if the bar is the last processed in a session; otherwise, false. This property is read-only.

Syntax

Bars.IsLastBarOfSession

Examples

1protected override void OnBarUpdate()
2{
3 // Print the current bar number of the first bar processed for each session on a chart
4 if(Bars.IsLastBarOfSession)
5 Print(string.Format("Bar number {0} was the last bar processed of the session at {1}.", CurrentBar, Time[0]));
6}