Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator(title='Multi Time RSI', overlay=false)
- avg1 = input(title='Slow Average :', defval=21)
- avg2 = input(title='Fast Average :', defval=11)
- rsi_avg_step = input(title='RSI Avg Step :', defval=1.0)
- inp = input(close)
- //Plot RSI
- rsiCurrent = ta.rsi(inp, 11)
- rsi_current_plot = plot(rsiCurrent, color=color.new(color.black, 0), linewidth=2, style=plot.style_line, title='Current RSI Time Frame')
- rsi_avg = ta.ema(ta.rsi(inp, 11), avg1)
- rsi_avg_plot = plot(rsi_avg, color=color.new(color.red, 0), linewidth=2, style=plot.style_line, title='Current AVG RSI Time Frame')
- rsi_avg_1 = ta.ema(ta.rsi(inp, 11), avg2)
- rp1 = plot(rsi_avg_1, color=color.new(color.blue, 50), linewidth=1, style=plot.style_line, title='Current AVG RSI Time Frame')
- fc1 = if rsi_avg_1 < rsi_avg
- color.new(color.red, 30)
- else
- color.new(color.green, 30)
- fill(rsi_avg_plot, rp1, color=fc1, transp=0)
- fill_color = if rsi_avg > rsiCurrent and rsi_avg[1] - rsi_avg[0] > rsi_avg_step
- color.new(color.red, 50)
- else if rsi_avg < rsiCurrent and rsi_avg[0] - rsi_avg[1] > rsi_avg_step
- color.new(color.green, 50)
- fill(rsi_current_plot, rsi_avg_plot, color=fill_color, editable=true, title='RSI BAND', transp=50)
- b1 = hline(70, color=color.new(color.green, 100), linestyle=hline.style_dotted, linewidth=1, title='Top Range')
- b = hline(60, color=color.new(color.green, 100), linestyle=hline.style_dotted, linewidth=1, title='High Range')
- s = hline(40, color=color.new(color.red, 100), linestyle=hline.style_dotted, linewidth=1, title='Low Range')
- s1 = hline(30, color=color.new(color.red, 100), linestyle=hline.style_dotted, linewidth=1, title='Bottom Range')
- m = hline(50, color=color.black, linestyle=hline.style_dotted, linewidth=1, title='Mid Range')
- fill(b1, b, color=color.new(color.green, 80))
- fill(s1, s, color=color.new(color.red, 80))
- buy_zone = if rsi_avg[0] - rsi_avg[1] > 1
- true
- else
- false
- plotshape(buy_zone, style=shape.triangleup, location=location.bottom, color=color.new(color.green, 0), size=size.tiny, title='Bulish Symbol')
- sell_zone = if rsi_avg[2] - rsi_avg[1] > 1
- true
- else
- false
- plotshape(sell_zone, style=shape.triangledown, location=location.top, color=color.new(color.red, 0), size=size.tiny, title='Bearish Symbol')
Add Comment
Please, Sign In to add comment