# Webhook to MT5 — send JSON signals from any system

Source: https://pipsync.io/en/webhook-to-mt5
Last updated: 2026-06-07

To feed MT5 from a webhook, send a small JSON payload — instrument, direction, entry, sl and tp1 — to your unique PipSync webhook URL: PipSync validates it and saves it as a signal on the Signals page for you to review. A webhook from your own system is never traded automatically: you assign your MT5 account on the signal and confirm it. Only alerts that TradingView itself sends can auto-trade, and only after you opt in.

The endpoint is source-agnostic: anything that can issue an HTTPS POST can send a signal — a Python screener, a Node bot, a cron job, a no-code automation. There is no EA to install, no MQL5 to write and no VPS to keep online. The MT5 connection runs in PipSync's cloud, and signed outbound webhooks report executions back to your own system so you can close the loop programmatically.

## Custom webhook → MT5 at a glance

| | |
|---|---|
| Signal source | Any system that can send an HTTPS POST with a JSON body — bots, screeners, schedulers, scripts in any language |
| Destination platform | MetaTrader 5 via PipSync's cloud API bridge — live in PipSync; hedging and netting accounts supported |
| Payload format | Flat JSON: instrument, direction (buy / sell), entry, sl and tp1 — all required, sl/tp above 0 |
| Authentication | Unique per-workspace webhook URL containing a secret token, shown once; regenerate it under Settings → Advanced → TradingView Alerts if it leaks |
| Risk controls | Sizing, min/max lots and max open positions apply when you place the signal on your MT5 account; each signal is reviewed on the Signals page |
| Auto-trade | Not for webhooks from your own system: only alerts from TradingView's published sender addresses can auto-trade, after an opt-in on the Advanced plan |
| Feedback | Signed outbound webhooks (trade.opened, trade.closed, TP/SL hits) plus a REST read API with an OpenAPI 3.1 spec |
| Price | Webhook integration needs a plan that includes it (the Advanced plan) |

## How do I connect a custom webhook to MT5?

The route is configured once in the PipSync dashboard; after that, your own code only ever talks to one HTTPS endpoint.

1. **Create your PipSync account and subscribe to a plan** — Sign up at app.pipsync.io (the $0 Free plan needs no card but only parses signals), then subscribe to a plan that includes webhook integration (payment method required, cancel any time). Everything this integration requires, including the webhook URL and the Recent alerts list, is included, so you can develop against the endpoint before you go live.
2. **Connect your MT5 account** — Open Trading Accounts → Add account and select MetaTrader 5, using your master (trading) password. Start with a demo account so you can iterate on your sender without real money at stake.
3. **Generate your webhook URL and copy it** — Go to Settings → Advanced → TradingView Alerts and click Generate webhook URL. PipSync generates a unique URL containing a secret token and shows it only once — that URL is your credential. Store it in an environment variable or secret manager, never in committed code.
4. **Point your system at the endpoint** — From your bot, screener or script, send an HTTPS POST with the JSON payload: instrument, direction, entry, sl and tp1 are all required (prices above 0); other fields are ignored. Any HTTP client works — there is no SDK to install.
5. **Set your server-side risk rules** — Configure position sizing (fixed lots or percent-risk), min/max lots and a max-open-positions cap; these apply when a signal is traded. A lots field in the payload is ignored. Every webhook signal waits on the Signals page for your review.
6. **Send a test payload and go live** — Send one payload, then open Settings → Advanced → TradingView Alerts and check Recent alerts to see its status and, if it was rejected, the exact error. Keep the route on demo until several real payloads parse exactly as you expect.

## What JSON payload does the PipSync webhook expect?

A minimal signal is a flat JSON object with five required fields: { "instrument": "EURUSD", "direction": "buy", "entry": 1.0850, "sl": 1.0800, "tp1": 1.0950 }. direction accepts buy or sell (long and short also work); sl and tp1 are absolute price levels and must be above 0 — a payload with 0 is rejected.

Use tp1 to tp5 for several take-profit targets. Every other field, including lots and comment, is ignored: sizing always comes from your PipSync settings, and there is no close action. A valid payload becomes a signal for you to review; an invalid one gets an HTTP 422 with the reason listed under Recent alerts.

## How is the webhook endpoint authenticated?

Each webhook source gets a unique HTTPS URL containing a secret token — the URL itself is the credential. That keeps the sender side deliberately simple: no OAuth flow, no request signing, no client library. curl, a five-line Python script or a serverless function can all authenticate the same way.

Treat the URL like a password. Keep it out of client-side code and public repositories, and regenerate it from the dashboard if you suspect a leak — anyone holding the URL can submit signals into your workspace and, if you have switched on TradingView auto-trade, trigger trades by sending it a TradingView alert. A request from any other system always waits for your review on the Signals page, but rotating a leaked URL should be the first response.

## Why send webhooks instead of running an MT5 Expert Advisor?

An EA-based bridge couples your automation to one running MT5 terminal — typically a Windows VPS you rent, patch and monitor, plus MQL5 code you maintain. If the terminal closes or the VPS reboots, your strategy is offline. PipSync moves the broker connection server-side through a cloud API bridge to MT5, so there is nothing installed in the terminal and nothing that dies with a desktop session.

It also decouples your language choice from MetaQuotes' ecosystem. Your screener can stay in Python, your execution logic in Rust or Node — if it can issue an HTTP POST, it can send a signal. Risk checks such as position sizing, min/max lots and max open positions run on PipSync's servers before any order is forwarded, so they apply consistently regardless of what sent the signal.

## How do I get execution feedback back into my own system?

Subscribe your own endpoint to PipSync's outbound webhooks and you receive a signed JSON POST on events such as signal.received, trade.opened, trade.closed, trade.tp_hit and trade.sl_hit. Each delivery carries an X-PipSync-Signature header (a timestamp plus an HMAC-SHA256 digest) so you can verify authenticity before trusting the payload; reject anything whose timestamp is more than a few minutes old to block replays. Failed deliveries are retried up to 5 times with exponential backoff.

For polling and reconciliation there is also a REST read API — GET /v1/signals and GET /v1/trades — described by an OpenAPI 3.1 spec at /api/v1/openapi.json, so you can generate a typed client for your runtime. API keys for the read API are part of the Enterprise plan; the dashboard itself shows every parsed signal and resulting order on all plans.

## What MT5 specifics should my integration handle?

Symbol naming is the most common integration bug. Brokers routinely use their own variants of standard names, and there is no symbol-mapping setting for webhooks — PipSync upper-cases the instrument and keeps only letters and digits. Check how it was read under Recent alerts and, if your broker spells it differently, message us in the support chat with the symbol and your broker.

PipSync's MT5 integration works with both hedging and netting account modes, handles partial fills, and places stop-loss and take-profit with the order so protection is held at the broker rather than in your script. If your sender can emit bursts, debounce on your side, and if you ever receive an HTTP 429, back off with jitter before retrying.

## FAQ

### How do I send a trade signal from my own code to MT5?

POST a JSON object such as { "instrument": "EURUSD", "direction": "buy", "entry": 1.0850, "sl": 1.0800, "tp1": 1.0950 } to your unique PipSync webhook URL. PipSync validates the payload and saves it as a signal for you to review on the Signals page. Any language or tool that can make an HTTPS POST works — there is no SDK requirement.

### How is the PipSync webhook secured?

The webhook URL contains a secret token and is unique to your source — the URL is the credential, transported over HTTPS. Keep it out of client-side code and public repos, and regenerate it from the dashboard if you suspect a leak. Server-side risk rules and your own review of each signal add a second line of defence behind the URL — unless TradingView auto-trade is on: then anyone who has the URL can trigger trades through a TradingView alert.

### Can a webhook from my own system trade automatically?

No. Only alerts that TradingView itself sends, from its published sender IP addresses, can be traded automatically, and only after you opt in to TradingView auto-trade on the Advanced plan. A webhook from your own bot, script or tool always becomes a signal for your approval.

### Is there a rate limit on incoming webhooks?

Yes. Inbound webhook deliveries are rate-limited. If you receive an HTTP 429, retry with jittered exponential backoff.

### Can I close an MT5 position through the webhook?

No. The webhook has no close action: a direction other than buy or sell is rejected. Protective levels travel with the signal (sl and tp1), and exits are managed in PipSync or on your broker platform.

### Do I need a VPS or an Expert Advisor for this?

No. PipSync's connection to MT5 runs in the cloud through an API bridge, so there is no EA to install, no MQL5 to write and no terminal that must stay open. Your only infrastructure is whatever already produces the signal.

### How does my system know whether the trade actually executed?

Three ways: signed outbound webhooks push events like trade.opened, trade.closed, trade.tp_hit and trade.sl_hit to your endpoint (HMAC-SHA256 signed, retried up to 5 times); a REST read API (GET /v1/trades, Enterprise plan) supports polling and reconciliation; and the dashboard shows every parsed signal and order, plus a Recent alerts list that reports the status of each payload you send.

### Is PipSync a trading bot or a signal provider?

Neither — on this route the strategy is entirely yours. PipSync only provides the webhook endpoint, payload validation, server-side risk checks and the MT5 connection; it generates no signals of its own, makes no claims about how any strategy will perform, and nothing here is investment advice. Whatever your code decides to trade, leveraged products involve substantial risk of loss.

## Related

- [Webhook to Match-Trader — send JSON signals for prop accounts](https://pipsync.io/en/webhook-to-match-trader)
- [Webhook to MT4 — coming soon, send JSON signals](https://pipsync.io/en/webhook-to-mt4)
- [TradingView webhook to MT5 — signals you review, or opt-in auto-trade](https://pipsync.io/en/tradingview-to-mt5)
- [Webhook to cTrader — send your own alerts as signals](https://pipsync.io/en/webhook-to-ctrader)
- [Why MetaTrader has no inbound webhook (and how to automate TradingView alerts anyway)](https://pipsync.io/en/metatrader-webhook)
- [Telegram to MT5 — copy signals to MetaTrader 5 automatically](https://pipsync.io/en/telegram-to-mt5)
- [Server-side risk management — trading rules enforced before your broker](https://pipsync.io/en/server-side-risk-management)
- [Signal copier with no VPS — execution runs in the cloud](https://pipsync.io/en/signal-copier-no-vps)

---

PipSync is a signal execution tool. It does not provide trading signals, does not guarantee any trading results and is not investment advice. Trading leveraged products involves substantial risk of loss.
