Skip to content

Trade

Open a new market position. The trade executes at the current market price.

POST /v1/trade

ParameterTypeRequiredDescription
symbolstringYesTrading symbol (e.g., EURUSD)
sidestringYesTrade direction: buy or sell
volumenumberYesTrade volume in lots. Must respect the symbol’s volume_min, volume_max, and volume_step
pricenumberNoAdvisory price. The trade executes at market; this is for reference only
slnumberNoStop loss price
tpnumberNoTake profit price
commentstringNoTrade comment. Max 27 characters, ASCII only. Automatically prefixed with -API
Terminal window
curl -X POST https://interface.xbtfx.com/v1/trade \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"symbol": "EURUSD",
"side": "buy",
"volume": 0.1,
"sl": 1.08000,
"tp": 1.09500
}'
{
"status": "success",
"retcode": 10009,
"volume": 0.1,
"comment": "-API",
"deal": 87654321,
"order": 12345678,
"price": 1.08757
}
FieldTypeDescription
statusstringResult status
retcodeintegerMT5 return code. 10008 (placed) and 10009 (done) indicate success
volumenumberExecuted volume in lots
commentstringTrade comment (includes -API prefix)
dealintegerDeal ticket number
orderintegerOrder ticket number
pricenumberExecution price
  • On netting accounts, opening a trade in the same direction as an existing position increases that position. Opening in the opposite direction reduces or closes it. See Hedging vs Netting for details.
  • On hedging accounts, each trade creates an independent position.
  • Use the Symbols endpoint to verify volume constraints before trading.
  • Consider using an idempotency key to prevent duplicate trades on retries.