Connecting TradingView via webhook: a technical step-by-step guide
From TradingView alerts to MT5 order execution in under a second: how webhooks work, how to structure payloads, and which mistakes to avoid.
2026-04-30
What a webhook is, in practice
A webhook is an HTTP call TradingView sends automatically when an alert fires. Instead of pushing a phone notification, TradingView sends a structured message to a web address you define - in our case, the signal intake endpoint of your Valuera instance.
The advantage over any notification-based setup is latency: the webhook is sent at the exact moment the alert condition is met, with no human intermediary.
Structuring the alert payload
TradingView allows free-form alert message bodies, typically in JSON. The minimum information for correct execution is: symbol, direction (buy/sell), and ideally reference price, stop loss, and take profit. TradingView dynamic variables - such as close price or strategy values - can be inserted directly in the message template.
An operational recommendation: keep payloads minimal and delegate risk rules to the execution platform. Position sizing calculated inside Pine Script does not know your MT5 account's real equity; the execution layer does.
Security and reliability
Every webhook endpoint should be protected by a secret token, so only alerts from your configuration are accepted. Also verify duplicate alert handling: a robust platform applies deduplication logic to prevent one signal, sent twice because of a network glitch, from opening two positions.
Finally, always test the complete flow on a demo account before going live: the chain alert -> webhook -> validation -> order has more links than it appears, and each link should be verified once, thoroughly.