close_position
Close an entire position for a given symbol by trading the exact fractional quantity. Automatically reads current position size and sends the opposite order.
Instructions
Closes 100% of a symbol's position, trading the exact fractional quantity.
Reads the exact position size and sends the opposite order. Note: IBKR's
portfolio is eventually-consistent — right after a recent BUY the position may
not appear yet (and the close will return closed=False). In that case, wait
a few seconds and try again, or sell the exact quantity via sell.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>"
},
"name": "close_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |