Page 1 of 1

Session duration

Posted: Tue Nov 22, 2022 1:41 pm
by RJS1956
Is there a call in PS to query the duration of the current session? Seems like everything is bar-driven so there is a way to ask if the current bar is in or out of a session, but I want to know about a future bar - the bar at the end of the session. I don't think that is possible.

Re: Session duration

Posted: Tue Nov 29, 2022 6:13 pm
by NakedYolow
is.lastbar? I dont really understand the context.

barstate.isfirst — true if the current bar is the first in the whole range of bars available, false otherwise.
barstate.islast — true if the current bar is the last in the whole range of bars available, false otherwise. This flag helps to detect the last historical bar.