EXPERIMENTAL:
Envelope range weighed by rsi and atr.
Envelope range weighed by rsi and atr.
//@version=2 study(title='[RS]MTF RSI Weighted Range Envelope V0', shorttitle='E', overlay=true) tf = input('5') src = input(open) ema_length = input(1) rsi_length = input(20) atr_length = input(20) atr_offset = input(1) ob_value = input(70)*0.01 os_value = input(30)*0.01 rsi = rsi(ema(src, ema_length), rsi_length) range = atr(atr_length)[atr_offset] * (0.01*rsi_length) h = src + ((100 - rsi) * range) l = src - (rsi * range) sh = security(tickerid, tf, h) sl = security(tickerid, tf, l) sob = sl + ((sh - sl)*ob_value) sm = sl + ((sh - sl)*0.50) sos = sl + ((sh - sl)*os_value) p100 = plot(series=sh, title='', color=black, style=line, transp=0, linewidth=1) pob = plot(series=sob, title='', color=red, style=circles, transp=0, linewidth=1) pm = plot(series=sm, title='', color=black, style=circles, transp=0, linewidth=1) pos = plot(series=sos, title='', color=lime, style=circles, transp=0, linewidth=1) p0 = plot(series=sl, title='', color=black, style=line, transp=0, linewidth=1) fill(pos, pob, color=purple, transp=90)