Session's First Bar RangeFirst Bar is crucial when there is gap up or gap down opening. It is recommended to use 15m Timeframe for better use.
Crossing this range signifies the absorption of existing buyers/sellers in the opening session and sometimes decide the trend onwards.
Firstbar
SessionInfoLibrary "SessionInfo"
Utility functions for session specific information like the bar index of the session.
inSession(spec) Returns true if the current bar is in the session specification.
Parameters:
spec : session.regular (default), session.extended or other time spec.
Returns: True if the current is in session; otherwise false.
minutesToLen(minutes, multiple) Converts the number of minutes to a length to be used with indicators.
Parameters:
minutes : The number of minutes.
multiple : The length multiplier.
Returns: math.ceil(minutes * multiple / timeframe.multiplier)
bar(spec, res) Returns the intraday bar index. May not always map directly to time as a bars can be skipped.
Parameters:
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = "1440").
Returns: The integer index of the bar of the session.
isFirstBar(spec, res) Returns true if the current bar is the first one of the session.
Parameters:
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = "1440").
Returns: True if the current bar is the first one of the session.
wasLastBar(spec, res) Returns Returns true if the previous bar was the last of the session.
Parameters:
spec : session.regular (default), session.extended or other time spec.
res : The resolution (default = "1440").
Returns: True if was the last bar of the session.