Skip to content
NyriaDocs
Set up your sourceTradingView

TradingView alert messages

Copy-ready TradingView alert messages for a strategy or an indicator, every placeholder you can use, and the mistake that stops an alert from trading.

Copy the alert message for your TradingView script from this page. A strategy() script needs one alert per ticker; an indicator() needs one alert per side. For the full setup, see connect TradingView alerts.

A message can be plain text or JSON, and TradingView fills in placeholders such as {{ticker}} before it sends the alert. The messages below are the defaults Nyria's setup wizard writes. If you write your own, check it on the strategy's Integration tab.

The TradingView alert message builder builds and checks one of these for you, free and with no account needed.

Strategy: one "Order fills only" alert

A strategy() script fires an alert on every order it fills, so you create this alert once per ticker:

{
  "action": "{{strategy.order.action}}",
  "instrument": "{{ticker}}",
  "marketPosition": "{{strategy.market_position}}",
  "prevMarketPosition": "{{strategy.prev_market_position}}",
  "contracts": "{{strategy.order.contracts}}",
  "price": {{close}}
}

If you run an indicator(), convert it to a strategy and this single alert covers every side.

Indicator: one alert per side

An indicator() needs a separate alert for each side. Indicators have no strategy placeholders, so each message spells out its own action and direction.

Long entry

{
  "action": "OPEN",
  "instrument": "{{ticker}}",
  "direction": "LONG",
  "price": {{close}},
  "message": "Open long {{ticker}} at {{close}}"
}

Long exit

{
  "action": "CLOSE",
  "instrument": "{{ticker}}",
  "direction": "LONG",
  "price": {{close}},
  "message": "Close long {{ticker}} at {{close}}"
}

Short entry

{
  "action": "OPEN",
  "instrument": "{{ticker}}",
  "direction": "SHORT",
  "price": {{close}},
  "message": "Open short {{ticker}} at {{close}}"
}

Short exit

{
  "action": "CLOSE",
  "instrument": "{{ticker}}",
  "direction": "SHORT",
  "price": {{close}},
  "message": "Close short {{ticker}} at {{close}}"
}

Placeholders

TradingView replaces these when the alert fires.

PlaceholderBecomesUsed by
{{ticker}}The chart symbol (for example SPY)both
{{close}}Confirmed bar closeboth
{{strategy.order.action}}buy / sellstrategy
{{strategy.market_position}}long / short / flat after the fillstrategy
{{strategy.prev_market_position}}Position before the fillstrategy
{{strategy.order.contracts}}Order size (reference only; Nyria sizes from your bot)strategy
{{interval}}Chart timeframeeither
{{time}} / {{timenow}}Bar open time / alert fire time, UTCeither
{{exchange}}Data source (for example NASDAQ)either
{{plot_0}}–{{plot_19}}Numbered plot values from the scriptindicator

TradingView replaces only its own placeholders. A Pine variable such as {{syminfo.ticker}} reaches Nyria exactly as typed, and nothing trades. Use {{ticker}} in the alert dialog's Message box, or join syminfo.ticker into a Pine alert() string, for example '{"instrument":"' + syminfo.ticker + '"}'.

Next steps

Your edge, on autopilot.

Trading carries risk. Read the risk disclosure.

© 2026 Nyria LLC. All rights reserved.