Skip to content

Closed trade migration rows

Provide one object per historical position to MngPreviewMigration with kind: "closed_trades". The login must already exist and the symbol must be configured. Only closed BUY and SELL trades are accepted.

Fields

Field Type Required Description
order integer No Original source-system order reference. If source_id is omitted, this positive integer is returned as source_id; it is not used as the platform order number.
login integer Yes Existing target account login.
symbol string Yes Existing symbol name.
cmd integer Yes Trade side: 0 for BUY or 1 for SELL.
volume integer Yes Volume in platform minimal-lot units.
open_time, close_time integer Yes Unix timestamps; the close time must be equal to or later than the open time.
open_price, close_price number Yes Historical execution prices.
profit, commission, storage number Yes Closed trade financial values in the account currency.
sl, tp number No Stop Loss and Take Profit; default 0.
digits integer No Optional source price precision.
reason integer No Optional trade reason.
magic integer No Optional expert/magic identifier.
comment string No Optional trade comment.

The import allocates new platform order numbers. The preview reports per-login currency, money_digits, balance_before, imported history net, correction, and expected balance_after. The correction is applied as an ordinary closed balance operation in the same batch so the existing account balance is preserved. Review the preview summary before applying.

Example

{"command":"MngPreviewMigration","extID":"mig-history-1","__token":"<superadmin-token>","data":{"kind":"closed_trades","name":"October history","rows":[{"source_id":"legacy-order-91","login":120045,"symbol":"EURUSD","cmd":0,"volume":100,"open_time":1793000000,"close_time":1793003600,"open_price":1.0800,"close_price":1.0840,"profit":42.5,"commission":-2.0,"storage":-0.5,"sl":0,"tp":0,"digits":5,"comment":"Imported from legacy platform"}]}}