&
both say
HighestBar(Close, Bars.BarsSinceSession - 1 is "the number of bars ago for the highest close of the current session"
&
Lowest(SMA(20), Bars.BarsSinceSession - 1 is "the number of bars ago for the lowest SMA(20) value of the current session"
It's been to my experience that it's actually Bars.BarsSinceSession + 1 that does the trick. The reason I came across this is because I wanted to draw a line for the previous days high without having to use multiple time frames. When I used Bars.BarsSinceSession - 1 it was under the previous day's high if the high was on either the first or second bar of the session.
Please let me know if I'm the one who missed something and need to fix my code.
Thanks
Comment