PINE LIBRARY

lib_session_gaps

Library "lib_session_gaps"
simple lib to calculate the gaps between sessions

time_gap()
  calculates the time gap between this and previous session (in case of irregular end of previous session, considering extended sessions)
  Returns: the time gap between this and previous session in ms (time - time_close[1])

bar_gap()
  calculates the bars missing between this and previous session (in case of irregular end of previous session, considering extended sessions)
  Returns: the bars virtually missing between this and previous session (time gap / bar size in ms)
detectiongapgapssessionsessionstimesessions

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer