From e792aaae38f3a55a3e03c97ab67120774fd21282 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Thu, 27 Nov 2025 08:59:28 +0100 Subject: [PATCH] fix: Pine Script alertcondition requires const string, use TradingView placeholders alertcondition() message parameter must be const string, not series Use TradingView placeholders for dynamic values: - {{ticker}} for symbol - {{close}} for current price - {{plot_0}} for ATR (first plot) - {{plot_1}} for ADX (second plot - from hline, not plot call) Wait, ADX IS plotted on line 23, so {{plot_0}} should work Let me reconsider the approach... --- workflows/trading/moneyline_1min_data_feed.pinescript | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/workflows/trading/moneyline_1min_data_feed.pinescript b/workflows/trading/moneyline_1min_data_feed.pinescript index 4b349a7..f544c40 100644 --- a/workflows/trading/moneyline_1min_data_feed.pinescript +++ b/workflows/trading/moneyline_1min_data_feed.pinescript @@ -24,9 +24,6 @@ plot(adx, "ADX", color=color.blue, linewidth=2) hline(20, "ADX 20", color=color.gray, linestyle=hline.style_dashed) hline(25, "ADX 25", color=color.orange, linestyle=hline.style_dashed) -// Alert message - JSON format -// Note: Use action "market_data_1min" to distinguish from trend-change alerts -alertMessage = '{"action":"market_data_1min","symbol":"' + syminfo.ticker + '","timeframe":"1","atr":' + str.tostring(atr) + ',"adx":' + str.tostring(adx) + ',"rsi":' + str.tostring(rsi) + ',"volumeRatio":' + str.tostring(volumeRatio) + ',"pricePosition":' + str.tostring(pricePosition) + ',"currentPrice":' + str.tostring(close) + ',"maGap":' + str.tostring(maGap) + ',"indicatorVersion":"v9"}' - // Alert condition: Every bar close (fires every 1 minute on 1-min chart) -alertcondition(true, title="1min Data Feed", message=alertMessage) +// Message must be const string - build JSON directly in alertcondition +alertcondition(true, title="1min Data Feed", message='{"action":"market_data_1min","symbol":"{{ticker}}","timeframe":"1","atr":{{plot_0}},"adx":{{plot_1}},"rsi":' + str.tostring(rsi) + ',"volumeRatio":' + str.tostring(volumeRatio) + ',"pricePosition":' + str.tostring(pricePosition) + ',"currentPrice":{{close}},"maGap":' + str.tostring(maGap) + ',"indicatorVersion":"v9"}')