From fe0496121c805e99d622074c15510e0c27ad76ed Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Sat, 1 Nov 2025 11:06:14 +0100 Subject: [PATCH] Fix hardcoded SOL symbol in Pine Script alerts - Use syminfo.ticker to dynamically get symbol name - Strip USD/USDT/PERP suffixes to get base currency - Works for ETH, SOL, BTC, and any other symbol - Alerts now correctly show 'ETH buy' for Ethereum, 'BTC buy' for Bitcoin, etc. This fixes the bug where ETH triggers sent 'SOL buy' alerts. --- workflows/trading/moneyline_v5_final.pinescript | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/workflows/trading/moneyline_v5_final.pinescript b/workflows/trading/moneyline_v5_final.pinescript index 9081a38..73ba218 100644 --- a/workflows/trading/moneyline_v5_final.pinescript +++ b/workflows/trading/moneyline_v5_final.pinescript @@ -187,10 +187,15 @@ lowest20 = ta.lowest(calcL, 20) priceRange = highest20 - lowest20 pricePosition = priceRange == 0 ? 50.0 : ((calcC - lowest20) / priceRange) * 100 -// Build enhanced alert messages with context -longAlertMsg = "SOL buy .P " + str.tostring(timeframe.period) + " | ATR:" + str.tostring(atrPercent, "#.##") + " | ADX:" + str.tostring(adxVal, "#.#") + " | RSI:" + str.tostring(rsi14, "#.#") + " | VOL:" + str.tostring(volumeRatio, "#.##") + " | POS:" + str.tostring(pricePosition, "#.#") +// Extract base currency from ticker (e.g., "ETHUSD" -> "ETH", "SOLUSD" -> "SOL") +baseCurrency = str.replace(syminfo.ticker, "USD", "") +baseCurrency := str.replace(baseCurrency, "USDT", "") +baseCurrency := str.replace(baseCurrency, "PERP", "") -shortAlertMsg = "SOL sell .P " + str.tostring(timeframe.period) + " | ATR:" + str.tostring(atrPercent, "#.##") + " | ADX:" + str.tostring(adxVal, "#.#") + " | RSI:" + str.tostring(rsi14, "#.#") + " | VOL:" + str.tostring(volumeRatio, "#.##") + " | POS:" + str.tostring(pricePosition, "#.#") +// Build enhanced alert messages with context +longAlertMsg = baseCurrency + " buy .P " + str.tostring(timeframe.period) + " | ATR:" + str.tostring(atrPercent, "#.##") + " | ADX:" + str.tostring(adxVal, "#.#") + " | RSI:" + str.tostring(rsi14, "#.#") + " | VOL:" + str.tostring(volumeRatio, "#.##") + " | POS:" + str.tostring(pricePosition, "#.#") + +shortAlertMsg = baseCurrency + " sell .P " + str.tostring(timeframe.period) + " | ATR:" + str.tostring(atrPercent, "#.##") + " | ADX:" + str.tostring(adxVal, "#.#") + " | RSI:" + str.tostring(rsi14, "#.#") + " | VOL:" + str.tostring(volumeRatio, "#.##") + " | POS:" + str.tostring(pricePosition, "#.#") // Fire alerts with dynamic messages (use alert() not alertcondition() for dynamic content) if finalLongSignal