Here is the code
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Minute, TimeFrame);
}
else if (State == State.DataLoaded)
{
// Syncs a DataSeries object to the primary bar object
primarySeries = new Series<double>(this);
/* Syncs another DataSeries object to the secondary bar object.
We use an arbitrary indicator overloaded with an ISeries<double> input to achieve the sync.
The indicator can be any indicator. The Series<double> will be synced to whatever the
BarsArray[] is provided.*/
secondarySeries = new Series<double>(SMA(BarsArray[1], SMAPeriod));
}
}
protected override void OnBarUpdate()
{
foreach(int CurrentBarForSeries in CurrentBars)
{
if (CurrentBarForSeries < 1)
{
return;
}
}
Value[0]=SMA(Medians[1], SMAPeriod)[0];
}
Thank you!

Comment