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/
- // © DaviG
- //@version=5
- indicator("Time Filter", overlay=true)
- transparency = input.int(title="Time Filter background transparency", defval=80)
- gmtSelect = input.string(title="Select Local Time Zone", defval="GMT+2", options=["GMT-7", "GMT-6", "GMT-5", "GMT-4", "GMT-3", "GMT-2", "GMT-1", "GMT", "GMT+1", "GMT+2", "GMT+3","GMT+4","GMT+5","GMT+6","GMT+7","GMT+8","GMT+9","GMT+10","GMT+11","GMT+12","GMT+13"], confirm=true)
- // === INPUT TIME RANGE ===
- betweenTime = input.session('0600-1700', title = "Time Filter") // '0000-0000' is anytime to enter
- isTime(_position) => // create function "within window of time"
- isTime = na(time(timeframe.period, _position + ':1234567', gmtSelect)) // current time is "within window of time"
- bgcolor(color = isTime(betweenTime) ? color.new(color.red,transparency) : color.new(color.green,transparency))
- //
Advertisement
Add Comment
Please, Sign In to add comment