Advertisement
Maurizio-Ciullo

Indicatore Livelli Weekly OHLC

Jan 26th, 2022 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © Maurizio-Ciullo
  3.  
  4. //@version=4
  5.  
  6. study(title="Livelli Weekly OHLC", shorttitle="Weekly_OHLC", overlay=true)
  7.  
  8. //Startd Detecting Weekly Highs/Lows //////////////////////////////////////
  9.  
  10. //Weekly
  11. swt = input(true, title="Show This Weeks OHLC?")
  12. wtdo = security(tickerid, 'W', open)
  13. wpdo = security(tickerid, 'W', open[1])
  14. wpc = security(tickerid, 'W', close)
  15. wpdc = security(tickerid, 'W', close[1])
  16. wph = security(tickerid, 'W', high)
  17. wpdh = security(tickerid, 'W', high[1])
  18. wpl = security(tickerid, 'W', low)
  19. wpdl = security(tickerid, 'W', low[1])
  20.  
  21. //Weekly Plots
  22. plot(swt and wtdo ? wtdo : na, title="Weekly Open", style=circles, linewidth=1, color=silver)
  23. plot(swt and wpc ? wpc : na, title="Weekly Close", style=circles, linewidth=1, color=fuchsia)
  24. plot(swt and wph ? wph : na, title="Weekly High", style=circles, linewidth=1, color=green)
  25. plot(swt and wpl ? wpl : na, title="Weekly Low", style=circles, linewidth=1, color=red)
  26.  
  27.  
  28. //End Detecting Weekly Highs/Lows //////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement