Advertisement
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/
- // © Spin Drift
- // Dead Zone 0500 - 0800
- // Asia Gap 2000 - 2030 | Asia Open 2000 | Asia Close 0400 EST
- // Europe Gap 0230 - 0300 | Europe Open 0300 | Europe Close 1230 EST
- // London Gap 0230 - 0300 | London Open 0300 | London Close 1130 EST
- // US Gap 0900 - 0930 | NY Open 0930 | NY Close 1600 EST
- //
- // Volatile 0930 - 1000 |
- // High Confidence 1000 - 1100 |
- // Low Confidence 1100 - 1200 |
- // Very Low Confidence 1200 - 1500 |
- // Hands OFF! 1500 - 1600 |
- //@version=5
- indicator("Key Market Times [SD]v1", shorttitle="Key Market Times [SD]v1", overlay=true)
- // Initialize chartcol variable with default value
- chartcol = color.rgb(0, 0, 0)
- // User input for colors
- volatile_color = input.color(color.rgb(250, 150, 25, 50), "Volatile Color")
- high_confidence_color = input.color(color.rgb(75, 250, 75, 50), "High Confidence Color")
- low_confidence_color = input.color(color.rgb(250, 250, 25, 50), "Low Confidence Color")
- very_low_confidence_color = input.color(color.rgb(125, 125, 125, 50), "Very Low Confidence Color")
- hands_off_color = input.color(color.rgb(250, 25, 25, 50), "Hands OFF Color")
- // Use variables in the chartcol
- timeinrange(res, sess) => not na(time(res, sess + ':3456', "America/New_York")) ? 1 : 0
- if timeinrange("30", "0930-1000")
- chartcol := volatile_color
- else if timeinrange("30", "1000-1100")
- chartcol := high_confidence_color
- else if timeinrange("30", "1100-1200")
- chartcol := low_confidence_color
- else if timeinrange("30", "1200-1500")
- chartcol := very_low_confidence_color
- else if timeinrange("30", "1500-1600")
- chartcol := hands_off_color
- // Labels
- //label_color = color.rgb(250, 250, 250, 0)
- bgcolor(color=chartcol)
- plot(close, color=chartcol)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement