You've probably seen the term "webhook" thrown around in trading forums and TradingView discussions. It sounds technical, but the concept is surprisingly simple — and it's the backbone of modern automated trading.

What is a Webhook?

A webhook is a message that one system sends to another when something happens. Think of it like a text message between computers.

Real-world analogy: You set a price alert on your phone. When the price hits your level, your phone buzzes. A webhook is the same thing, except instead of buzzing your phone, it sends data to a server that can do something with it — like execute a trade.

Technical definition: A webhook is an HTTP POST request sent to a URL you specify, triggered by an event. The request contains data about what happened (the "payload").

How Webhooks Work in Trading

Here's the flow in plain English:

  1. You set up a condition on TradingView (e.g., "RSI crosses below 30 on EURUSD")
  2. You provide a webhook URL — the address where TradingView should send the notification
  3. When the condition triggers, TradingView sends an HTTP POST request to your URL with a message you defined
  4. Your signal server receives it, validates it, and queues the trade instruction
  5. Your MT5 EA picks it up and executes the trade on your broker

The webhook is step 3 — it's the bridge between "condition met" and "trade executed."

What's in a Webhook Payload?

The payload is the data that gets sent. For trading, it's typically a JSON object describing what to do:

{
  "action": "alertX",
  "symbol": "EURUSD",
  "magic": 1001,
  "direction": "BUY",
  "size": 0.1,
  "sl": 30,
  "tp": 60
}

This tells the signal server: "Open a BUY position on EURUSD, 0.1 lots, with a 30-pip stop loss and 60-pip take profit."

You define this message in TradingView's alert settings. When the alert fires, TradingView sends exactly this text to your webhook URL.

Why Webhooks Instead of Direct Connections?

You might wonder: why not just connect TradingView directly to MT5?

TradingView can't connect to MT5 directly because: - MT5 doesn't have a public API for receiving external connections - MT5 runs on your local machine or VPS, behind firewalls - TradingView runs on their servers — it can't reach into your MT5

A webhook solves this by adding a middleman: - The signal server lives on the internet (accessible to TradingView) - The MT5 EA initiates outbound connections to the signal server (works through firewalls) - The signal server acts as a message broker between the two

This is why the EA polls the server (asks "any new signals?") instead of receiving pushed signals. It's the only architecture that works reliably with MT5's limitations.

Webhook Security

Since your webhook URL can trigger real trades, security matters:

Token Authentication

Include a secret token in the URL or headers. The server rejects any request without the correct token:

https://your-server.com/webhook?token=abc123secret

HMAC Signatures

For programmatic clients (not TradingView, which can't send custom headers), sign the request body with a shared secret. The server verifies the signature:

X-Signature: sha256=a1b2c3d4e5f6...

Timestamp Validation

Include a timestamp in the request. The server rejects requests older than 60 seconds, preventing replay attacks:

X-Timestamp: 1711987200

IP Whitelisting

Some traders restrict their webhook endpoint to only accept requests from TradingView's server IPs. This adds a layer of protection but requires maintaining an IP whitelist.

Setting Up Your First Webhook

On TradingView

  1. Create an alert (any condition — price level, indicator, strategy)
  2. Scroll to "Notifications"
  3. Check "Webhook URL"
  4. Enter your signal server's URL
  5. In the "Message" field, enter your JSON payload
  6. Click "Create"

Important: Webhooks require TradingView Pro or higher. The free plan doesn't support them.

Testing Your Webhook

Before connecting to a live account, test that the webhook works:

Option 1: Use a test endpoint Services like webhook.site give you a temporary URL that displays incoming requests. Paste it as your webhook URL and trigger the alert — you'll see exactly what TradingView sends.

Option 2: Check signal server logs Most signal servers (including iNakaTrader) log incoming webhooks. Trigger a test alert and check the logs for the received payload.

Option 3: Use a demo MT5 account Connect the full pipeline (TradingView → signal server → demo MT5) and verify that test alerts result in demo trades.

Webhook Limitations

No retries: If your server is down when TradingView sends the webhook, the signal is lost. TradingView does not retry failed deliveries. This is why signal persistence on the server side matters.

One URL per alert: Each TradingView alert can only send to one webhook URL. If you need to send to multiple destinations, you'd need a relay/splitter.

No custom headers from TradingView: TradingView's webhook feature only lets you set the URL and message body. You can't add custom HTTP headers. This limits authentication to URL parameters or body-based methods.

Rate considerations: If many alerts fire simultaneously (e.g., market open), some may be slightly delayed. For most strategies, this delay is negligible.

Webhooks Beyond TradingView

While TradingView is the most popular source of trading webhooks, the concept works with any system that can send HTTP requests:

The signal server doesn't care where the webhook comes from — as long as it's properly authenticated and formatted, it will queue the signal for MT5 execution.

FAQ

Is webhook trading legal? Yes. Webhooks are simply HTTP requests — a standard internet protocol. Automated trading via EAs is allowed by most brokers and regulators. Always check your specific broker's terms of service regarding automated trading.

How fast are webhooks? TradingView sends webhooks within milliseconds of the alert condition being met. Network latency adds 50-200ms. The signal server processes in <10ms. The EA polls every 500ms. Total: typically 1-2 seconds end-to-end.

Can webhooks be intercepted? If you use HTTPS (which you should), the connection is encrypted. Combined with token authentication, the risk of interception is very low. Never use plain HTTP for trading webhooks.

What if I send a wrong signal? If you accidentally trigger a webhook with wrong parameters, the trade will execute. This is why two-step confirmation (alertX + alertY) exists — it requires a second signal before executing, giving you a chance to cancel. For close operations, the guarded close (alertZ1 + alertZ2) prevents accidental liquidation.


Start webhook trading today. iNakaTrader receives your TradingView webhooks and executes them on MT5 — with full risk management built in.

Risk Disclaimer: Trading forex and other financial instruments involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Only trade with capital you can afford to lose. iNakaTrader provides signal execution tools, not financial advice.