What the “roll positions” function does
When a covered call position is ready to be renewed, the system handles it automatically during the trading day. It builds the best replacement option and submits the renewal order.
- Stops automatically at the market close.
- If a valid renewal is found, it places the roll and clears the “ready” flag.
- If no valid renewal exists yet, it records the reason and tries again next time.
Technical detail
- Time gate: If the current time is after market close, it exits without doing anything.
- Which positions it considers: Gathers option positions already marked “ready to roll,” tries items with the fewest prior roll attempts first, and avoids multiple items for the same underlying/expiration in one pass.
- First position processing:
- Logs and increments the position’s roll-attempt counters and sets the related trade’s “ready to roll” flag to true for this attempt.
- Asks the trade to build the best available roll order candidate. Three outcomes:
- 1) Returns a “not ready” reason: record the reason on the position and move on.
- 2) Returns a candidate but final order-readiness fails: record “order resource not ready” and move on.
- 3) Returns a fully ready order: place it, then reset the position’s roll-ready flags (general, spread, non-spread) to false.