Close Position
close_positionClose an open position on a broker account. Can close the full position or a partial amount. Closing is immediate at market price. WARNING: This executes a real trade on the broker — closing on a "live" account will result in actual realized P&L. Closing or modifying positions does not consume daily credits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | Quantity in lots to close. Omit or 0 for full close | |
| positionId | Yes | The position ID (from get_positions) | |
| brokerAccountId | Yes | The broker account ID (from get_positions) |