My problem is that Add (to add the indicator for plotting) can only be used in Initialize(), but I can't use BarsArray[1] in Initialize() because the bars objects don't exist yet. So how do I plot the indicator from the secondary data series? In other words this is what I would like to be able to do, but can't:
protected override void Initialize()
{
CalculateOnBarClose = true;
ema = EMA( EMAperiod );
ema.Plots[0].Pen.Color = EMAcolor;
ema.Plots[0].Pen.Width = EMAlineWidth;
Add( ema );
Add (PeriodType.Minute, filterPeriod);
paso = PriceActionSwingOscillator(BarsArray[1], dtbStrength, swingSize, swingType, useCloseValues);
paso.Panel = 2;
Add(paso);
}

Comment