v1
latestOpenAPI 3.0.02026-07-26327775.9 KBTrading
Close a position
Place an order to close an existing position. Isn't guaranteed to close the positions, or close it immediately. Will attempt to place an IOC, then GTC closing order, so the execution might be delayed. If you want to fully close position set parameter qty to 0, but if you want to partially close a position just set the qty parameter to the number of lots that you want to close.
NOTE: if you don't know what is the positionId value (you only have an orderId of the order that opened the position), you can use the GET /trade/accounts/{accountId}/ordersHistory route to get the list of all final orders and their IDs. Just match the orderId with the positionId.
delete/trade/positions/{positionId}
Path parameters
positionIdinteger required
Position identifier.
Query parameters
strategyIdstring
Strategy ID
Headers
accNuminteger required
Account number
developer-api-keystring
developer-api-key
Request body
Response
Example response
{
"s": "ok"
}