Pine Script: Adding Text Label Interpretation to DMI Indicator on TradingView

Job ID: 38287823

Budget: $10 – $30 USD

I would like to include a text label at the top right of the DMI indicator chart that interprets the ADX, +DI, and -DI values as follows:
• If ADX < 20, the label reads "WEAK / SIDE" in ORANGE font.
• If +DI = -DI, the label reads "TBC" in GREY font.
• If ADX is between 20-40 and +DI > -DI, the label reads "MODERATE / UP" in GREEN font.
• If ADX is between 20-40 and +DI < -DI, the label reads "MODERATE / DOWN" in RED font.
• If ADX > 40 and +DI > -DI, the label reads "STRONG / UP" in BOLD GREEN font.
• If ADX > 40 and +DI < -DI, the label reads "STRONG / DOWN" in BOLD RED font.
Please add this functionality to the script.
Additionally, in the settings dialog box, include options to change:
1. The key ADX numbers (20 and 40).
2. The line and font size & color for each text label option.
Below is the Pine Script for the Directional Movement Index (DMI) indicator in TradingView and an image illustrating the desired text label.

//@version=5
indicator(title="Directional Movement Index", shorttitle="DMI", format=format.price, precision=4, timeframe="", timeframe_gaps=true)
lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50)
len = input.int(14, minval=1, title="DI Length")
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / trur)
minus = fixnan(100 * ta.rma(minusDM, len) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)
plot(adx, color=#F50057, title="ADX")
plot(plus, color=#2962FF, title="+DI")
plot(minus, color=#FF6D00, title="-DI")

If you're comfortable and proficient in Pine Script and can update the indicator right away, please send me a quote.

Thank you!
Related categories: Coding Pine Script