From my point of view the reference to bars does not work as documented (http://www.ninjatrader-support.com/H...ameInstruments
in Section "How Bar Data is Referenced"). I understand text and Figure 1 in this way that every yellow 1 min bar should have access to yellow 3 min bar / every 1 min bar in cyan should have access to the cyan 3 min bar.
From my test/observation: During Historical == true the actual 1 minute bar processing at time when a 5 min bar is finished has no access to the actual finished 5 min bar data. Call sequence is
1. OnBarUpdate for 1min bar
2. OnBarUpdate for 5min bar
Because of this it is not possible to plot via StrategyPlot because on the 5 min border the data in 1min bar processing is "delayed" by 1 bar.
My test code to illustrate:
switch (BarsInProgress) {
case BAR1MIN:
// *** call from 1 min bar
// at finished 5 min bar: close value from !!prev!! 5min bar
// all 5min indicator values from !!prev!! bar
DrawDiamond(CurrentBar.ToString()+"5minfrom1min",0 ,
Closes[BAR5MIN][0],Color.Blue);
// close value from actual 1 min bar
//DrawDot(CurrentBar.ToString()+"1minfrom1min",0,
// Closes[BAR1MIN][0],Color.Blue);
break;
case BAR5MIN:
// *** call from 1 min bar
// close value from actual 5min bar
// all 5min indicator values from actual bar
DrawDiamond(CurrentBar.ToString()+"5minfrom5min",0 ,
Closes[BAR5MIN][0],Color.Red);
// close value from actual 1 min bar
//DrawDot(CurrentBar.ToString()+"1minfrom5min",0,
// Closes[BAR1MIN][0],Color.Red);
break;
}
At the finished 5 min bar the diamonds are plotted on different prices.
As a workaround my actual logic in my real strategy is:
case BAR1MIN:
if (!Is5minBar)
processSignals();
case BAR5MIN:
processSignals();
But after a review of code, documentation & forum I think that this does not work as documented?

Comment