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

//@version=5
indicator("TradingGroundhog - Fundamental Analysis - Multiple RSI Ema", overlay = false)

// Price
ID_1  = input.symbol(title='USDT  Market', defval='BINANCE:EURUSDT', group='Basic Settings')
ID_2  = input.symbol(title='BUSD  Market', defval='BINANCE:EURBUSD', group='Basic Settings')
ID_3  = input.symbol(title='SHIB  Market', defval='BINANCE:SHIBEUR', group='Basic Settings')
ID_4  = input.symbol(title='SOL   Market', defval='BINANCE:SOLEUR',   group='Basic Settings')
ID_5  = input.symbol(title='DOT   Market', defval='BINANCE:DOTEUR',   group='Basic Settings')
ID_6  = input.symbol(title='BTC   Market', defval='BINANCE:BTCEUR',   group='Basic Settings')
ID_7  = input.symbol(title='XRP   Market', defval='BINANCE:XRPEUR',   group='Basic Settings')
ID_8  = input.symbol(title='ETH   Market', defval='BINANCE:ETHEUR',   group='Basic Settings')
ID_9  = input.symbol(title='ADA   Market', defval='BINANCE:ADAEUR',   group='Basic Settings')
ID_10 = input.symbol(title='LUNA  Market', defval='BINANCE:LUNAEUR', group='Basic Settings')
ID_11 = input.symbol(title='AVAX  Market', defval='BINANCE:AVAXEUR', group='Basic Settings')
ID_12 = input.symbol(title='VET   Market', defval='BINANCE:VETEUR',   group='Basic Settings')
ID_13 = input.symbol(title='BNB   Market', defval='BINANCE:BNBEUR',   group='Basic Settings')
ID_14 = input.symbol(title='DOGE  Market', defval='BINANCE:DOGEEUR', group='Basic Settings')
ID_15 = input.symbol(title='EGLD  Market', defval='BINANCE:EGLDEUR', group='Basic Settings')
ID_16 = input.symbol(title='GRT   Market', defval='BINANCE:GRTEUR',   group='Basic Settings')
ID_17 = input.symbol(title='MATIC Market', defval='BINANCE:MATICEUR',group='Basic Settings')
ID_18 = input.symbol(title='HOT   Market', defval='BINANCE:HOTEUR',   group='Basic Settings')
ID_19 = input.symbol(title='LINK  Market', defval='BINANCE:LINKEUR', group='Basic Settings')
ID_20 = input.symbol(title='ICP   Market', defval='BINANCE:ICPEUR',   group='Basic Settings')

// Plot Settings
int Decreasing_shade = input.int(85, 'Decreasing RSI Transparence', group='Plot Settings')
int RSI_filter_min = input.int(10, 'RSI Limitation', group='Plot Settings')
int hhigh_RSI = input.int(60, 'High D RSI', group='Plot Settings')
int mid_RSI = input.int(55, 'Avarage RSI', group='Plot Settings')
int hlow_RSI = input.int(50, 'Low RSI', group='Plot Settings')

// RSI Settings
Source_Market = input(title="Source_Market", defval=close, group='Advance Settings')
int RSI_Ema_Input = input.int(22, 'RSI EMA Length', group='Advance Settings')
int RSI_Input = input.int(14, 'RSI Length', group='Advance Settings')
int Max = 100
int Min = 0



I_1  = request.security(ID_1 , timeframe=timeframe.period, expression=Source_Market)
I_2  = request.security(ID_2 , timeframe=timeframe.period, expression=Source_Market)
I_3  = request.security(ID_3 , timeframe=timeframe.period, expression=Source_Market)
I_4  = request.security(ID_4 , timeframe=timeframe.period, expression=Source_Market)
I_5  = request.security(ID_5 , timeframe=timeframe.period, expression=Source_Market)
I_6  = request.security(ID_6 , timeframe=timeframe.period, expression=Source_Market)
I_7  = request.security(ID_7 , timeframe=timeframe.period, expression=Source_Market)
I_8  = request.security(ID_8 , timeframe=timeframe.period, expression=Source_Market)
I_9  = request.security(ID_9 , timeframe=timeframe.period, expression=Source_Market)
I_10 = request.security(ID_10, timeframe=timeframe.period, expression=Source_Market)
I_11 = request.security(ID_11, timeframe=timeframe.period, expression=Source_Market)
I_12 = request.security(ID_12, timeframe=timeframe.period, expression=Source_Market)
I_13 = request.security(ID_13, timeframe=timeframe.period, expression=Source_Market)
I_14 = request.security(ID_14, timeframe=timeframe.period, expression=Source_Market)
I_15 = request.security(ID_15, timeframe=timeframe.period, expression=Source_Market)
I_16 = request.security(ID_16, timeframe=timeframe.period, expression=Source_Market)
I_17 = request.security(ID_17, timeframe=timeframe.period, expression=Source_Market)
I_18 = request.security(ID_18, timeframe=timeframe.period, expression=Source_Market)
I_19 = request.security(ID_19, timeframe=timeframe.period, expression=Source_Market)
I_20 = request.security(ID_20, timeframe=timeframe.period, expression=Source_Market)

// Draw line
MAX_rsi = hline(Max, title='Max', linewidth=2)
HIGH_rsi= hline(hhigh_RSI, title='High', linewidth=2)
MID_rsi = hline(mid_RSI, title='Mid', linewidth=2)
LOW_rsi = hline(hlow_RSI, title='Low', linewidth=2)
MIN_rsi = hline(Min, title='Min', linewidth=2)
fill(HIGH_rsi, MAX_rsi, color=color.rgb(152, 255, 152,80))
fill(MID_rsi, HIGH_rsi, color=color.rgb(208, 240, 192,80))
fill(LOW_rsi, MID_rsi, color=color.rgb(253, 188, 180,80))
fill(MIN_rsi, LOW_rsi, color=color.rgb(255, 153, 153,80))

// RSI
RSI_1  = ta.rsi(I_1 ,RSI_Input)
RSI_2  = ta.rsi(I_2 ,RSI_Input)
RSI_3  = ta.rsi(I_3 ,RSI_Input)
RSI_4  = ta.rsi(I_4 ,RSI_Input)
RSI_5  = ta.rsi(I_5 ,RSI_Input)
RSI_6  = ta.rsi(I_6 ,RSI_Input)
RSI_7  = ta.rsi(I_7 ,RSI_Input)
RSI_8  = ta.rsi(I_8 ,RSI_Input)
RSI_9  = ta.rsi(I_9 ,RSI_Input)
RSI_10 = ta.rsi(I_10,RSI_Input)
RSI_11 = ta.rsi(I_11,RSI_Input)
RSI_12 = ta.rsi(I_12,RSI_Input)
RSI_13 = ta.rsi(I_13,RSI_Input)
RSI_14 = ta.rsi(I_14,RSI_Input)
RSI_15 = ta.rsi(I_15,RSI_Input)
RSI_16 = ta.rsi(I_16,RSI_Input)
RSI_17 = ta.rsi(I_17,RSI_Input)
RSI_18 = ta.rsi(I_18,RSI_Input)
RSI_19 = ta.rsi(I_19,RSI_Input)
RSI_20 = ta.rsi(I_20,RSI_Input)

// Ema_RSI
RSI_Ema_1  = ta.ema(RSI_1 ,RSI_Ema_Input)
RSI_Ema_2  = ta.ema(RSI_2 ,RSI_Ema_Input)
RSI_Ema_3  = ta.ema(RSI_3 ,RSI_Ema_Input)
RSI_Ema_4  = ta.ema(RSI_4 ,RSI_Ema_Input)
RSI_Ema_5  = ta.ema(RSI_5 ,RSI_Ema_Input)
RSI_Ema_6  = ta.ema(RSI_6 ,RSI_Ema_Input)
RSI_Ema_7  = ta.ema(RSI_7 ,RSI_Ema_Input)
RSI_Ema_8  = ta.ema(RSI_8 ,RSI_Ema_Input)
RSI_Ema_9  = ta.ema(RSI_9 ,RSI_Ema_Input)
RSI_Ema_10 = ta.ema(RSI_10,RSI_Ema_Input)
RSI_Ema_11 = ta.ema(RSI_11,RSI_Ema_Input)
RSI_Ema_12 = ta.ema(RSI_12,RSI_Ema_Input)
RSI_Ema_13 = ta.ema(RSI_13,RSI_Ema_Input)
RSI_Ema_14 = ta.ema(RSI_14,RSI_Ema_Input)
RSI_Ema_15 = ta.ema(RSI_15,RSI_Ema_Input)
RSI_Ema_16 = ta.ema(RSI_16,RSI_Ema_Input)
RSI_Ema_17 = ta.ema(RSI_17,RSI_Ema_Input)
RSI_Ema_18 = ta.ema(RSI_18,RSI_Ema_Input)
RSI_Ema_19 = ta.ema(RSI_19,RSI_Ema_Input)
RSI_Ema_20 = ta.ema(RSI_20,RSI_Ema_Input)

// Label Var
var L_1  = label.new(bar_index, I_1 , ID_1 , style=label.style_label_lower_left, color =color.rgb(239, 154, 154), size=size.small)
var L_2  = label.new(bar_index, I_2 , ID_2 , style=label.style_label_lower_left, color =color.rgb(244, 143, 177), size=size.small)
var L_3  = label.new(bar_index, I_3 , ID_3 , style=label.style_label_lower_left, color =color.rgb(206, 147, 216), size=size.small)
var L_4  = label.new(bar_index, I_4 , ID_4 , style=label.style_label_lower_left, color =color.rgb(179, 157, 219) , size=size.small)
var L_5  = label.new(bar_index, I_5 , ID_5 , style=label.style_label_lower_left, color =color.rgb(159, 168, 218) , size=size.small)
var L_6  = label.new(bar_index, I_6 , ID_6 , style=label.style_label_lower_left, color =color.rgb(144, 202, 249) , size=size.small)
var L_7  = label.new(bar_index, I_7 , ID_7 , style=label.style_label_lower_left, color =color.rgb(129, 212, 250), size=size.small)
var L_8  = label.new(bar_index, I_8 , ID_8 , style=label.style_label_lower_left, color =color.rgb(128, 222, 234), size=size.small)
var L_9  = label.new(bar_index, I_9 , ID_9 , style=label.style_label_lower_left, color =color.rgb(128, 203, 196), size=size.small)
var L_10 = label.new(bar_index, I_10, ID_10, style=label.style_label_lower_left,color = color.rgb(165, 214, 167), size=size.small)
var L_11 = label.new(bar_index, I_11, ID_11, style=label.style_label_lower_left,color = color.rgb(197, 225, 165), size=size.small)
var L_12 = label.new(bar_index, I_12, ID_12, style=label.style_label_lower_left,color = color.rgb(230, 238, 156) , size=size.small)
var L_13 = label.new(bar_index, I_13, ID_13, style=label.style_label_lower_left,color = color.rgb(255, 245, 157), size=size.small)
var L_14 = label.new(bar_index, I_14, ID_14, style=label.style_label_lower_left,color = color.rgb(255, 224, 130), size=size.small)
var L_15 = label.new(bar_index, I_15, ID_15, style=label.style_label_lower_left,color = color.rgb(255, 204, 128), size=size.small)
var L_16 = label.new(bar_index, I_16, ID_16, style=label.style_label_lower_left,color = color.rgb(255, 171, 145) , size=size.small)
var L_17 = label.new(bar_index, I_17, ID_17, style=label.style_label_lower_left,color = color.rgb(188, 170, 164) , size=size.small)
var L_18 = label.new(bar_index, I_18, ID_18, style=label.style_label_lower_left,color = color.rgb(238, 238, 238) , size=size.small)
var L_19 = label.new(bar_index, I_19, ID_19, style=label.style_label_lower_left,color = color.rgb(176, 190, 197) , size=size.small)
var L_20 = label.new(bar_index, I_20, ID_20, style=label.style_label_lower_left,color = color.rgb(117, 117, 117), size=size.small)

// Label Location
if RSI_filter_min <= RSI_Ema_1 
    label.set_xy(L_1 , bar_index, RSI_Ema_1 )
if RSI_filter_min <= RSI_Ema_2 
    label.set_xy(L_2 , bar_index, RSI_Ema_2 )
if RSI_filter_min <= RSI_Ema_3 
    label.set_xy(L_3 , bar_index, RSI_Ema_3 )
if RSI_filter_min <= RSI_Ema_4 
    label.set_xy(L_4 , bar_index, RSI_Ema_4 )
if RSI_filter_min <= RSI_Ema_5 
    label.set_xy(L_5 , bar_index, RSI_Ema_5 )
if RSI_filter_min <= RSI_Ema_6 
    label.set_xy(L_6 , bar_index, RSI_Ema_6 )
if RSI_filter_min <= RSI_Ema_7 
    label.set_xy(L_7 , bar_index, RSI_Ema_7 )
if RSI_filter_min <= RSI_Ema_8 
    label.set_xy(L_8 , bar_index, RSI_Ema_8 )
if RSI_filter_min <= RSI_Ema_9 
    label.set_xy(L_9 , bar_index, RSI_Ema_9 )
if RSI_filter_min <= RSI_Ema_10
    label.set_xy(L_10, bar_index, RSI_Ema_10)
if RSI_filter_min <= RSI_Ema_11
    label.set_xy(L_11, bar_index, RSI_Ema_11)
if RSI_filter_min <= RSI_Ema_12
    label.set_xy(L_12, bar_index, RSI_Ema_12)
if RSI_filter_min <= RSI_Ema_13
    label.set_xy(L_13, bar_index, RSI_Ema_13)
if RSI_filter_min <= RSI_Ema_14
    label.set_xy(L_14, bar_index, RSI_Ema_14)
if RSI_filter_min <= RSI_Ema_15
    label.set_xy(L_15, bar_index, RSI_Ema_15)
if RSI_filter_min <= RSI_Ema_16
    label.set_xy(L_16, bar_index, RSI_Ema_16)
if RSI_filter_min <= RSI_Ema_17
    label.set_xy(L_17, bar_index, RSI_Ema_17)
if RSI_filter_min <= RSI_Ema_18
    label.set_xy(L_18, bar_index, RSI_Ema_18)
if RSI_filter_min <= RSI_Ema_19
    label.set_xy(L_19, bar_index, RSI_Ema_19)
if RSI_filter_min <= RSI_Ema_20
    label.set_xy(L_20, bar_index, RSI_Ema_20)

// Plot RSI
plot(RSI_Ema_1, linewidth= 2 ,color=RSI_Ema_1 > RSI_Ema_1[1] ?   color.rgb(239, 154, 154, RSI_filter_min <= RSI_Ema_1 ? 0:100):color.rgb(239, 154, 154, RSI_filter_min <= RSI_Ema_1 ? Decreasing_shade:100))
plot(RSI_Ema_2, linewidth= 2 ,color=RSI_Ema_2 > RSI_Ema_2[1] ?   color.rgb(244, 143, 177, RSI_filter_min <= RSI_Ema_2 ? 0:100) :color.rgb(244, 143, 177, RSI_filter_min <= RSI_Ema_2 ? Decreasing_shade:100))
plot(RSI_Ema_3, linewidth= 2 ,color=RSI_Ema_3 > RSI_Ema_3[1] ?   color.rgb(206, 147, 216, RSI_filter_min <= RSI_Ema_3 ? 0:100) :color.rgb(206, 147, 216, RSI_filter_min <= RSI_Ema_3 ? Decreasing_shade:100))
plot(RSI_Ema_4, linewidth= 2 ,color=RSI_Ema_4 > RSI_Ema_4[1] ?   color.rgb(179, 157, 219, RSI_filter_min <= RSI_Ema_4 ? 0:100):color.rgb(179, 157, 219, RSI_filter_min <= RSI_Ema_4 ? Decreasing_shade:100))
plot(RSI_Ema_5, linewidth= 2 ,color=RSI_Ema_5 > RSI_Ema_5[1] ?   color.rgb(159, 168, 218, RSI_filter_min <= RSI_Ema_5 ? 0:100) :color.rgb(159, 168, 218, RSI_filter_min <= RSI_Ema_5 ? Decreasing_shade:100))
plot(RSI_Ema_6, linewidth= 2 ,color=RSI_Ema_6 > RSI_Ema_6[1] ?   color.rgb(144, 202, 249, RSI_filter_min <= RSI_Ema_6 ? 0:100):color.rgb(144, 202, 249, RSI_filter_min <= RSI_Ema_6 ? Decreasing_shade:100))
plot(RSI_Ema_7, linewidth= 2 ,color=RSI_Ema_7 > RSI_Ema_7[1] ?   color.rgb(129, 212, 250, RSI_filter_min <= RSI_Ema_7 ? 0:100) :color.rgb(129, 212, 250, RSI_filter_min <= RSI_Ema_7 ? Decreasing_shade:100))
plot(RSI_Ema_8, linewidth= 2 ,color=RSI_Ema_8 > RSI_Ema_8[1] ?   color.rgb(128, 222, 234, RSI_filter_min <= RSI_Ema_8 ? 0:100) :color.rgb(128, 222, 234, RSI_filter_min <= RSI_Ema_8 ? Decreasing_shade:100))
plot(RSI_Ema_9, linewidth= 2 ,color=RSI_Ema_9 > RSI_Ema_9[1] ?   color.rgb(128, 203, 196, RSI_filter_min <= RSI_Ema_9 ? 0:100) :color.rgb(128, 203, 196, RSI_filter_min <= RSI_Ema_9 ? Decreasing_shade:100))
plot(RSI_Ema_10, linewidth=2 ,color=RSI_Ema_10 > RSI_Ema_10[1] ? color.rgb(165, 214, 167, RSI_filter_min <= RSI_Ema_10 ?0:100)   :color.rgb(165, 214, 167, RSI_filter_min <= RSI_Ema_10? Decreasing_shade:100))
plot(RSI_Ema_11, linewidth=2 ,color=RSI_Ema_11 > RSI_Ema_11[1] ? color.rgb(197, 225, 165, RSI_filter_min <= RSI_Ema_11? 0:100)   :color.rgb(197, 225, 165, RSI_filter_min <= RSI_Ema_11? Decreasing_shade:100))
plot(RSI_Ema_12, linewidth=2 ,color=RSI_Ema_12 > RSI_Ema_12[1] ? color.rgb(230, 238, 156, RSI_filter_min <= RSI_Ema_12? 0:100)   :color.rgb(230, 238, 156, RSI_filter_min <= RSI_Ema_12? Decreasing_shade:100))
plot(RSI_Ema_13, linewidth=2 ,color=RSI_Ema_13 > RSI_Ema_13[1] ? color.rgb(255, 245, 157, RSI_filter_min <= RSI_Ema_13? 0:100)   :color.rgb(255, 245, 157, RSI_filter_min <= RSI_Ema_13? Decreasing_shade:100))
plot(RSI_Ema_14, linewidth=2 ,color=RSI_Ema_14 > RSI_Ema_14[1] ? color.rgb(255, 224, 130, RSI_filter_min <= RSI_Ema_14? 0:100)   :color.rgb(255, 224, 130, RSI_filter_min <= RSI_Ema_14? Decreasing_shade:100))
plot(RSI_Ema_15, linewidth=2 ,color=RSI_Ema_15 > RSI_Ema_15[1] ? color.rgb(255, 204, 128, RSI_filter_min <= RSI_Ema_15? 0:100)   :color.rgb(255, 204, 128, RSI_filter_min <= RSI_Ema_15? Decreasing_shade:100))
plot(RSI_Ema_16, linewidth=2 ,color=RSI_Ema_16 > RSI_Ema_16[1] ? color.rgb(255, 171, 145, RSI_filter_min <= RSI_Ema_16? 0:100)   :color.rgb(255, 171, 145, RSI_filter_min <= RSI_Ema_16? Decreasing_shade:100))
plot(RSI_Ema_17, linewidth=2 ,color=RSI_Ema_17 > RSI_Ema_17[1] ? color.rgb(188, 170, 164, RSI_filter_min <= RSI_Ema_17? 0:100)   :color.rgb(188, 170, 164, RSI_filter_min <= RSI_Ema_17? Decreasing_shade:100))
plot(RSI_Ema_18, linewidth=2 ,color=RSI_Ema_18 > RSI_Ema_18[1] ? color.rgb(238, 238, 238, RSI_filter_min <= RSI_Ema_18? 0:100)   :color.rgb(238, 238, 238, RSI_filter_min <= RSI_Ema_18? Decreasing_shade:100))
plot(RSI_Ema_19, linewidth=2 ,color=RSI_Ema_19 > RSI_Ema_19[1] ? color.rgb(176, 190, 197, RSI_filter_min <= RSI_Ema_19? 0:100)   :color.rgb(176, 190, 197, RSI_filter_min <= RSI_Ema_19? Decreasing_shade:100))
plot(RSI_Ema_20, linewidth=2 ,color=RSI_Ema_20 > RSI_Ema_20[1] ? color.rgb(117, 117, 117, RSI_filter_min <= RSI_Ema_20? 0:100)   :color.rgb(117, 117, 117, RSI_filter_min <= RSI_Ema_20? Decreasing_shade:100))