Good morning at your side.
I want to count the # of times the market breaks the high or low hence use IsFirstBarOfSessionByIndex() in below piece of codes, which is called in OnBarUpdate(); but it turns out the function returns true at different candles, as in the attached picture. Shed some lights? Grateful.
Regards,
Steven Meng
protected int TodaysFirstBar() {
for (barPointer= CurrentBar; barPointer > 0; barPointer--) {
}
Comment