Relay2Trade
Recursos Como funciona Guia de instalação Promoções Preços
English Română Português (Brasil) Español Tiếng Việt Русский Français Türkçe Bahasa Indonesia العربية हिन्दी ไทย Polski
R2T Desk Entrar Começar
R2T Desk Começar

Ajuda

Os artigos de ajuda estão em inglês. Os guias dos recursos, no seu idioma, ficam em Recursos.

TradingView alert messages: what we read

Every message a TradingView alert can send to your listener, and how each is traded: TradingView's own strategy messages, PineConnector lines, JSON from other tools, plain words, the Buy, Sell and Close addresses, and our own format with all it can say. With examples to copy.

You don't have to write anything

Most alerts already say enough. Leave the message as TradingView or your script writes it, paste your address into "Webhook URL", and look at the alert log after the first alert: it says how the message was read ("TradingView strategy", "PineConnector format", "JSON message" and so on) and what was done with it. See TradingView alerts: trade your own indicators and strategies for the setup.

What the message does not say, your settings decide: the size, the stop-loss, the take-profits, the trailing, the limits.

TradingView strategy alerts

A strategy's alert says, by default, something like:

My strategy (14, 2): order buy @ 0.5 filled on XAUUSD. New strategy position is 0.5

It is read as: buy XAUUSD. "@ 0.5" is the size the strategy traded on TradingView; it is used only if "Use the size the alert gives" is on in the listener. The new position after the order tells the rest:

  • 0: the order closed the strategy's trade, so your listener's trades on the symbol that way are closed;
  • the other way, and larger than before: the strategy reversed ("order sell @ 2 … New strategy position is -1"), so the buys close first and the sell opens, sized as the new position;
  • still the same way, smaller: it closed part of its trade ("order sell @ 0.5 … New strategy position is 0.5"), so that share of your listener's buys closes.

The size on TradingView is in the strategy's own units (contracts, coins, ounces), which is not always lots at your broker: check the first trades before you let the alert's size be used.

One alert on the strategy follows every order it makes from then on. If the strategy's author wrote a message of their own for its alerts, that message comes instead, and it is read like any other below.

PineConnector lines

Scripts written for PineConnector work unchanged:

60123456789,buy,EURUSD,risk=0.1,sl=20,tp=40

The first part (your PineConnector licence id) is ignored. We read the commands buy, sell, buylimit, selllimit, buystop, sellstop, closelong, closeshort, closeall, closelongvol, closeshortvol, cancellong, cancelshort, cancelall, newsltplong, newsltpshort, closelongbuy and closeshortsell, and the values risk, vol_lots, sl, tp, sl_pips, tp_pips, sl_price, tp_price, price, betrigger, beoffset, trailtrig, traildist, trailstep, spread and comment.

sl and tp are pips from the entry, as in PineConnector; sl_price and tp_price are prices. A pip there is what PineConnector makes it: ten points of the symbol, on every symbol, for the stop, the targets, the breakeven, the trailing and spread alike, so your lines keep the distances they had. risk and vol_lots are lots, used only if "Use the size the alert gives" is on.

JSON from other tools

A JSON message from another alert tool is read when it names what to do and the symbol, under the usual names: action, side or signal, then symbol, ticker or pair, with sl, stopLoss, tp, takeProfit, price, quantity and the like:

{"ticker":"{{ticker}}","action":"sell","quantity":1,"stopLoss":{"price":2680},"takeProfit":{"price":2620}}

Where the position stands after the order counts too, as TradersPost's sentiment or {{strategy.market_position}} says it: a sell that leaves it flat closes the long and opens no short, a buy that leaves it flat closes the short, and a sell that leaves it still long closes part of the long (the quantity):

{"ticker":"{{ticker}}","action":"{{strategy.order.action}}","sentiment":"{{strategy.market_position}}","quantity":"{{strategy.order.contracts}}"}

A single command

A message that is only a command is read exactly, at once and for free: buy, sell (or long, short), close, close long, close short, with or without the symbol, and with the price it fired at if you like. Many indicators' alerts are just that:

buy
SELL {{ticker}}
XAUUSD long
close short
BUY XAUUSD @ 2650.5

The symbol can be anywhere in the message, in capitals or not (XAUUSD, xauusd, OANDA:EURUSD); with none, or with {{ticker}} left unfilled, the listener's "What does it trade?" stands in. A message that names no symbol trades on "What does it trade?", however long it is ("Q-Trend BUY signal were given." buys it). With nothing chosen there, it is an order only when it is a short command, the word alone or with at most two more (sell, buy now please), and anything longer is not traded: the log says the alert does not say which symbol to trade.

Not on a strategy: there {{strategy.order.action}} alone is not enough, because a strategy's exits say buy or sell too, and a sell that only closed the strategy's buy would open a sell on your account. On a strategy, leave TradingView's own message, or use the message the builder in the Desk writes, which says where the position stands after the order.

Plain words

Anything else is plain words, and its direction is never guessed. It must say buy or sell (or long, short, close, exit) once, not both, and a word such as "stopped out", "cancelled" or "closed" after it means the trade ended, not a new order: "Supertrend buy and sell zone" and "BUY stopped out XAUUSD" are not traded, and the log says "Unknown direction". Text with no symbol in it trades on "What does it trade?", above.

When the words do say a direction and carry numbers ("Gold buy now, SL 2640, TP 2665"), our reader reads the levels, as it reads a Telegram message. It works, but it is slower than an exact message, and an alert read this way counts toward your daily signals. For anything you control, an exact message is better.

The Buy, Sell and Close addresses

An alert that says no side ("Crossing Up", "Signal") is traded by the address it was sent to: your address with /buy, /sell or /close at the end. See TradingView alerts: trade your own indicators and strategies.

Our own format

Our format is a JSON message starting with "r2t":1. It says everything an alert can say, and nothing has to be guessed. The setup's "Write the alert's message yourself" writes it for you; this is what it can hold.

Key What it says Example
action buy, sell, close, close_long, close_short, close_partial, breakeven, sl, tp, cancel "action":"buy"
symbol the symbol; TradingView fills in {{ticker}} "symbol":"{{ticker}}"
order market (default), limit or stop, at price "order":"limit","price":2650
price on a market order, the price the alert fired at: your "Max entry deviation" is measured from it "price":{{close}}
sl / sl_pips the stop-loss as a price, or in pips from the entry "sl_pips":30
tp / tp_pips one or several take-profits "tp_pips":[30,60,90]
lots / risk_percent the size (with "Use the size the alert gives" on) "risk_percent":0.5
be_trigger, be_offset stop to the entry after so many pips in profit, and so many pips past it "be_trigger":20,"be_offset":2
trail_trigger, trail_distance, trail_step a trailing stop: starts after, follows behind, moves in steps (pips) "trail_distance":25
max_spread not placed when the spread is wider (points) "max_spread":30
percent / lots for close_partial: how much to close "percent":50
pips / price for sl and tp: where to move them "pips":10
comment, id kept with the trade "comment":"breakout"

Examples:

A buy at the market with a 30-pip stop and three take-profits:

{"r2t":1,"action":"buy","symbol":"{{ticker}}","price":{{close}},"sl_pips":30,"tp_pips":[30,60,90]}

A sell limit at a price, with a breakeven after 20 pips:

{"r2t":1,"action":"sell","symbol":"EURUSD","order":"limit","price":1.1050,"sl":1.1080,"tp":1.0990,"be_trigger":20}

Close half of the listener's buys on the symbol:

{"r2t":1,"action":"close_partial","symbol":"{{ticker}}","percent":50}

For a strategy, one message for every order (what the builder writes "For a strategy"):

{"r2t":1,"action":"{{strategy.order.action}}","symbol":"{{ticker}}","position":"{{strategy.market_position}}","prev_position":"{{strategy.prev_market_position}}","position_size":{{strategy.market_position_size}},"prev_position_size":{{strategy.prev_market_position_size}},"price":{{close}},"id":"{{strategy.order.id}}"}

position and prev_position (with their sizes) tell an exit, a partial exit and a reversal from an entry, as in the strategy messages above. The builder writes them for you.

The parts in {{ }}

TradingView fills in the parts in double braces when the alert fires: {{ticker}} the symbol, {{close}} the price, {{strategy.order.action}} buy or sell, and so on. Leave them as they are in the message. Write numbers without quotes ("price":{{close}}), and words in quotes ("symbol":"{{ticker}}").

The symbol is the chart's: when your broker names it differently (GOLD for XAUUSD, EURUSD.m), the app finds the broker's own name as for any signal. Where the names differ more, as crypto often does (BTCUSDT on a Binance chart, BTCUSD at your broker), the alert is skipped and says so: tell the app once under "Symbol names at your broker" in Settings, or open the skipped signal and press "Tell the app what your broker calls BTCUSDT".

© 2026 Relay2Trade
Como funciona Guia de instalação Ajuda Assistentes de IA Recursos Obter o app Contato Status do serviço Aviso legal Termos Privacidade Cookies
Delvarom Systems S.R.L. · Reg. Com. J2023000424528 · CUI RO48122681
Strada Ghioceilor Nr. 33J, Săbăreni, jud. Giurgiu, România · delvarom@delvarom.com
ANPC SAL
Usamos cookies para oferecer a melhor experiência no nosso site. Política de Cookies
Como funciona Guia de instalação Rodando em uma VPS Assistentes de IA Promoções Suporte
Começar
Recursos Preços Download Entrar