I am testing an indicator which calculates the spread between two instruments.
The indicator works fine when is used on two different Futures contracts. However when used on the same future contract (with different expiration) does not work.
Or in other words the following pairs:
NQ 09-17 and TF 09-17 - OK
ES 09-17 and NQ 09-17 - OK
ES 09-17 and ES 12-17 - NOT Ok (Indicator is blank)
One more thing, I disabled the historical data merging for ES in order to be able to properly populate the chart of the ES 12-17 (because it was merging the data upon any refresh).
After I did that, ES stopped working with other instruments as well e.g. ES 09-17 and NQ 09-17 - NOT ok. Before the merge disable they were working.
I have no idea what is happening, please help!
Here is the code to the indicator.
protected override void Initialize()
{
Add(SecondSymbol, PeriodType.Minute, SecondMinutes);
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Dot, "Spread"));
Overlay= false;
}
protected override void OnBarUpdate()
{
Plot0.Set(Closes[0][0]-Closes[1][0]);
}
Comment