From b3e939ee47d106f7ce02010292f0c85695c11c55 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Oct 2025 19:57:39 +0200 Subject: [PATCH] v7: fix alertcondition to const strings; add optional dynamic alert() messages with parameters --- Bullmania_Money_Line_v7.pine | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Bullmania_Money_Line_v7.pine b/Bullmania_Money_Line_v7.pine index 2b38bb3..99653cc 100644 --- a/Bullmania_Money_Line_v7.pine +++ b/Bullmania_Money_Line_v7.pine @@ -179,6 +179,16 @@ plotshape(finalShortSignal, title="Sell Signal", location=location.abovebar, col fill(plot(calcC, display=display.none), plot(upTrend, display=display.none), color=color.new(color.green, 90)) fill(plot(calcC, display=display.none), plot(downTrend, display=display.none), color=color.new(color.red, 90)) -// Alerts (set to Once per bar close) -alertcondition(finalLongSignal, title="Bullmania v7 Buy", message="Buy {{ticker}} {{interval}} | Profile={{activeProfile}} ATR={{atrPeriod}} Mult={{multiplier}} | RSI TF=" + rsiTf + " <= " + str.tostring(rsiOversold)) -alertcondition(finalShortSignal, title="Bullmania v7 Sell", message="Sell {{ticker}} {{interval}} | Profile={{activeProfile}} ATR={{atrPeriod}} Mult={{multiplier}} | RSI TF=" + rsiTf + " >= " + str.tostring(rsiOverbought)) +// Alerts (set to Once per bar close) — message must be a const string +alertcondition(finalLongSignal, title="Bullmania v7 Buy", message="Bullmania v7 Buy | RSI gate") +alertcondition(finalShortSignal, title="Bullmania v7 Sell", message="Bullmania v7 Sell | RSI gate") + +// Optional dynamic alert text for the "Any alert() function call" alert type +useDynAlert = input.bool(true, "Dynamic alert text (Any alert() call)", group="Alerts", tooltip="Enable runtime alert() with detailed message. Use Alerts: 'Any alert() function call' and Once per bar close.") +if barstate.isconfirmed and useDynAlert + if finalLongSignal + dynMsgL = "Buy " + syminfo.ticker + " " + timeframe.period + " | Profile=" + activeProfile + " ATR=" + str.tostring(atrPeriod) + " Mult=" + str.tostring(multiplier) + " | RSI TF=" + rsiTf + " <= " + str.tostring(rsiOversold) + alert(dynMsgL, alert.freq_once_per_bar_close) + if finalShortSignal + dynMsgS = "Sell " + syminfo.ticker + " " + timeframe.period + " | Profile=" + activeProfile + " ATR=" + str.tostring(atrPeriod) + " Mult=" + str.tostring(multiplier) + " | RSI TF=" + rsiTf + " >= " + str.tostring(rsiOverbought) + alert(dynMsgS, alert.freq_once_per_bar_close)