An example SMA(secondarySeries, 2)[0] shows some weird values but those
secondarySeries[0] are ok ?
(Some context missing?)
protected override void OnBarUpdate()
{
if (secondarySeries == null)
{
/* Syncs another DataSeries object to the secondary bar object.
We use an arbitrary indicator overloaded with an IDataSeries input to achieve the sync.
The indicator can be any indicator. The DataSeries will be synced to whatever the
BarsArray[] is provided.*/
secondarySeries = new DataSeries(SMA(BarsArray[1], 5));
}
if (BarsInProgress == 1){
secondarySeries.Set(Close[0]);
return;
}
PrintWithTimeStamp(SMA(BarsArray[1], 2)[0] + " " + SMA(secondarySeries, 2)[0] + " " + secondarySeries[0] + " " + secondarySeries[1] );
}

Comment