Optionscanner does not decide when a position closes; the user's adopted rule set does, and every verdict on a card names the rule and the value that tripped it. One engine pairs option legs into spreads, then checks each position against the adopted thresholds: a share of maximum profit earned, a share lost, days to expiry, short-strike delta drift, an earnings date inside the holding window, and whether a roll to the next expiry pays a net credit. The Balanced template reproduces the thresholds the app used before rule authorship existed: 50 percent profit, 100 percent of maximum profit lost, 21 days to expiry, delta 0.45.
How these pages were written: from the engine source as deployed in September 2026, with thresholds quoted as the code holds them. Thresholds change with releases and the changelog records each change. This is a description of arithmetic, not advice about what to trade.
Source modules: strategy/rulesets.py (the rule definitions and templates) and strategy/position_optimizer.py (the one engine that applies them).
The user. Until rule authorship shipped, verdict words such as CLOSE and TAKE PROFIT came from thresholds hardcoded in the position engine. Now the thresholds live in a rule set the user adopts before any verdict is shown, every verdict cites the user's rule and the observed value, and every version of the set is kept in an append-only history so authorship can be shown. Adopting the Balanced template unchanged is a valid choice; it reproduces the previous behavior exactly, so adoption changes who owns the rule and nothing else.
For a credit spread:
For an iron condor: TAKE PROFIT at 25 percent of total credit, ROLL on a breached side, WATCH at 21 days, and an imbalance rule that flags when one side has captured 40 percentage points more of its credit than the other and the winning side has captured at least 50 percent. For a debit spread: TAKE PROFIT at 50 percent of maximum profit, CLOSE at 50 percent of the debit paid lost, WATCH at 14 days to expiry, when decay becomes the enemy of a long structure. For a long option: TAKE PROFIT at 50 percent gain on the debit.
The paper trading agent keeps its own set on the same principle, with house defaults of a buy-to-close at 50 percent of entry credit, a stop at twice the entry credit, a time exit at 14 days to expiry and a hard exit at 7. Exits are the one thing the agent submits unattended on the paper planes, because they only reduce risk; in a production account they queue for a click like everything else.
In two passes. The first pairs option legs into vertical spreads by underlying and expiry: one short and one long of the same type at different strikes is treated as a single spread position, so a bull put spread is judged as a spread and not as two unrelated legs. The second pass checks each spread, each remaining single leg and each equity against the rules, reading the live chain for the short leg's current delta, the days remaining, the mark against the entry, the earnings calendar inside the holding window, and the next expiry's credit to decide whether a roll exists. Both the action cards and the live positions table read one call to this engine, after an earlier second copy disagreed with it on debit spreads and was deleted.
A verdict is a label, the rule that produced it, and the observed value: "CLOSE, your rule: 100 percent of maximum profit lost, observed: 118 percent." Verdicts are HOLD, WATCH, TAKE PROFIT, CLOSE and ROLL, with ROLL variants for extending, moving strikes up or moving them down, and ROLL is offered only when a feasible roll exists at the adopted minimum credit. A verdict is a statement about a rule the user set and a number the market produced. The order that acts on it, in a production account, is placed by the user.
The user, by adopting a rule set before any verdict is shown. Every verdict names the rule and the observed value, and every version of the set is kept so authorship can be shown. The Balanced template reproduces the thresholds the app used before rule authorship, so adopting it unchanged changes ownership and nothing else.
Take profit at 50 percent of maximum profit, close at 100 percent of maximum profit lost or at 50 percent once the short strike is breached, watch at 21 days to expiry without the target met and when the short strike's delta reaches 0.45, and count a roll as available only when the next expiry pays at least 0.10 per share of net credit.
It keeps its own set on the same principle, with house defaults of a buy-to-close at 50 percent of entry credit, a stop at twice the entry credit, a time exit at 14 days and a hard exit at 7. Exits are the one thing it submits unattended on paper, because they only reduce risk; in a production account they queue for a click.
More in Methodology: how the engine computes: How the Conviction Score Is Computed · How a Structure Is Chosen: Signal, Volatility, VIX · How NVRP Is Computed and Used as a Gate