TradingView alert messages
A copy-paste reference for the JSON Nyria expects in a TradingView alert — the single strategy message, the per-side indicator messages, and every placeholder.
This is a quick reference for the message you paste into TradingView's Message box. For the full walkthrough, see Connect TradingView Alerts to Nyria.
Nyria's parser accepts any format — these are the defaults Nyria's setup wizard generates. Paste your own if you prefer; just confirm it on the strategy's Integration tab before going live.
Strategy — one "Order fills only" alert
A strategy() script fires one alert that covers every order, so you paste this once per ticker:
{
"action": "{{strategy.order.action}}",
"instrument": "{{ticker}}",
"marketPosition": "{{strategy.market_position}}",
"prevMarketPosition": "{{strategy.prev_market_position}}",
"contracts": "{{strategy.order.contracts}}",
"price": {{close}}
}Using an indicator() script instead? Convert it first — Convert an Indicator to a Strategy — so one alert covers every side.
Indicator — one alert per side
An indicator() needs a separate alert per signal. Each side bakes in its own action and direction, so there are no strategy placeholders:
Long entry
{ "action": "OPEN", "instrument": "{{ticker}}", "direction": "LONG", "price": {{close}} }Long exit
{ "action": "CLOSE", "instrument": "{{ticker}}", "direction": "LONG", "price": {{close}} }Short entry
{ "action": "OPEN", "instrument": "{{ticker}}", "direction": "SHORT", "price": {{close}} }Short exit
{ "action": "CLOSE", "instrument": "{{ticker}}", "direction": "SHORT", "price": {{close}} }Placeholders
TradingView substitutes these at fire time:
| Placeholder | Resolves to | Used by |
|---|---|---|
{{ticker}} | The chart symbol (e.g. SPY) | both |
{{close}} | Confirmed bar close | both |
{{strategy.order.action}} | buy / sell | strategy |
{{strategy.market_position}} | long / short / flat after the fill | strategy |
{{strategy.prev_market_position}} | Position before the fill | strategy |
{{strategy.order.contracts}} | Order size (informational — Nyria sizes from your bot) | strategy |
What's next
- Connect TradingView Alerts to Nyria — the full setup walkthrough, including Once Per Bar Close + repainting.
- Convert an Indicator to a Strategy — fold per-side alerts into one.
- Webhook Payload Reference — every field Nyria reads from the message.
Convert a TradingView Indicator to a Strategy
Turn an indicator() Pine Script into a strategy() so a single "Order fills only" alert covers every entry and exit — instead of wiring a separate alert per signal, per ticker.
Stream Discord channel alerts to Nyria
Add the Nyria bot to a Discord server, authorize a channel, and route every alert posted there into a Nyria strategy — including embeds, free-text fallbacks, and quoted-tweet (longed/shorted) calls.