finallynitin

10-day High

Dec 25th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 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. // © finallynitin
  3. //@version=5
  4.  
  5. indicator('10 Day High', overlay=true)
  6.  
  7. length = input.int(10, minval=1)
  8. upper = ta.highest(length)
  9. u = plot(upper, "Upper", color=#2962FF)
  10.  
  11. // -----------------------LABEL------------------------
  12.  
  13. DH = (close - upper) * 100 / close
  14.  
  15. label lbl_0 = label.new(bar_index, upper, xloc=xloc.bar_index, text=str.tostring(DH, '#.#') + '%', color=DH >= -5 ? color.green : color.red, style=label.style_label_left, textcolor=color.white, size=size.normal, textalign=text.align_left)
  16. label.set_x(lbl_0, bar_index[0])
  17. label.delete(lbl_0[1])
  18.  
  19.  
  20.  
  21. // -----------------------WMA------------------------
  22. WMA10 = ta.wma(close, 10)
  23. WMA20 = ta.wma(close, 20)
  24. WMA50 = ta.wma(close, 50)
  25. WMA100 = ta.wma(close, 100)
  26. WMA200 = ta.wma(close, 200)
  27.  
  28. plot(WMA10, color=color.green, title="WMA10")
  29. plot(WMA20, color=color.red, title="WMA20")
  30. plot(WMA50, color=color.black, title="WMA50")
  31. plot(WMA100, color=color.aqua, title="WMA100")
  32. plot(WMA200, color=color.purple, title="WMA200")
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment