Skip to content

Close Trade

MngCloseTrade

Description: Allows a manager to close an existing trade order. Supports full and partial close operations and optional close control parameters.

This method follows the common Trade Request Lifecycle. A successful response means the close request was accepted into runtime processing.

Request Parameters

Name Type Required Description
login int Yes Account login to which the trade belongs
order int Yes Order ID of the trade to close
volume int No Volume to close for partial close
close_price double No Custom closing price
close_time int64 No Closing time
expiration int64 No Optional expiration time
comment string No Optional comment
__access object Yes Access object with manager session data

Request Example

{
  "login": 123456,
  "order": 1001234,
  "volume": 500,
  "close_price": 1.2050,
  "close_time": 1629987890,
  "expiration": 0,
  "comment": "partial close by manager",
  "__access": {
    "type": 2
  }
}

Response Parameters

Name Type Description
accepted bool Always true on successful acknowledgment
order int Order identifier being closed
login int Target account login
symbol string Trade symbol
cmd int Trade command
volume int Requested close volume
state int Current acknowledged state returned by the handler

Response Example

{
  "accepted": true,
  "order": 1001234,
  "login": 123456,
  "symbol": "EURUSD",
  "cmd": 0,
  "volume": 500,
  "state": 14
}