Skip to content

Instantly share code, notes, and snippets.

@testzugang
Created January 25, 2025 20:47
Show Gist options
  • Save testzugang/4b6b801942e60c52e7918b81993ed3da to your computer and use it in GitHub Desktop.
Save testzugang/4b6b801942e60c52e7918b81993ed3da to your computer and use it in GitHub Desktop.
TV - Session Times
//@version=5
indicator("Session Times", overlay=true)
///Sessions
morning = input.session("0830-1030", "Morgen Impuls")
midday = input.session("1030-1530", "Mittagspause")
afternoon = input.session("1530-1730", "Nachmittag Impuls")
evening = input.session("1730-2030", "Abend Pause")
closing = input.session("2030-2200", "Abend Impuls")
///Colors
impulse = input.color(color.new(color.green, 90), "Active")
pause = input.color(color.new(color.red, 90), "Break")
is_session(sess) =>
not na(time(timeframe.period, sess, "Europe/Berlin"))
morningSession = is_session(morning)
middaySession = is_session(midday)
afternoonSession = is_session(afternoon)
eveningSession = is_session(evening)
closingSession = is_session(closing)
bgcolor(morningSession ? impulse : na)
bgcolor(afternoonSession ? impulse : na)
bgcolor(closingSession ? impulse : na)
bgcolor(middaySession ? pause : na)
bgcolor(eveningSession ? pause : na)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment