rr1050
Pine Script Rookie
Pine Script Rookie
Posts: 3
Joined: January 11th, 2023

pine script strategy exit with alert

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

Steve Burman
Moderator
Moderator
Posts: 109
Joined: January 13th, 2023

Re: pine script strategy exit with alert

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

Return to “Pine Script Q&A”