Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © equity4life
- //@version=4
- study(title="RSI Equity4life", shorttitle="RSI+9EMA", format=format.price, precision=2, resolution="")
- //RSI
- len = input(14, minval=1, title="Length")
- src = input(close, "Source", type = input.source)
- up = rma(max(change(src), 0), len)
- down = rma(-min(change(src), 0), len)
- rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
- plot(rsi, "RSI", color=color.black)
- //Midline
- th = input(50, title="threshold")
- hline(th, title="Middle Line", color=color.black, linestyle=hline.style_dashed)
- //Bands
- band2 = hline(60, "Upper Band", color=#4CAF50, linestyle=hline.style_dashed)
- band1 = hline(40, "Lower Band", color=#FF5252, linestyle=hline.style_dashed)
- fill(band1, band2, color=color.fuchsia, transp=90)
- //Moving Average
- nine = ema(rsi(close, 14), 9)
- plot(nine, color=#FF9800, linewidth=1, title='EMA')
Add Comment
Please, Sign In to add comment