I’ve added a variable value to an alert description (i.e. {{close}}), but it doesn’t work

The value substitution feature, in regards to alertcondition(), only works for scripts that were written in Pine v4 or higher. If, when the alert is fired, the variables in the description are not replaced with values (i.e. it displays Close = {{close}} instead of Close = 45.1), the indicator with the alertcondition() is probably written on earlier versions of Pine and variable descriptions will not work for it.

Here's how it works in Pine v4 or higher:


And here's how it works in earlier Pine versions:


This will happen even if you add the variable in the Message field in the Alert dialog (without editing the code itself). If you add the variable there and it isn’t replaced when the alert is fired, the indicator is most likely written in Pine v3 or lower.

 

If the script is yours, you can use our Converter to convert a v3 script to v4. You can read more about the feature here. If this script is from the public library, you can contact its author and ask them to update the indicator to v4.

Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out