Bars

View as Markdown

Definition

Represents the data returned from the historical data repository. The Bars object contain several methods and properties for working with bar data.

The Bars object and its member should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded

Additional Access Information

Members within the Bars class can be accessed without a null reference check in the OnBarUpdate() event handler. When the OnBarUpdate() event is triggered, there will always be a Bar object which holds the method or property. Should you wish to access these members elsewhere, check for null reference first. e.g. if (Bars != null)

Methods and Properties

BarsSinceNewTradingDayNumber of bars that have elapsed since the start of the trading day
GetAsk()Returns the Ask price
GetBar()Returns the bar index based on time
GetBid()Returns the Bid price
GetClose()Returns the closing price
GetDayBar()Returns a Bar object that represents a trading day whose properties for open, high, low, close, time and volume can be accessed.
GetHigh()Returns the High price
GetLow()Returns the Low price
GetOpen()Returns the opening price
GetTime()Returns the time
GetVolume()Returns the volume
IsFirstBarOfSessionReturns true if the bar is the first bar of a session
IsFirstBarOfSessionByIndex()Returns true if the bar is the first bar of a session
IsLastBarOfSessionReturns true if the bar is the last bar of a session
IsResetOnNewTradingDayReturns true if the chart bars should reset on a new trading day
IsTickReplayReturns true if the bars are using tick replay
PercentCompleteValue indicating the completion percent of a bar
TickCountTotal number of ticks of the current bar
ToChartString()Returns the bars series as a string formatted as the series would be displayed in the user interface