When I add a futures instrument with two different expiry months and reference the data using Closes[instrument index][period], Volumes[instrument index][period], etc... I get the same data under both instrument indices. What am I doing wrong? When I switch the 6E 06-11 to 6B 03-11 the code works fine.
protectedoverridevoid Initialize()
{
// Add a 60 minute Bars object to the strategy
Add("6E 03-11", PeriodType.Minute, timeScaleInMinutes, MarketDataType.Last); // MarketDataType.Last
// Add a 60 minute Bars object to the strategy
Add("6E 06-11", PeriodType.Minute, timeScaleInMinutes, MarketDataType.Last); // MarketDataType.Last
}
protectedoverridevoid OnBarUpdate()
{
//
if (BarsInProgress == 0 || BarsInProgress > 2 )
{
return;
}
elseif (BarsInProgress == 1 || BarsInProgress == 2)
{
Print(Volumes[1][0] + "|" + Volumes[2][0] );
}
}
Comment