Matrix Altcoin Perpetual A-B
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Implemented by © emreyavuz84
// RSI collector for Perpertual coins of A - B

//@version=5
indicator('Matrix Altcoin Perpetual A-B')

ort = input(14)
perp1 = request.security('Binance:1inchusdtperp', timeframe.period, close)
perp2 = request.security('Binance:aaveusdtperp', timeframe.period, close)
perp3 = request.security('Binance:adausdtperp', timeframe.period, close)
perp4 = request.security('Binance:akrousdtperp', timeframe.period, close)
perp5 = request.security('Binance:algousdtperp', timeframe.period, close)
perp6 = request.security('Binance:aliceusdtperp', timeframe.period, close)
perp7 = request.security('Binance:alphausdtperp', timeframe.period, close)
perp8 = request.security('Binance:ankrusdtperp', timeframe.period, close)
perp9 = request.security('Binance:atausdtperp', timeframe.period, close)
perp10 = request.security('Binance:atomusdtperp', timeframe.period, close)
perp11 = request.security('Binance:audiousdtperp', timeframe.period, close)
perp12 = request.security('Binance:avaxusdtperp', timeframe.period, close)
perp13 = request.security('Binance:axsusdtperp', timeframe.period, close)
perp14 = request.security('Binance:bakeusdtperp', timeframe.period, close)
perp15 = request.security('Binance:balusdtperp', timeframe.period, close)
perp16 = request.security('Binance:bandusdtperp', timeframe.period, close)
perp17 = request.security('Binance:batusdtperp', timeframe.period, close)
perp18 = request.security('Binance:bchusdtperp', timeframe.period, close)
perp19 = request.security('Binance:belusdtperp', timeframe.period, close)
perp20 = request.security('Binance:blzusdtperp', timeframe.period, close)
perp21 = request.security('Binance:bnbusdtperp', timeframe.period, close)
perp22 = request.security('Binance:btcusdtperp', timeframe.period, close)
perp23 = request.security('Binance:btsusdtperp', timeframe.period, close)
perp24 = request.security('Binance:1000bttcusdtperp', timeframe.period, close)

rsi1 = ta.rsi(perp1, ort)
rsi2 = ta.rsi(perp2, ort)
rsi3 = ta.rsi(perp3, ort)
rsi4 = ta.rsi(perp4, ort)
rsi5 = ta.rsi(perp5, ort)
rsi6 = ta.rsi(perp6, ort)
rsi7 = ta.rsi(perp7, ort)
rsi8 = ta.rsi(perp8, ort)
rsi9 = ta.rsi(perp9, ort)
rsi10 = ta.rsi(perp10, ort)
rsi11 = ta.rsi(perp11, ort)
rsi12 = ta.rsi(perp12, ort)
rsi13 = ta.rsi(perp13, ort)
rsi14 = ta.rsi(perp14, ort)
rsi15 = ta.rsi(perp15, ort)
rsi16 = ta.rsi(perp16, ort)
rsi17 = ta.rsi(perp17, ort)
rsi18 = ta.rsi(perp18, ort)
rsi19 = ta.rsi(perp19, ort)
rsi20 = ta.rsi(perp20, ort)
rsi21 = ta.rsi(perp21, ort)
rsi22 = ta.rsi(perp22, ort)
rsi23 = ta.rsi(perp23, ort)
rsi24 = ta.rsi(perp24, ort)


plot(rsi1, color=rsi1 >= rsi1[1] ? rsi1[1] >= rsi1[2] ? #00ff00 : #00aa00 : rsi1[1] < rsi1[2] ? #ff0000 : #aa0000, title='1INCH', transp=70)
plot(rsi2, color=rsi2 >= rsi2[1] ? rsi2[1] >= rsi2[2] ? #00ff00 : #00aa00 : rsi2[1] < rsi2[2] ? #ff0000 : #aa0000, title='AAVE', transp=70)
plot(rsi3, color=rsi3 >= rsi3[1] ? rsi3[1] >= rsi3[2] ? #00ff00 : #00aa00 : rsi3[1] < rsi3[2] ? #ff0000 : #aa0000, title='ADA', transp=70)
plot(rsi4, color=rsi4 >= rsi4[1] ? rsi4[1] >= rsi4[2] ? #00ff00 : #00aa00 : rsi4[1] < rsi4[2] ? #ff0000 : #aa0000, title='AKRO', transp=70)
plot(rsi5, color=rsi5 >= rsi5[1] ? rsi5[1] >= rsi5[2] ? #00ff00 : #00aa00 : rsi5[1] < rsi5[2] ? #ff0000 : #aa0000, title='ALGO', transp=70)
plot(rsi6, color=rsi6 >= rsi6[1] ? rsi6[1] >= rsi6[2] ? #00ff00 : #00aa00 : rsi6[1] < rsi6[2] ? #ff0000 : #aa0000, title='ALICE', transp=70)
plot(rsi7, color=rsi7 >= rsi7[1] ? rsi7[1] >= rsi7[2] ? #00ff00 : #00aa00 : rsi7[1] < rsi7[2] ? #ff0000 : #aa0000, title='ALPHA', transp=70)
plot(rsi8, color=rsi8 >= rsi8[1] ? rsi8[1] >= rsi8[2] ? #00ff00 : #00aa00 : rsi8[1] < rsi8[2] ? #ff0000 : #aa0000, title='ANKR', transp=70)
plot(rsi9, color=rsi9 >= rsi9[1] ? rsi9[1] >= rsi9[2] ? #00ff00 : #00aa00 : rsi9[1] < rsi9[2] ? #ff0000 : #aa0000, title='ATA', transp=70)
plot(rsi10, color=rsi10 >= rsi10[1] ? rsi10[1] >= rsi10[2] ? #00ff00 : #00aa00 : rsi10[1] < rsi10[2] ? #ff0000 : #aa0000, title='ATOM', transp=70)
plot(rsi11, color=rsi11 >= rsi11[1] ? rsi11[1] >= rsi11[2] ? #00ff00 : #00aa00 : rsi11[1] < rsi11[2] ? #ff0000 : #aa0000, title='AUDIO', transp=70)
plot(rsi12, color=rsi12 >= rsi12[1] ? rsi12[1] >= rsi12[2] ? #00ff00 : #00aa00 : rsi12[1] < rsi12[2] ? #ff0000 : #aa0000, title='AVAX', transp=70)
plot(rsi13, color=rsi13 >= rsi13[1] ? rsi13[1] >= rsi13[2] ? #00ff00 : #00aa00 : rsi13[1] < rsi13[2] ? #ff0000 : #aa0000, title='AXS', transp=70)
plot(rsi14, color=rsi14 >= rsi14[1] ? rsi14[1] >= rsi14[2] ? #00ff00 : #00aa00 : rsi14[1] < rsi14[2] ? #ff0000 : #aa0000, title='BAKE', transp=70)
plot(rsi15, color=rsi15 >= rsi15[1] ? rsi15[1] >= rsi15[2] ? #00ff00 : #00aa00 : rsi15[1] < rsi15[2] ? #ff0000 : #aa0000, title='BAL', transp=70)
plot(rsi16, color=rsi16 >= rsi16[1] ? rsi16[1] >= rsi16[2] ? #00ff00 : #00aa00 : rsi16[1] < rsi16[2] ? #ff0000 : #aa0000, title='BAND', transp=70)
plot(rsi17, color=rsi17 >= rsi17[1] ? rsi17[1] >= rsi17[2] ? #00ff00 : #00aa00 : rsi17[1] < rsi17[2] ? #ff0000 : #aa0000, title='BAT', transp=70)
plot(rsi18, color=rsi18 >= rsi18[1] ? rsi18[1] >= rsi18[2] ? #00ff00 : #00aa00 : rsi18[1] < rsi18[2] ? #ff0000 : #aa0000, title='BCH', transp=70)
plot(rsi19, color=rsi19 >= rsi19[1] ? rsi19[1] >= rsi19[2] ? #00ff00 : #00aa00 : rsi19[1] < rsi19[2] ? #ff0000 : #aa0000, title='BEL', transp=70)
plot(rsi20, color=rsi20 >= rsi20[1] ? rsi20[1] >= rsi20[2] ? #00ff00 : #00aa00 : rsi20[1] < rsi20[2] ? #ff0000 : #aa0000, title='BLZ', transp=70)
plot(rsi21, color=rsi21 >= rsi21[1] ? rsi21[1] >= rsi21[2] ? #00ff00 : #00aa00 : rsi21[1] < rsi21[2] ? #ff0000 : #aa0000, title='BNB', transp=70)
plot(rsi22, color=rsi22 >= rsi22[1] ? rsi22[1] >= rsi22[2] ? #00ff00 : #00aa00 : rsi22[1] < rsi22[2] ? #ff0000 : #aa0000, title='BTC', transp=70)
plot(rsi23, color=rsi23 >= rsi23[1] ? rsi23[1] >= rsi23[2] ? #00ff00 : #00aa00 : rsi23[1] < rsi23[2] ? #ff0000 : #aa0000, title='BTS', transp=70)
plot(rsi24, color=rsi24 >= rsi24[1] ? rsi24[1] >= rsi24[2] ? #00ff00 : #00aa00 : rsi24[1] < rsi24[2] ? #ff0000 : #aa0000, title='1000BTTC', transp=70)


c1 = input(color.lime, title='1INCH')
var label1 = label.new(0, rsi1, text='1inch', style=label.style_none, textalign=text.align_right, textcolor=c1, size=size.normal)
label.set_x(label1, 0)
label.set_xloc(label1, time, xloc.bar_time)
label.set_y(label1, rsi1)

c2 = input(color.white, title='AAVE')
var label2 = label.new(0, rsi2, text='aave', style=label.style_none, textalign=text.align_right, textcolor=c2, size=size.normal)
label.set_x(label2, 0)
label.set_xloc(label2, time, xloc.bar_time)
label.set_y(label2, rsi2)

c3 = input(color.gray, title='ADA')
var label3 = label.new(0, rsi3, text='ada', style=label.style_none, textalign=text.align_right, textcolor=c3, size=size.normal)
label.set_x(label3, 0)
label.set_xloc(label3, time, xloc.bar_time)
label.set_y(label3, rsi3)

c4 = input(color.gray, title='AKRO')
var label4 = label.new(0, rsi4, text='akro', style=label.style_none, textalign=text.align_right, textcolor=c4, size=size.normal)
label.set_x(label4, 0)
label.set_xloc(label4, time, xloc.bar_time)
label.set_y(label4, rsi4)

c5 = input(color.white, title='ALGO')
var label5 = label.new(0, rsi5, text='algo', style=label.style_none, textalign=text.align_right, textcolor=c5, size=size.normal)
label.set_x(label5, 0)
label.set_xloc(label5, time, xloc.bar_time)
label.set_y(label5, rsi5)

c6 = input(color.gray, title='ALICE')
var label6 = label.new(0, rsi6, text='alice', style=label.style_none, textalign=text.align_right, textcolor=c6, size=size.normal)
label.set_x(label6, 0)
label.set_xloc(label6, time, xloc.bar_time)
label.set_y(label6, rsi6)

c7 = input(color.gray, title='ALPHA')
var label7 = label.new(0, rsi7, text='alpha', style=label.style_none, textalign=text.align_right, textcolor=c7, size=size.normal)
label.set_x(label7, 0)
label.set_xloc(label7, time, xloc.bar_time)
label.set_y(label7, rsi7)

c8 = input(color.white, title='ANKR')
var label8 = label.new(0, rsi8, text='ankr', style=label.style_none, textalign=text.align_right, textcolor=c8, size=size.normal)
label.set_x(label8, 0)
label.set_xloc(label8, time, xloc.bar_time)
label.set_y(label8, rsi8)

c9 = input(color.gray, title='ATA')
var label9 = label.new(0, rsi9, text='ata', style=label.style_none, textalign=text.align_right, textcolor=color.white, size=size.normal)
label.set_x(label9, 0)
label.set_xloc(label9, time, xloc.bar_time)
label.set_y(label9, rsi9)

c10 = input(color.white, title='ATOM')
var label10 = label.new(0, rsi10, text='atom', style=label.style_none, textalign=text.align_right, textcolor=c10, size=size.normal)
label.set_x(label10, 0)
label.set_xloc(label10, time, xloc.bar_time)
label.set_y(label10, rsi10)

c11 = input(color.gray, title='AUDIO')
var label11 = label.new(0, rsi11, text='audio', style=label.style_none, textalign=text.align_right, textcolor=c11, size=size.normal)
label.set_x(label11, 0)
label.set_xloc(label11, time, xloc.bar_time)
label.set_y(label11, rsi11)

c12 = input(color.white, title='AVAX')
var label12 = label.new(0, rsi12, text='avax', style=label.style_none, textalign=text.align_right, textcolor=c12, size=size.normal)
label.set_x(label12, 0)
label.set_xloc(label12, time, xloc.bar_time)
label.set_y(label12, rsi12)

c13 = input(color.gray, title='AXS')
var label13 = label.new(0, rsi13, text='axs', style=label.style_none, textalign=text.align_right, textcolor=c13, size=size.normal)
label.set_x(label13, 0)
label.set_xloc(label13, time, xloc.bar_time)
label.set_y(label13, rsi13)

c14 = input(color.white, title='BAKE')
var label14 = label.new(0, rsi14, text='bake', style=label.style_none, textalign=text.align_right, textcolor=c14, size=size.normal)
label.set_x(label14, 0)
label.set_xloc(label14, time, xloc.bar_time)
label.set_y(label14, rsi14)

c15 = input(color.gray, title='BAL')
var label15 = label.new(0, rsi15, text='bal', style=label.style_none, textalign=text.align_right, textcolor=c15, size=size.normal)
label.set_x(label15, 0)
label.set_xloc(label15, time, xloc.bar_time)
label.set_y(label15, rsi15)

c16 = input(color.white, title='BAND')
var label16 = label.new(0, rsi16, text='band', style=label.style_none, textalign=text.align_right, textcolor=c16, size=size.normal)
label.set_x(label16, 0)
label.set_xloc(label16, time, xloc.bar_time)
label.set_y(label16, rsi16)

c17 = input(color.gray, title='BAT')
var label17 = label.new(0, rsi17, text='bat', style=label.style_none, textalign=text.align_right, textcolor=c17, size=size.normal)
label.set_x(label17, 0)
label.set_xloc(label17, time, xloc.bar_time)
label.set_y(label17, rsi17)

c18 = input(color.gray, title='BCH')
var label18 = label.new(0, rsi18, text='bch', style=label.style_none, textalign=text.align_right, textcolor=c18, size=size.normal)
label.set_x(label18, 0)
label.set_xloc(label18, time, xloc.bar_time)
label.set_y(label18, rsi18)

c19 = input(color.white, title='BEL')
var label19 = label.new(0, rsi19, text='bel', style=label.style_none, textalign=text.align_right, textcolor=c19, size=size.normal)
label.set_x(label19, 0)
label.set_xloc(label19, time, xloc.bar_time)
label.set_y(label19, rsi19)

c20 = input(color.gray, title='BLZ')
var label20 = label.new(0, rsi20, text='blz', style=label.style_none, textalign=text.align_right, textcolor=c20, size=size.normal)
label.set_x(label20, 0)
label.set_xloc(label20, time, xloc.bar_time)
label.set_y(label20, rsi20)

c21 = input(color.white, title='BNB')
var label21 = label.new(0, rsi21, text='bnb', style=label.style_none, textalign=text.align_right, textcolor=c21, size=size.normal)
label.set_x(label21, 0)
label.set_xloc(label21, time, xloc.bar_time)
label.set_y(label21, rsi21)

c22 = input(color.white, title='BTC')
var label22 = label.new(0, rsi22, text='btc', style=label.style_none, textalign=text.align_right, textcolor=c22, size=size.normal)
label.set_x(label22, 0)
label.set_xloc(label22, time, xloc.bar_time)
label.set_y(label22, rsi22)

c23 = input(color.gray, title='BTS')
var label23 = label.new(0, rsi23, text='bts', style=label.style_none, textalign=text.align_right, textcolor=c23, size=size.normal)
label.set_x(label23, 0)
label.set_xloc(label23, time, xloc.bar_time)
label.set_y(label23, rsi23)

c24 = input(color.white, title='1000BTTC')
var label24 = label.new(0, rsi24, text='bttc', style=label.style_none, textalign=text.align_right, textcolor=c24, size=size.normal)
label.set_x(label24, 0)
label.set_xloc(label24, time, xloc.bar_time)
label.set_y(label24, rsi24)

band1 = hline(70, color=#00ff00)
band0 = hline(30, color=#ff0000)

