flatten_positions
Close every open position using opposite-side market orders, optionally filtered by symbol. Use to flatten an account or end-of-day close; defaults to dry-run for safety.
Instructions
Close every open position with opposite-side market orders, optionally filtered by symbol. Default dry_run=true. Use for 'close everything' operator actions or end-of-day flatten. account is required and gated the same way as place_order: paper scope may only target paper-prefixed accounts, and rows the positions accessor tags with a different account are skipped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | Restrict to one symbol; omit to flatten all. | |
| account | Yes | Account whose positions to flatten. paper-prefixed names are allowed in paper scope; live scope is required for any other. | |
| dry_run | No |