IsTickReplay

View as Markdown

Definition

Indicates if the bar series is using the Tick Replay data series property.

Property Value

This property returns true if the bar series is using tick replay; otherwise, false. This property is read-only.

Syntax

Bars.IsTickReplay

Warning: A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series. Please see Developing for Tick Replay for more information.

Examples

1private double askPrice;
2protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
3{
4 if(Bars.IsTickReplay)
5 {
6 // if using tick replay, get the current ask price associated with the tick
7 askPrice = marketDataUpdate.Ask;
8 }
9 else // otherwise, get the real-time market data price during MarketDataType.Ask event
10 askPrice = marketDataUpdate.MarketDataType == MarketDataType.Ask ? marketDataUpdate.Price : double.MinValue;
11
12 // only print if a value is set
13 if(askPrice != double.MinValue)
14 {
15 Print("ask price: " + askPrice);
16 }
17}