Connecting TradingView
Use your webhook URL and secret to send TradingView alerts to Ordex. Trades are then executed on your MT5 account.
Where to find your webhook URL and secret
- Webhook Secret — Shown when you add an MT5 account, or under Webhooks in the app (copy it and keep it safe).
- Webhook URL — Your Ordex app URL plus
/api/webhooks/tv. Examples below.
Production (live app):
https://ordextrader.com/api/webhooks/tvLocal testing:
http://localhost:3000/api/webhooks/tvCreate an alert in TradingView
- Open your chart and strategy in TradingView.
- Right-click the chart → Add Alert.
- Set the Condition to your strategy or indicator (e.g. order fill, or a condition you defined).
- In Webhook URL, paste your webhook URL (see above).
- If your TradingView plan supports custom headers, add:
- Name:
X-Webhook-Secret - Value: your Webhook Secret
- Name:
- In Message, use JSON. Minimum example (copy and change symbol/lots if needed):
{"symbol":"EURUSD","action":"buy","lots":0.01}Add "secret":"wh_your_secret_here" if you didn't use the header. See Order types below for limit/stop orders, SL/TP, and trailing stop.
Order types: market, limit, stop, SL/TP, trailing
The webhook message supports the same fields the MT5 EA expects. Use these so you can press buy/sell in TradingView and have orders route to MT5 with the right type and levels.
- Market —
action: "buy"or"sell", noprice. Executes at current price. - Limit — Include
"price": 1.0850. Buy limit if price < ask, sell limit if price > bid. - Stop — Include
"price": 1.0900. Buy stop if price > ask, sell stop if price < bid. - Stop loss / Take profit — Add
"sl"and"tp"(prices). - Trailing stop — Add
"trailing_stop"(points). The EA may use this to trail the stop (implementation depends on your EA version).
Examples (replace symbol, lots, prices, and secret):
{"symbol":"EURUSD","action":"buy","lots":0.01,"sl":1.0750,"tp":1.0950,"secret":"wh_xxx"}{"symbol":"EURUSD","action":"buy","lots":0.01,"price":1.0820,"sl":1.0780,"tp":1.0900,"secret":"wh_xxx"}{"symbol":"EURUSD","action":"sell","lots":0.01,"price":1.0700,"sl":1.0750,"tp":1.0620,"secret":"wh_xxx"}A full Pine Script example (building the JSON and firing alerts) is in the repo at docs/TRADINGVIEW_PINE_ORDEX_EXAMPLE.md.
If your broker uses different symbol names
Some brokers use names like EURUSDm or GOLD instead of EURUSD or XAUUSD. In the app, go to Webhooks and add a Symbol mapping so TradingView symbols match your MT5 symbols.
Test your webhook
In the app, open Webhooks and click Test Webhook for your account. You should see a new row in Webhook Logs with success. That means Ordex received the request; the MT5 EA will execute the trade when it's connected.