I tested, how method Bars.IsFirstBarOfSessionByIndex() works,
but it seems it does not work, but returns true for each bar.
I tested on M15 timeframe, with this simple code:
[FONT="Courier New"]protected override void OnBarUpdate() { /[SIZE="2"][COLOR="DimGray"]/ Check, if current bar is first bar of session[/COLOR][/SIZE] Value[0] = Bars.I[COLOR="Red"]sFirstBarOfSessionByIndex(0)[/COLOR] ? 1 : 0; }[/FONT]
which is wrong obviously.
When I replace it with IsFirstBarOfSession, then it works fine.
[FONT="Courier New"]protected override void OnBarUpdate() { Value[0] = Bars.[COLOR="Green"]IsFirstBarOfSession [/COLOR]? 1 : 0; }[/FONT]
and return value 'true' everytime ?
Comment