Process flow diagram
Visual summary of the covered call closing workflow described on this page.
%%{init: {"theme":"base","flowchart":{"curve":"basis"},"themeVariables":{
"fontFamily":"Inter, Nunito, system-ui",
"primaryTextColor":"#e5e7eb",
"primaryColor":"#111827",
"primaryBorderColor":"#94a3b8",
"lineColor":"#94a3b8",
"tertiaryColor":"#0e1729",
"tertiaryBorderColor":"#22d3ee",
"edgeLabelBackground":"#00000000"
}}}%%
flowchart TB
A([Start]) --> E1[Entry and pre-checks]
E1 -->|Fail| OUT[Stop: retirement buying power or closing disabled]
E1 -->|Pass| SEL{Positions selected}
SEL -->|None| OUT
SEL -->|Has items| L1[First position tasks]
L1 --> R1[Increment attempts; refresh pricing; build closing resource]
R1 --> R1V{Resource valid}
R1V -->|No| OUT
R1V -->|Yes| C1[1 Instrument close-order readiness]
C1 -->|Fail| OUT
C1 --> C2[2 Option close-order readiness]
C2 -->|Fail| OUT
C2 --> C3[3 Order-level readiness]
C3 -->|Fail| OUT
C3 --> C4[4 Non-rolling leg readiness]
C4 -->|Fail| OUT
C4 --> ORD[Build close order; may switch to STOP_LIMIT; set trade and position not close-ready]
ORD --> PLACE[Place order]
PLACE --> SUC{Placed successfully}
SUC -->|Yes| DONE([Outcome: close order placed; counts updated])
SUC -->|No| OUT
classDef step fill:#111827,stroke:#94a3b8,color:#e5e7eb,stroke-width:1px;
classDef gate fill:#0e1729,stroke:#22d3ee,color:#e5e7eb,stroke-width:1px;
classDef out fill:transparent,stroke:#94a3b8,color:#cbd5e1,stroke-dasharray:5 3;
class A,E1,SEL,L1,R1,R1V,C1,C2,C3,C4,ORD,PLACE,SUC,DONE step;
class SEL,R1V gate;
class OUT out;