close_position
Closes an entire position for a given symbol by sending an opposite order of the exact quantity. If the position is not visible due to eventual consistency, retry after a few seconds.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |