Help Center › TradingView

Set up TradingView webhook automation

Turn any TradingView alert or strategy into an automated order in about two minutes.

  1. Open Dashboard → TradingView Bot and copy your personal webhook URL
  2. In TradingView create an alert → Notifications tab → enable Webhook URL and paste it TradingView only shows the Webhook URL field when two-factor authentication is enabled on your TradingView account.
  3. Paste this JSON into the alert Message field:
{
  "symbol": "{{ticker}}",
  "action": "buy",
  "price": "{{close}}",
  "stop_loss": "{{plot_0}}",
  "take_profit": "{{plot_1}}",
  "leverage": 10
}
  1. Click Send Test Signal on the dashboard to verify, then save your alert — you're live

Don't want to write JSON by hand? The dashboard has a visual Signal Designer that generates the exact message for you — including the strategy fields below.

Using a Pine strategy() — exits are handled for you

If your alert comes from a Pine strategy with “Order fills only”, sending action on its own is not safe: {{strategy.order.action}} returns sell on an exit as well as on a short entry. Read alone, an exit would open a short instead of closing your position.

Include the position-state fields and AlgoVesta works out entry, exit and reversal from the position itself:

{
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "market_position": "{{strategy.market_position}}",
  "prev_market_position": "{{strategy.prev_market_position}}",
  "position_size": "{{strategy.position_size}}",
  "price": "{{close}}"
}

Partial exits are not supported: if your strategy scales out, the whole position is closed and the dashboard states that explicitly.

Closing a position manually

Send close as the action with the symbol. This works from any alert type — you don't need a strategy.

{
  "symbol": "{{ticker}}",
  "action": "close"
}
🛡️
Signals are verified against your risk rules before execution, and your API keys are trade-only — withdrawal access is technically impossible.
⚠️
The message must be JSON. TradingView sends plain text when the message isn't valid JSON, and its default text (e.g. “BTCUSDT Crossing 1.00”) carries no direction — that signal is rejected and shown as Unrecognised signal format in your dashboard. We never guess on ambiguous text: rejecting a signal is safer than opening an order in the wrong direction.
⚠️
Which account gets the order is set in the dashboard, not in the payload. Each strategy has its own webhook URL and its own target exchange or MetaTrader 5 account. An "exchange" field inside the JSON is ignored — this is deliberate, so a leaked webhook URL cannot redirect your orders.
⚠️
Duplicate protection: identical signals arriving within 10 seconds are ignored automatically (TradingView sometimes retries). A second entry in the same direction on the same account is also held back for 60 seconds — a deliberate guard against double-fills, shown as filtered, not as an error.
⚠️
TradingView stops alerts automatically once 15 of them fire within 3 minutes. If your strategy triggers often, keep that limit in mind.
New to AlgoVesta? It runs your Telegram and TradingView signals across 16 exchanges and MetaTrader with trade-only API access — your funds always stay in your own custody.
Start free trial