In an Indicator, I want to create a second instrument with the same parameters (Period, Value, etc.) of the first one.
I have used BarsPeriod for that purpose. Code looks like this:
protected override void Initialize()
{
Add(m_strSlaveInstrument, BarsPeriod.Id, BarsPeriod.Value, BarsPeriod.MarketDataType);
...
}
It works fine almost time but for any reason sometime BarsPeriod is not initialized and BarsPeriod.Value returns -1, and the process stop.
Maybe I am doing something wrong, is there any other way to do the same?
Thank you
Comment