Advertisement
xmd79

RSI Line Fill

Feb 18th, 2023
112
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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. // © mborges018
  3.  
  4. //@version=5
  5. indicator(title='RSI Line Fill', shorttitle='RSI Line Fill', overlay=false)
  6.  
  7. inp = input(close)
  8.  
  9. RSI = ta.rsi(inp, 14)
  10. RSIP = plot(RSI, 'RSI', color=color.new(color.black, 0), linewidth=2)
  11.  
  12.  
  13.  
  14. OB = 70
  15. OBP = plot(RSI > OB ? OB : na, 'Overbought', display=display.none)
  16. hline(70, title='Overbought', color=color.black)
  17. fill(OBP, RSIP, color=color.new(color.lime, 0))
  18.  
  19.  
  20. OS = 30
  21. OSP = plot(RSI < OS ? OS : na, 'Oversold', display=display.none)
  22. hline(30, title='Oversold', color=color.black)
  23. fill(OSP, RSIP, color=color.new(color.red, 0))
  24.  
  25. hline(50)
  26.  
  27.  
  28.  
  29.  
  30.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement