fix: Pine Script string concatenation - single line for alertMessage
Pine Script v6 doesn't support multi-line string concatenation with + Put entire JSON string on single line instead
This commit is contained in:
@@ -26,15 +26,7 @@ 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
|
||||
var string 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"}'
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user