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.

Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Hur det fungerar Diagramfunktioner Priser Tipsa en vän Ordningsregler Hjälpcenter Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter
Profil Profilinställningar Konto och fakturering Hänvisade vänner Mynt Mina kölappar Hjälpcenter Publicerade idéer Följare Följer Privata meddelanden Chatt Logga ut