IsTickReplays

View as Markdown

Definition

Indicates the specified bar series is using Tick Replay. Please see the help guide topic on using Tick Replay for general information on this mode.

For a primary series, the Tick Replay option must be configured from the UI before a NinjaScript object can take use of this property. The setting on the Chart’s Data Series menu will always take precedence for an object series which already exists on the user’s chart.

This property should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded.

Property Value

A bool[] when true, indicates the specified BarsArray is setup to run Tick Replay; otherwise false. Default value is false.

Syntax

IsTickReplays[int idx]

Examples

1protected override void OnStateChange()
2{
3 if(State == State.SetDefaults)
4 {
5 Name = "Examples Indicator";
6 }
7
8 else if (State == State.Configure)
9 {
10 AddDataSeries("AAPL", BarsPeriodType.Minute, 1);
11 }
12 else if (State == Data.Loaded)
13 {
14 // IsTickReplays[0] = true;
15 // Programmatically setting this option here for Primary [0] does not have any effect
16 // Primary series must be configured from UI
17
18 // It is not possible to combine Tick Replay series and non Tick Replay series in a single chart or script
19 // The assignment below would not be necessary if the primary series were set to True via the UI
20 // IsTickReplays[1] = true;
21 }
22}
23
24protected override void OnBarUpdate()
25{
26 //Print out the current bars series name and tick replays setting on start up
27 if (CurrentBar == 0)
28 Print(BarsArray[BarsInProgress].ToChartString() + " " + IsTickReplays[BarsInProgress]);
29}