Quickstart: your first MT5 API trade
This guide takes you from zero to a live MetaTrader 5 order in about five minutes. You need an MT5 account at any broker or prop firm (a demo account is fine) and nothing else: no MetaTrader terminal, no Expert Advisor, no VPS.
1. Create an AlgoDeltaFX account#
Sign up and open the dashboard. Every plan includes API access, and there is a 1-week free demo.
2. Connect your MT5 account#
In the dashboard, add the MT5 account with its login, password and broker server (for example Exness-MT5Real29 or ICMarketsSC-Demo). The server name is shown in the MetaTrader 5 login window.
Prefer to automate this? Use Add MT5 Account from the Master API.
3. Copy the account token#
Each connected account has its own API token (a JWT). Copy it from the dashboard and keep it in an environment variable:
export ACCOUNT_TOKEN="eyJhbGciOi..."4. Check the connection#
curl https://api.algodeltafx.com/api/v2/forexaccount/getprofile \
-H "Authorization: Bearer $ACCOUNT_TOKEN"A response with "status": true means the token is valid and the account is connected.
5. Find the exact symbol name#
Brokers name symbols differently (EURUSD, EURUSDm, EURUSD.pro). Read the exact name first:
curl https://api.algodeltafx.com/api/v2/forexaccount/getsymbols \
-H "Authorization: Bearer $ACCOUNT_TOKEN"6. Place a trade#
Open a 0.01 lot market Buy on EURUSD with a stop loss and take profit:
curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/placeorder \
-H "Authorization: Bearer $ACCOUNT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"symbol": "EURUSD", "type": 0, "volume": 0.01, "sl": 1.0750, "tp": 1.0950}'{ "status": true, "msg": "Order placed", "data": { "ticket": 1093918439 } }type: 0 is a market Buy. See all eight order types.
7. Manage and close it#
# See it in open positions
curl https://api.algodeltafx.com/api/v2/forexaccount/getopenpositions \
-H "Authorization: Bearer $ACCOUNT_TOKEN"
# Close it by ticket
curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/squareoffposition \
-H "Authorization: Bearer $ACCOUNT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ticket": 1093918439}'Next steps#
- Authentication: Account tokens vs master tokens.
- Trade MT5 with Python: a complete Python client.
- MT5 copy trading API: manage many accounts from one master.
- Download the Postman collection or the OpenAPI spec.
Last updated 2026-11-04