positions.close

write

Close 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

FieldTypeDescription
id*stringPosition id from positions.list
close_price*numberExit price per contract; 0 for expired worthless
closed_atstringDefaults to today

* required

Output

Returned under data; every response also carries meta with freshness, as_of and truncated.

FieldTypeDescription
dry_run*booleanTrue 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

Run

Log in to run this tool.
positions.closeClose positionFreeWrites

Position id from positions.list

Exit price per contract; 0 for expired worthless

Defaults to today

Writes to your account.