I have also added Tick as a period to process intrabar historicals.
For most cases all works fine, except on some bars the Ticks and Range bars do not correlate.
On some bars, the first tick and other ticks are out of the range of the high and low of the bar. On some bars there are only 2 ticks for a 6 tick bars which are out of range also.
I can demonstrate this issue with the following strategy code :
Run this on a 5 day 6 Range chart for CL 02-13 contract.
On the output window, look at bars 146 and 147.
How can Range bars be correct but ticks be wrong? How can I fix this issues?

protected override void Initialize()
{
Add(PeriodType.Tick,1);
CalculateOnBarClose = false;
}
protected override void OnBarUpdate()
{
if ( CurrentBars[0]>150)return;
// display bar numbers on the chart if(BarsInProgress==0)DrawText("i"+CurrentBar,"_"+C urrentBar,0,High[0]+TickSize,Color.Black);
Print(CurrentBars[1]+"-Opens[0][0]="+Opens[0][0]+"-Opens[1][0]="+Opens[1][0]+"-Closes[1][0]="+Closes[1][0]+"-"+CurrentBars[0]);
}

Comment