Close a Position for an Account
DELETE {{baseUrl}}/v1/trading/accounts/:account_id/positions/:symbol_or_asset_id
Closes (liquidates) the account’s open position for the given symbol. Works for both long and short positions.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
qty | string | Optional the number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage | |
percentage | string | percentage of position to liquidate. Must be between 0 and 100. Would only sell fractional if position is originally fractional. Can accept up to 9 decimal points. Cannot work with qty |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"id":"61e69015-8549-4bfd-b9c3-01e75843f47d","symbol":"AALP","client_order_id":"61e69015-8549-4bfd-b9c3-01e75843f47d","created_at":"2021-03-16T18:38:01.942282Z","updated_at":"2021-03-16T18:38:01.942282Z","submitted_at":"2021-03-16T18:38:01.942282Z","filled_at":"2021-03-16T18:38:01.942282Z","expired_at":"2021-03-16T18:38:01.942282Z","canceled_at":"2021-03-16T18:38:01.942282Z","failed_at":"2021-03-16T18:38:01.942282Z","replaced_at":"2021-03-16T18:38:01.942282Z","replaced_by":"61e69015-8549-4bfd-b9c3-01e75843f47d","replaces":"61e69015-8549-4bfd-b9c3-01e75843f47d","asset_id":"61e69015-8549-4bfd-b9c3-01e75843f47d","asset_class":"us_option","notional":"4.2","qty":"4.2","filled_qty":"4.2","filled_avg_price":"4.2","order_class":"bracket","order_type":"stop","type":"stop","side":"buy","time_in_force":"gtc","limit_price":"3.14","stop_price":"3.14","status":"filled","extended_hours":true,"legs":[{"value":"\u003cCircular reference to #/components/schemas/Order detected\u003e"},{"value":"\u003cCircular reference to #/components/schemas/Order detected\u003e"}],"trail_price":"3.14","trail_percent":"5.0","hwm":"3.14","commission":"3.14","commission_bps":"10","swap_rate":"in magna aute elit","swap_fee_bps":"sint veniam ad irure occaecat","usd":{}}