rofi93

DHLB

Jan 14th, 2023
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. //@version=5
  2. //Created By kbasar on 13-01-2023
  3. //Plots Current Days High, Low, And Or Previous Days. Both Days can be turned on and off with CheckBox
  4.  
  5. //Daily Session To be used on IntraDay Charts
  6. indicator(title = "Daily High Low Breakout", shorttitle = "DHLB", overlay = true)
  7. st = input(true, title = "Show Todays OHLC?")
  8. sy = input(false, title = "Show Yesterdays OHLC?")
  9.  
  10. //Daily
  11. ph = request.security(syminfo.tickerid, 'D', high)
  12. pdh = request.security(syminfo.tickerid, 'D', high[1])
  13. pl = request.security(syminfo.tickerid, 'D', low)
  14. pdl = request.security(syminfo.tickerid, 'D', low[1])
  15.  
  16. //Daily Plots
  17. plot(st and ph ? ph : na, title = "Daily High", style = plot.style_circles, color = color.lime, linewidth = 3)
  18. plot(sy and pdh ? pdh : na, title = "Previous Daily High", style = plot.style_cross, color = color.lime, linewidth = 3)
  19. plot(st and pl ? pl : na, title = "Daily Low", style = plot.style_circles, color = color.red, linewidth = 3)
  20. plot(sy and pdl ? pdl : na, title = "Previous Daily Low", style = plot.style_cross, color = color.red, linewidth = 3)
  21.  
  22. // local user defined function
  23. ema_plot(len) => ta.ema(close, len)
  24.  
  25. // ema 10
  26. ema10 = ema_plot(10)
  27. plot(ema10, title = "EMA 10", color = color.blue, linewidth = 3)
  28.  
  29. // ema 20
  30. ema20 = ema_plot(20)
  31. plot(ema20, title = "EMA 20", color = color.green, linewidth = 3)
  32.  
Advertisement
Add Comment
Please, Sign In to add comment