'Displaying label on hovering mouse in Pine Script

I have several indicators overlayed on each other, I need to know the data of specific indicator on hovering mouse on it.

Here is the code (I'm two days in programming):

    //@version=5
indicator(title="Moving Average Convergence Divergence", shorttitle="MACD", timeframe="", timeframe_gaps=true)

// WMA Timeframes
Chart = request.security("BINANCE:BTCUSDT", "", (ta.wma(close, 10)))
WMA20 = request.security("BINANCE:BTCUSDT", "20", (ta.wma(close, 10)))
WMA30 = request.security("BINANCE:BTCUSDT", "30", (ta.wma(close, 10)))
WMA40 = request.security("BINANCE:BTCUSDT", "40", (ta.wma(close, 10)))
WMA50 = request.security("BINANCE:BTCUSDT", "50", (ta.wma(close, 10)))
WMA60 = request.security("BINANCE:BTCUSDT", "60", (ta.wma(close, 10)))
WMA70 = request.security("BINANCE:BTCUSDT", "70", (ta.wma(close, 10)))
WMA80 = request.security("BINANCE:BTCUSDT", "80", (ta.wma(close, 10)))
WMA90 = request.security("BINANCE:BTCUSDT", "90", (ta.wma(close, 10)))
WMA100 = request.security("BINANCE:BTCUSDT", "100", (ta.wma(close, 10)))
WMA110 = request.security("BINANCE:BTCUSDT", "110", (ta.wma(close, 10)))
WMA120 = request.security("BINANCE:BTCUSDT", "120", (ta.wma(close, 10)))
WMA130= request.security("BINANCE:BTCUSDT", "130", (ta.wma(close, 10)))
WMA140 = request.security("BINANCE:BTCUSDT", "140", (ta.wma(close, 10)))
WMA150 = request.security("BINANCE:BTCUSDT", "150", (ta.wma(close, 10)))
WMA160 = request.security("BINANCE:BTCUSDT", "160", (ta.wma(close, 10)))
WMA170 = request.security("BINANCE:BTCUSDT", "170", (ta.wma(close, 10)))
WMA180 = request.security("BINANCE:BTCUSDT", "180", (ta.wma(close, 10)))
WMA190 = request.security("BINANCE:BTCUSDT", "190", (ta.wma(close, 10)))

// MACD inputs
fastLength = input(title="Fast Length", defval=20)
slowLength = input(title="Slow Length", defval=50)
signalLength = input.int(title="Signal Smoothing",  minval = 1, maxval = 50, defval = 15)

// Calculating
tf = input.string(title="WMA Source Timeframe", group="MACD 1", defval="Chart", options=["Chart", "20", "30", "40", "50", "60", "70", "80", "90", "100", "110", "120", "130", "140", "150", "160", "170", "180", "190"])
timeframe_ = tf == "Chart" ? Chart : tf == "20" ? WMA20 : tf == "30" ? WMA30 : tf == "40" ? WMA40 : tf == "50" ? WMA50 : tf == "60" ? WMA60 : tf == "70" ? WMA70 : tf == "80" ? WMA80 : tf == "90" ? WMA90 : tf == "100" ? WMA100 : tf == "110" ? WMA110 : tf == "120" ? WMA120 : tf == "130" ? WMA130 : tf == "140" ? WMA140 : tf == "150" ? WMA150 : tf == "160" ? WMA160 : tf == "170" ? WMA170 : tf == "180" ? WMA180 : tf == "190" ? WMA190 : na
src = timeframe_
macd = ta.ema(src, fastLength) - ta.ema(src, slowLength)
signal = ta.ema(macd, signalLength)
hist = macd - signal
plot(hist, title="MACD 1", style=plot.style_line, color=(hist>=0 ? (hist[1] < hist ? color.green : color.green) : (hist[1] < hist ? color.red : color.red)))

Here is how I use indicator (overlaying several): Screenshot

I need to see the “WMA Source Timeframe" value in label when hovering mouse on the line of circles of one of MACDs to distinguish them.

Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source