Multiple RSI
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SirDrBroclawEsq


//@version=4
study("Multiple RSI")

rsi1length = input(defval=21, title="RSI 1 Length", minval=1, type=input.integer, group="RSI 1 Settings")
rsi1source = input(defval=close, title="RSI 1 Source", type=input.source, group="RSI 1 Settings")
rsi1set = rsi(rsi1source, rsi1length)

rsi2length = input(defval=14, title="RSI 2 Length", minval=1, type=input.integer, group="RSI 2 Settings")
rsi2source = input(defval=close, title="RSI 2 Source", type=input.source, group="RSI 2 Settings")
rsi2set = rsi(rsi2source, rsi2length)

rsi3length = input(defval=30, title="RSI 3 Length", minval=1, type=input.integer, group="RSI 3 Settings")
rsi3source = input(defval=close, title="RSI 3 Source", type=input.source, group="RSI 3 Settings")
rsi3set = rsi(rsi3source, rsi3length)

rsi4length = input(defval=14, title="RSI 4 Length", minval=1, type=input.integer, group="RSI 4 Settings")
rsi4source = input(defval=close, title="RSI 4 Source", type=input.source, group="RSI 4 Settings")
rsi4set = rsi(rsi4source, rsi4length)

rsi5length = input(defval=14, title="RSI 5 Length", minval=1, type=input.integer, group="RSI 5 Settings")
rsi5source = input(defval=close, title="RSI 5 Source", type=input.source, group="RSI 5 Settings")
rsi5set = rsi(rsi5source, rsi5length)

rsi1 = security(syminfo.tickerid, "5", rsi1set)
rsi2 = security(syminfo.tickerid, "15", rsi2set)
rsi3 = security(syminfo.tickerid, "30", rsi3set)
rsi4 = security(syminfo.tickerid, "60", rsi4set)
rsi5 = security(syminfo.tickerid, "240", rsi5set)

plot(rsi1, color=color.aqua)
plot(rsi2, color=color.navy)
plot(rsi3, color=color.black)
plot(rsi4, color=color.green)
plot(rsi5, color=color.yellow)
