Skip to content

Close By

POST /v1/close-by | Weight: 1

Net two opposing positions on the same symbol via MT5 CLOSE_BY, saving the spread on the smaller side.

ParameterTypeRequiredDescription
positionnumberYesFirst position ticket
position_bynumberYesOpposing position ticket (same symbol, opposite side)
commentstringNoOrder comment. Max 27 characters, ASCII only.
Terminal window
curl -X POST https://interface.xbtfx.com/v1/close-by \
-H "Authorization: Bearer xbtfx_live_..." \
-H "Content-Type: application/json" \
-d '{
"position": 12345678,
"position_by": 12346789
}'
{
"status": "ok",
"position": 12345,
"position_by": 12346,
"retcode": 10009
}
FieldTypeDescription
statusstringok or rejected
positionnumberFirst position ticket
position_bynumberSecond position ticket
retcodenumberMT5 execution result code