Send Python trading signals to MT5 and cTrader
You do not need a ZeroMQ bridge or a MetaTrader DLL to trade from Python. Your script posts a small JSON message to your LOTUX webhook; LOTUX authenticates it, applies your risk rules, and executes on your own MT5 or cTrader account. This is the External Signals path - the webhook guide covers the mechanics; this one is the Python-specific setup.
Step-by-step
Connect an account + enable External Signals
Connect an MT5 or cTrader account (create a license → install the EA/cBot → paste the key), open the External Signals app, and copy its webhook URL and secret.
Install a HTTP library
Any HTTP client works. The examples below use the popular requests library (pip install requests).
POST your signal
Send the action with the fields it needs - a buy / sell needs a symbol and a volume. Your secret goes in the JSON body.
Handle the response + set account rules
Check the response, and set your account rules (lot size, max risk, allowed symbols) in LOTUX so they apply before an order is placed.
import requests
resp = requests.post(
"<your-webhook-url>",
json={
"secret": "<your-secret>",
"action": "buy",
"symbol": "EURUSD",
"volume": 0.1,
},
timeout=10,
)
print(resp.status_code, resp.text)MT5 and cTrader
The same Python request works whether the target account is MT5 (LotuxBridge EA) or cTrader (LOTUX cBot) - the account decides the venue.
Run your Python strategy on your own account
This is the exact path LOTUX runs for every webhook signal. Choose how you host the bridge - both execute through your own EA/cBot.
Frequently asked questions
- Do I need MetaTrader5 Python package or ZeroMQ?
- No. You send a plain HTTP webhook; the LotuxBridge EA (MT5) or LOTUX cBot (cTrader) already runs on your account and receives the order from LOTUX. No DLL, no ZeroMQ, no socket bridge.
- Does it work on cTrader too?
- Yes. The same POST works on cTrader accounts via the LOTUX cBot; only the target account differs.
- How do I avoid double execution on a retry?
- Add an X-Idempotency-Key header and reuse the exact same value when you retry the same action - LOTUX treats a repeated key as a duplicate. Do not generate a new key per retry or per run (a new key counts as a new action). This header is what protects modify_sl / modify_tp / breakeven / filtered-close actions.
LOTUX executes orders on your rules - it is not a broker and not investment advice. Trading carries risk; you are responsible for your own account and settings.