Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © CryptoBoole
- //@version=4
- study("LLHH_SESSION", overlay=true, max_bars_back=1440)
- // start-end of session
- t = time(timeframe.period, "0001-2359:1234567")
- x = barssince(na(t))
- // keep session high and low
- var sessionHH = float(na)
- var sessionLL = float(na)
- // if we are within the session calculate hh ll barsback = session
- if x > 0
- sessionHH := highest(close, x)
- sessionLL := lowest(close, x)
- // mark sessions
- bgcolor(x == 0.0 ? color.silver : na)
- // session high/low
- plot(sessionHH, color=color.red)
- plot(sessionLL, color=color.green)
Advertisement
Add Comment
Please, Sign In to add comment