Update Close Trade Sync
MngUpdateCloseTradeSync¶
Description: Updates a closed trade and keeps the TCP request open until the matching trade:event update is broadcast by the trading runtime.
SEO¶
MngUpdateCloseTradeSync is the synchronous TCP closed trade update method for ScaleTrade manager API integrations. Use this endpoint when a CRM, dealer plugin, backoffice tool, or trading connector must update closed trade history and receive the resulting trade event payload by order.
Access Control¶
Requires set_trades for manager/dealer sessions. The target account must also match the manager groups and brand scope loaded from the cached manager record. Token payload is used only for manager id and session type.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| order | int | Yes | Trade order ID |
| login | int | Yes | Account login |
| cmd | int | Yes | Trade command |
| volume | int | Yes | Trade volume |
| symbol | string | Yes | Trading instrument |
| open_time | int | Yes | Open timestamp |
| close_time | int | Yes | Close timestamp |
| commission | double | No | Commission |
| storage | double | No | Storage/swap |
| open_price | double | No | Open price |
| close_price | double | No | Close price |
| sl | double | No | Stop Loss |
| tp | double | No | Take Profit |
| profit | double | No | Profit |
| expiration | int64 | No | Expiration timestamp |
| comment | string | No | Trade comment |
| __access | object | Yes | Manager/session access object |
Success Response¶
On success the response contains only the data object from the matching trade:event.
Event Matching¶
TCP waits for trade:event with type = EV_RECORD_UPDATE and matching data.order.
Timeout¶
The default timeout is 5000 ms. If no matching trade event arrives before timeout, TCP returns status = 504 with SYNC_TIMEOUT.