Create close command .

POST
Endpoint
/commands
Description

Create a close command for any existing commands on an account on the platform.

Request parameters
Attribute Description Data type Required Default
account_id Tradesync account ID integer Yes Not set
command_id Tradesync command ID integer Yes Not set
command Command executed A valid equity monitor action. See commands. Yes Not set
by Trade ticket or magic magic or ticket Yes Not set
trade_id Trade id of the trade integer Yes Not set
Request example
{
    "account_id":{account_id},
    "command_id":915067825,
    "command":"close_full",
    "by": "magic",
    "trade_id":1213753146
}
Response example
{
    "result": "success",
    "status": 200,
    "data": {
        "id": 915068854,
        "created_at": "2025-04-28T13:15:11Z",
        "updated_at": "2025-04-28T13:15:11Z",
        "account_id": 1242495,
        "application": "mt5",
        "group": "user",
        "event": null,
        "event_id": null,
        "copier_id": null,
        "lead_id": null,
        "command": "close_full",
        "status": "working",
        "retry_rate": "millisecond",
        "result": null,
        "mt_error": null,
        "by": "magic",
        "trade_id": 1213753146,
        "command_duration": null,
        "broker_duration": null,
        "total_duration": null
    }
}
Attributes
Field Required Accepted Description
account_id yes integer Account ID
command yes string A valid command (see below)
by yes ticket or magic Target trade by ticket number or magic ID
trade_id yes integer The ticket number or magic ID
percentage no integer The percentage to close if close_partial being used
Command
Value Description
close_full Close a trade
close_partial Close a trade partially

Stay in the loop.

Sign up to our newsletter to keep up-to-date.