External Signals
Webhook ingress for n8n, Zapier, AI bots, Python
How External Signals works
External Signals lets any system that can send an HTTP request — n8n, Zapier, a Python script, an AI bot, or a Telegram bot — open, modify, and close trades on your MT5 or cTrader account. You keep your risk rules; LOTUX enforces them on every order.
You POST a small JSON message to your private webhook URL. LOTUX authenticates it with your secret, applies your risk rules, and routes the order to your account — the same ingress path used by the TradingView Bridge.
LOTUX carries out the trading instructions you send. It is not a broker and not investment advice — you decide the signals, LOTUX just executes and enforces your limits.
Webhook payload schema
Send a POST request to your webhook URL (copy the exact URL from the External Signals dashboard). The body is JSON and always includes your secret and an action.
{
"secret": "YOUR_WEBHOOK_SECRET",
"action": "buy",
"symbol": "EURUSD",
"volume": 0.1,
"sl": 1.0800,
"tp": 1.1000
}Core actions and their fields:
| Action | Required | Optional |
|---|---|---|
| buy / sell | symbol, volume | sl, tp, price |
| buy_limit / sell_limit / buy_stop / sell_stop | symbol, volume, price | sl, tp |
| close | positionId — OR — a filter (symbol / side / pnl) | — |
| close_all | (none) | — |
| partial_close | positionId, partialVolume | — |
| cancel_pending | orderId | — |
- volume is in lots (greater than 0, up to 100).
- sl / tp are price levels for stop-loss / take-profit.
- Add "meta": { "origin": "n8n" } to tag where a signal came from — it is for your analytics only and never changes routing.
More actions — modify_sl (positionId + sl), modify_tp (positionId + tp), and breakeven (positionId) modify an open position (they also need the X-Idempotency-Key header, see below). Stop-limit entries — buy_stop_limit / sell_stop_limit (add stopLimitPrice) — and modify_pending (orderId + at least one of price / stopLimitPrice / sl / tp / expiry) need a recent MT5 EA and may not be available on every venue yet; check your dashboard.
Retry safety: for breakeven, modify_sl, modify_tp, and a filtered close (no positionId), also send an X-Idempotency-Key header. Reuse the SAME key when you retry the same action, so a retry does not create a second order — a new key is treated as a new action.
Limits: the JSON body is capped at 64 KB and requests are rate-limited. A successful request returns HTTP 202 (accepted).
Managing webhook secrets
A webhook secret is your authentication token — it links an incoming signal to your trading account(s). Create one in the External Signals dashboard for the account you want to trade.
- Create — open External Signals, create a secret and name it (for example "n8n bot"), then copy the webhook URL shown next to it.
- Rotate — generates a new secret; the old one stops working right after, so update your automation with the new value immediately.
- Reveal — the secret is masked in the dashboard; you can reveal the full value there (a security step-up may be required depending on your account settings).
Targeting: POST to /webhook/custom/{accountId} to send to one specific account, or to /webhook/custom (no id) to send to every account linked to that secret. You can link a secret to one or more accounts.
Integration examples
n8n / Zapier — add an HTTP Request step: method POST, URL = your webhook URL (from the dashboard), body = JSON:
{
"secret": "YOUR_WEBHOOK_SECRET",
"action": "buy",
"symbol": "XAUUSD",
"volume": 0.1,
"meta": { "origin": "n8n" }
}Python / AI bot — send the same JSON from any language (paste your exact webhook URL):
import requests
requests.post(
"PASTE_YOUR_WEBHOOK_URL_FROM_DASHBOARD",
json={
"secret": "YOUR_WEBHOOK_SECRET",
"action": "sell",
"symbol": "GBPUSD",
"volume": 0.2,
"sl": 1.2800,
"tp": 1.2600,
"meta": {"origin": "python-bot"},
},
)Test before going live — use the Validate action in the dashboard to check a payload for errors without sending a real order.