Definition
BarsArray is an array holding Bars objects that are added via the Add() method. Bars objects can be used as input for indicator methods. This property is of primary value when working with multi-time frame or multi-instrument scripts.
NOTE: This property should NOT be accessed within the Initialize() method.
Property Value
An array of Bars objects.
Syntax
BarsArray[int index]
Examples
protected override void Initialize()
{
Add(PeriodType.Minute, 5);
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
return;
if (SMA(20)[0] > SMA(BarsArray[1], 20)[0])
EnterLong();
}
|
|
|