As the bug resides in the Initialize Section() of the indicator, the exceptions will be thrown, even if the indicators are not added to any chart.
The error message is
Failed to call method 'Initilialize' for Indicator 'Spread3'. Please use alternate method 'AddRenko() instead of Add()
If you look at the code,
protected override void Initialize()
{
Add(new Plot(Color.Orange, "Ratio"));
Add(FirstInstrument, BarsPeriods[0].Id, BarsPeriods[0].Value);
Add(SecondInstrument, BarsPeriods[0].Id, BarsPeriods[0].Value);
}
To correct this, you would have to check first, whether the first BarSeries is an exotic series that requires something like AddRenko() or similar instead of Add().
How can this be done, that is how can the exceptions been avoided and how can the indicator be modified to work with all bar types?

Comment