delete https://demo.tradelocker.com/backend-api/trade/positions/
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
.