Advertisement
xmd79

Key Market Times [SD]v1

Jan 29th, 2023
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © Spin Drift
  3.  
  4. // Dead Zone 0500 - 0800
  5. // Asia Gap 2000 - 2030 | Asia Open 2000 | Asia Close 0400 EST
  6. // Europe Gap 0230 - 0300 | Europe Open 0300 | Europe Close 1230 EST
  7. // London Gap 0230 - 0300 | London Open 0300 | London Close 1130 EST
  8. // US Gap 0900 - 0930 | NY Open 0930 | NY Close 1600 EST
  9. //
  10. // Volatile 0930 - 1000 |
  11. // High Confidence 1000 - 1100 |
  12. // Low Confidence 1100 - 1200 |
  13. // Very Low Confidence 1200 - 1500 |
  14. // Hands OFF! 1500 - 1600 |
  15.  
  16. //@version=5
  17. indicator("Key Market Times [SD]v1", shorttitle="Key Market Times [SD]v1", overlay=true)
  18.  
  19. // Initialize chartcol variable with default value
  20. chartcol = color.rgb(0, 0, 0)
  21.  
  22. // User input for colors
  23. volatile_color = input.color(color.rgb(250, 150, 25, 50), "Volatile Color")
  24. high_confidence_color = input.color(color.rgb(75, 250, 75, 50), "High Confidence Color")
  25. low_confidence_color = input.color(color.rgb(250, 250, 25, 50), "Low Confidence Color")
  26. very_low_confidence_color = input.color(color.rgb(125, 125, 125, 50), "Very Low Confidence Color")
  27. hands_off_color = input.color(color.rgb(250, 25, 25, 50), "Hands OFF Color")
  28.  
  29. // Use variables in the chartcol
  30. timeinrange(res, sess) => not na(time(res, sess + ':3456', "America/New_York")) ? 1 : 0
  31.  
  32. if timeinrange("30", "0930-1000")
  33. chartcol := volatile_color
  34. else if timeinrange("30", "1000-1100")
  35. chartcol := high_confidence_color
  36. else if timeinrange("30", "1100-1200")
  37. chartcol := low_confidence_color
  38. else if timeinrange("30", "1200-1500")
  39. chartcol := very_low_confidence_color
  40. else if timeinrange("30", "1500-1600")
  41. chartcol := hands_off_color
  42.  
  43. // Labels
  44. //label_color = color.rgb(250, 250, 250, 0)
  45.  
  46. bgcolor(color=chartcol)
  47. plot(close, color=chartcol)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement