Skip to content

Update Trade Sync

MngUpdateTradeSync

Description: Updates a non-pending trade and keeps the TCP request open until the matching trade:event update is broadcast by the trading runtime.

SEO

MngUpdateTradeSync is the synchronous TCP trade update method for ScaleTrade manager API integrations. Use this endpoint when a CRM, dealer plugin, backoffice tool, or trading connector must update a trade and receive the resulting trade event payload by order.

Request Parameters

Name Type Required Description
order int Yes Trade order ID
login int Yes Account login
cmd int Yes Trade command
sl double No Stop Loss
tp double No Take Profit
volume int No Trade volume
profit double No Profit override for closed trade update
open_price double No Open price
open_time int64 No Open timestamp
close_price double No Close price
close_time int64 No Close timestamp
commission double No Commission
storage double No Storage/swap
expiration int64 No Expiration timestamp
comment string No Trade comment
__access object Yes Manager/session access object

Runtime Flow

MngUpdateTradeSync routes open market trades through the open-trade update path and closed trades through the closed-trade update path. Pending orders are rejected and must be updated through MngUpdatePendingTradeSync.

Success Response

On success the response contains only the data object from the matching trade:event.

{
  "extID": "update-sync-1",
  "status": 200,
  "data": {
    "order": 1001234,
    "login": 123456,
    "symbol": "EURUSD",
    "cmd": 0,
    "state": 0
  }
}

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.