Alerts are operational signals fired by the paper-trading simulation when a rule condition is met.
In Phase 1-2 (manual paper sim): alerts are logged and surfaced to the trader for review.
In Phase 3 (automated paper): critical alerts may block the proposed action until acknowledged.
In Phase 4 (live broker): critical alerts must block execution until manually overridden.
Alerts are stored in the Alert schema (see data-schema.md). They do NOT execute any action themselves.
Alert Codes
Execution Timing Alerts
Code
Severity
Trigger
Message Template
Action
OPENING_BELL_SELL
INFO
Sell executed within 5 min of market open
"Sell on {ticker} {strike} was executed {N} min after open. Price action check window is 10 min — verify this was intentional."
Log; surface in dashboard
GAP_UP_WAIT_RECOMMENDED
INFO
Open gap > 0.5% detected
"Gap up {pct}% detected on {ticker}. Recommended: wait 10-30 min before selling calls. Current sentiment: {label}."
Log; delay execution prompt
GAP_DOWN_HOLD
WARNING
Open gap down > 0.5% detected
"Gap down {pct}% detected on {ticker}. Recommended: sell 1 fewer contract or raise strike by one step. Hold if gap > 1.5%."
Log; reduce structure by 1
GAP_DOWN_SEVERE_HOLD
WARNING
Open gap down > 1.5% detected
"Severe gap down {pct}% on {ticker}. No calls sold this cycle per gap-down-severe rule. Re-evaluate at T+30."
Log; block sell
Assignment Risk Alerts
Code
Severity
Trigger
Message Template
Action
HIGH_ASSIGNMENT_RISK
WARNING
DTE ≤ 2 AND call is ITM AND delta_at_entry > 0.75
"Call {ticker} {strike} exp {expiration}: DTE={DTE}, deep ITM. Assignment probability high. Confirm this is intentional (per-cycle design) or consider rolling."
Log; surface prominently
EARLY_ASSIGNMENT_RISK
WARNING
Extrinsic value < $0.15 on any open call
"Call {ticker} {strike}: extrinsic ${extrinsic:.2f} < $0.15. Early assignment risk elevated (American-style). Consider closing or monitoring closely."
Log; alert
EX_DIV_EARLY_ASSIGNMENT
WARNING
Ex-dividend date within 3 calendar days AND ticker pays dividend
"Ex-dividend date is {N} days away on {ticker}. ITM short calls face elevated early-assignment risk. Consider closing or confirm acceptance."
Log; block new ITM sells within 5 days
BELOW_COST_ASSIGNMENT_RISK
WARNING
Assignment price (strike) < lot cost basis
"Short call {strike} is below cost basis {basis} on lot {lot_id}. If assigned, this cycle records a stock P/L loss. Confirm intentional or roll/close."
Log; surface at cycle close
Pattern / Weakness Detection Alerts
Code
Severity
Trigger
Message Template
Action
ITM_OVERUSE
WARNING
3+ consecutive weeks where ALL calls at entry are ITM
"3 consecutive weeks of all-ITM call structure on {ticker}. Review sentiment labels — is Neutral being used as a default without recalibration?"
Log; require sentiment label re-confirmation
CONSECUTIVE_BELOW_COST_ASSIGNMENT
WARNING
3+ below-cost assignments in rolling 30 days
"{N} below-cost assignments in the last 30 days on {ticker}. Review strike selection and re-entry price relative to cost basis."
Log; surface pattern
IMMEDIATE_REENTRY
INFO
Re-entry evaluated or executed within 1 trading day of last assignment
"Re-entry on {ticker} within 1 trading day of last assignment at ${assignment_price}. Verify this is not reactive — review re-entry criteria log."
Dashboard log + push notification + block execution until acknowledged
Alert Testing Requirements
Before feature-developer ships Phase 3 automation, each alert must have:
1. A unit test that fires it with a synthetic scenario.
2. A unit test that confirms it does NOT fire when the condition is not met.
3. An integration test that verifies the blocking behavior (CRITICAL alerts) prevents state transitions.
See reference-impl/layered_covered_call/state_machine.py :: check_risk_controls() for the current reference implementation.