Crypto Market Breadth [QuantVue]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AlgoBuddy

//@version=5

///updated: added 15 total crypto markets show breadth of market, can pick choose tickers///

indicator("Crypto Market Breadth [AlgoBuddy]", overlay=false)

currentTimeFrame = input.timeframe("","Timeframe")

stock1 = input.symbol(defval="BTCUSDT", title="Ticker 1")
stock2 = input.symbol(defval="ETHUSDT", title="Ticker 2")
stock3 = input.symbol(defval="BNBUSDT", title="Ticker 3")
stock4 = input.symbol(defval="XRPUSDT", title="Ticker 4")
stock5 = input.symbol(defval="DOGEUSDT", title="Ticker 5")
stock6 = input.symbol(defval="ADAUSDT", title="Ticker 6")
stock7 = input.symbol(defval="SOLUSDT", title="Ticker 7")
stock8 = input.symbol(defval="MATICUSDT", title="Ticker 8")
stock9 = input.symbol(defval="DOTUSDT", title="Ticker 9")
stock10 = input.symbol(defval="SHIBUSDT", title="Ticker 10")
stock11 = input.symbol(defval="AVAXUSDT", title="Ticker 11")
stock12 = input.symbol(defval="UNIUSDT", title="Ticker 12")
stock13 = input.symbol(defval="LTCUSDT", title="Ticker 13")
stock14 = input.symbol(defval="ATOMUSDT", title="Ticker 14")
stock15 = input.symbol(defval="LINKUSDT", title="Ticker 15")




Price1 = request.security(stock1, "1D", close[1])
Price2 = request.security(stock1, currentTimeFrame, close)

Price3 = request.security(stock2, "1D", close[1])
Price4 = request.security(stock2, currentTimeFrame, close)

Price5 = request.security(stock3, "1D", close[1])
Price6 = request.security(stock3, currentTimeFrame, close)

Price7 = request.security(stock4, "1D", close[1])
Price8 = request.security(stock4, currentTimeFrame, close)

Price9 = request.security(stock5, "1D", close[1])
Price10 = request.security(stock5, currentTimeFrame, close)

Price11 = request.security(stock6, "1D", close[1])
Price12 = request.security(stock6, currentTimeFrame, close)

Price13 = request.security(stock7, "1D", close[1])
Price14 = request.security(stock7, currentTimeFrame, close)

Price15 = request.security(stock8, "1D", close[1])
Price16 = request.security(stock8, currentTimeFrame, close)

Price17 = request.security(stock9, "1D", close[1])
Price18 = request.security(stock9, currentTimeFrame, close)

Price19 = request.security(stock10, "1D", close[1])
Price20 = request.security(stock10, currentTimeFrame, close)

Price21 = request.security(stock11, "1D", close[1])
Price22 = request.security(stock11, currentTimeFrame, close)

Price23 = request.security(stock12, "1D", close[1])
Price24 = request.security(stock12, currentTimeFrame, close)

Price25 = request.security(stock13, "1D", close[1])
Price26 = request.security(stock13, currentTimeFrame, close)

Price27 = request.security(stock14, "1D", close[1])
Price28 = request.security(stock14, currentTimeFrame, close)

Price29 = request.security(stock15, "1D", close[1])
Price30 = request.security(stock15, currentTimeFrame, close)





PercentChg3 = ((Price2 - Price1)+ (Price4 - Price3)+ (Price6 - Price5)+ (Price8 - Price7)+ (Price10 - Price9)+ (Price12 - Price11)+ (Price14 - Price13)+ (Price16 - Price15) + (Price18 - Price17) + (Price20 - Price19) + (Price22-Price21) + (Price24 - Price23) + (Price26 - Price25) + (Price28 - Price27) + (Price30 - Price29))/(Price1+Price3+Price5+Price7+Price9+Price11+Price13+Price15+Price17+Price19+Price21+Price23+Price25+Price27+Price29) *100

plot(PercentChg3,style=plot.style_columns,color=PercentChg3>0 ? color.rgb(156, 209, 158) : color.rgb(216, 145, 145))