Page 1 of 1

pine script strategy exit with alert

Posted: Thu Jan 26, 2023 6:18 pm
by rr1050
Hi friends,

I would like to have a alert when exit through strategy, but custom alert message.

Code: Select all

alertsyntax_golong = 'Any customized message with buy loss profit'  // Custom message

strategy.exit("Long SL", from_entry = "Long", qty_percent = 25, stop=t_stop, alert_message = alertsyntax_golong)
But I am not getting custom message once the strategy.exit

So pls advise how I can get alert with custom message when strategy exit.

Regards, RR1050

Re: pine script strategy exit with alert

Posted: Sun Jan 29, 2023 4:38 am
by Steve Burman
Did you enter a {{strategy.order.alert_message}} placeholder in the message section of the alert? This is needed so that your custom message replaces the placeholder in the alert