Free reference · cite and reuse
TradingView alert placeholders: the complete reference
Every variable you can put inside an alert message, what it actually returns, the cases where it silently sends raw text instead, and a builder that writes valid webhook JSON for you. Nothing here is paywalled or gated.
Symbol and chart context
Available in every alert, on any indicator or strategy.
| Placeholder | Returns | Example | Watch out for |
|---|---|---|---|
| {{ticker}} | Symbol without the exchange prefix | AAPL | Most webhook receivers expect this, not the full pair. |
| {{exchange}} | Exchange of the chart symbol | NASDAQ | Says DELAYED for delayed feeds, which breaks strict parsers. |
| {{interval}} | Chart timeframe | 15 | Minutes as a bare number; D, W and M for higher timeframes. |
| {{time}} | Bar open time, UTC | 2026-09-16T13:30:00Z | The bar's time, not the moment the alert fired. |
| {{timenow}} | Time the alert fired, UTC | 2026-09-16T13:44:07Z | Use this to measure delivery lag against {{time}}. |
Price and volume
Values from the bar that triggered the alert.
| Placeholder | Returns | Example | Watch out for |
|---|---|---|---|
| {{open}} | Bar open | 182.44 | Chart currency, unrounded. |
| {{high}} | Bar high | 183.10 | On an intrabar alert this is the high so far. |
| {{low}} | Bar low | 182.02 | On an intrabar alert this is the low so far. |
| {{close}} | Bar close or last price | 182.91 | Not final until the bar closes. |
| {{volume}} | Bar volume | 1284300 | Empty on symbols with no volume feed. |
Indicator values
Pulls a number straight out of the script the alert is attached to.
| Placeholder | Returns | Example | Watch out for |
|---|---|---|---|
| {{plot("Name")}} | Current value of a named plot | 64.21 | The name must match the title= argument of the plot exactly, including case. |
| {{plot_0}} | Value of the first plot, by index | 64.21 | Index order follows declaration order. Renaming a plot does not change it; reordering does. |
Strategy alerts only
Only resolve on a strategy() script with alert_message or order alerts.
| Placeholder | Returns | Example | Watch out for |
|---|---|---|---|
| {{strategy.order.action}} | buy or sell | buy | Lowercase. Most bots expect uppercase, so map it on your side. |
| {{strategy.order.contracts}} | Order size | 1 | In contracts, shares or units depending on the instrument. |
| {{strategy.order.price}} | Fill price | 182.91 | Backtest fill, not a live broker fill. |
| {{strategy.order.id}} | Order identifier | Long entry | Whatever string you passed as id=. |
| {{strategy.order.comment}} | Order comment | TP1 | Falls back to the order id when no comment is set. |
| {{strategy.position_size}} | Position size after the order | -1 | Negative when short, 0 when flat. The most reliable way to tell a bot what the target state is. |
| {{strategy.market_position}} | long, short or flat | long | Position after the order, in words. |
| {{strategy.prev_market_position}} | Position before the order | flat | Use it to distinguish an entry from a reversal. |
Alert metadata
Describes the alert itself rather than the market.
| Placeholder | Returns | Example | Watch out for |
|---|---|---|---|
| {{syminfo.currency}} | Quote currency | USD | Useful for multi-currency position sizing. |
| {{syminfo.basecurrency}} | Base currency | BTC | Crypto pairs only. |
| {{syminfo.mintick}} | Minimum tick size | 0.01 | Round prices to this before sending to a broker. |
Webhook JSON builder
Set the field names your receiver expects, copy the result into the alert message box, and TradingView fills in the values on every trigger.
Never put a live API key in an alert message. A passphrase your own server checks is fine; broker credentials are not, because anyone who can read the alert can read them.
Alert message
{ "symbol": "{{ticker}}", "exchange": "{{exchange}}", "timeframe": "{{interval}}", "price": "{{close}}", "bar_time": "{{time}}", "fired_at": "{{timenow}}", "action": "buy", "passphrase": "your-secret-key" }
Four rules that avoid most bugs
- 1.Use Once Per Bar Close unless you deliberately want intrabar triggers. Everything else doubles your messages and sends values from an unfinished bar.
- 2.Treat {{close}} on an open bar as provisional. It is the last traded price, and it can move after your bot has acted on it.
- 3.Send {{strategy.position_size}} rather than only buy or sell. It tells the receiver what the target state is, so a missed message does not leave your bot's idea of the position out of sync with the chart.
- 4.Log {{time}} and {{timenow}} together. The gap between them separates a TradingView delay from a delay in your own server, which is the first thing to check when alerts feel late.
If alerts are firing but nothing arrives, work through the webhook troubleshooting guide; if they arrive twice, see duplicate alerts.
Cite or reuse this page
Free to quote, republish in part, or link from documentation and tutorials, including commercially, with credit and a working link.
Citation
SimpleAlgo. (2026). TradingView Alert Placeholder Reference. Retrieved from https://simplealgo.io/pine-script-alert-reference
Link HTML
<a href="https://simplealgo.io/pine-script-alert-reference">TradingView Alert Placeholder Reference — SimpleAlgo</a>
Alerts that already carry the levels
SimpleAlgo V5 fires alerts with entry, stop and target already in the message, and signals finalise on the candle close, so there is no half-formed bar to guard against. $24.95 per week or $300 per year, with a 7-day money-back guarantee.
Frequently asked questions
- Why is my placeholder printing as literal text?
- Three usual causes: a typo inside the braces, a strategy placeholder used on an indicator alert, or curly quotes pasted from a document instead of straight quotes in {{plot("Name")}}. TradingView does not warn you — it sends the raw text.
- Do placeholders work in the alert name?
- No. They only resolve in the alert message body, not in the alert name field, and not in email subject lines.
- Can I send JSON to a webhook?
- Yes. Put valid JSON in the message body with placeholders as values. Wrap text values in quotes and leave numeric placeholders like {{close}} unquoted if your receiver expects a number.
- Why does my webhook fire twice?
- An alert set to Once Per Bar fires on the forming bar and can re-trigger as the bar updates. Once Per Bar Close fires a single time on the finished bar. Deduplicate on your side using {{time}}, which is identical for repeats of the same bar.
- Is this reference free to use?
- Yes. Copy it, quote it or republish part of it including commercially, as long as you credit SimpleAlgo with a working link.
More TradingView reference material
Guides, docs and tools that pair with alert automation.
Educational reference only. Nothing here is financial advice. SimpleAlgo is not affiliated with, endorsed by, or sponsored by TradingView. TradingView is a trademark of TradingView, Inc.