positions.close
writeClose position
Closes an open position at close_price, recording the realized P&L in the track record and removing it from open positions.
Free with an account. Requires a key or OAuth token with the write scope.
Input
| Field | Type | Description |
|---|---|---|
| id* | string | Position id from positions.list |
| close_price* | number | Exit price per contract; 0 for expired worthless |
| closed_at | string | Defaults to today |
* required
Output
Returned under data; every response also carries meta with freshness, as_of and truncated.
| Field | Type | Description |
|---|---|---|
| dry_run* | boolean | True when dry_run was requested: nothing was persisted; other fields show the would-be result |
| closed* | object |
* required
Example request
curl -X POST "https://impliedoptions.com/api/v1/tools/positions.close" \
-H "Authorization: Bearer <YOUR_KEY>" \
-H "Content-Type: application/json" \
-d '{
"args": {
"id": "6f1c2b3a-4d5e-4f60-8a71-9b2c3d4e5f60",
"close_price": 8.2
}
}'Rendered result: /performance?tab=current