Kasper index
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mr2j

//@version=5
indicator("Kasper index")

period = input(title="Period", defval=14)
smooth = input(title="Smooth", defval=3)

crv_close = request.security(symbol="BINANCE:CRVUSDT", timeframe=timeframe.period, expression=close)
ada_close = request.security(symbol="BINANCE:ADAUSDT", timeframe=timeframe.period, expression=close)
dash_close = request.security(symbol="BINANCE:DASHUSDT", timeframe=timeframe.period, expression=close)
sol_close = request.security(symbol="BINANCE:SOLUSDT", timeframe=timeframe.period, expression=close)
doge_close = request.security(symbol="BINANCE:DOGEUSDT", timeframe=timeframe.period, expression=close)
xtz_close = request.security(symbol="BINANCE:XTZUSDT", timeframe=timeframe.period, expression=close)


crv_rsi = ta.rsi(crv_close, period)
ada_rsi = ta.rsi(ada_close, period)
dash_rsi = ta.rsi(dash_close, period)
sol_rsi = ta.rsi(sol_close, period)
doge_rsi = ta.rsi(doge_close, period)
xtz_rsi = ta.rsi(xtz_close, period)


index = (crv_rsi + ada_rsi + dash_rsi + sol_rsi + doge_rsi + xtz_rsi) / 6

plot(ta.sma(crv_rsi, smooth), title='CRV', color=color.new(color.red, 50))
plot(ta.sma(ada_rsi, smooth), title='ADA', color=color.new(color.blue, 50))
plot(ta.sma(dash_rsi, smooth), title='DASH', color=color.new(color.green, 50))
plot(ta.sma(sol_rsi, smooth), title='SOL', color=color.new(color.yellow, 50))
plot(ta.sma(doge_rsi, smooth), title='DOGE', color=color.new(color.orange, 50))
plot(ta.sma(xtz_rsi, smooth), title='XTZ', color=color.new(color.white, 50))

plot(ta.sma(index, smooth), title='INDEX', color=color.new(color.lime, 0), linewidth=3)



