Intraday Trigger Playbook
Status (v0.5 — implemented): this reference describes the trigger semantics that
monitor_intraday_trigger.pyevaluates as a one-shot FSM. Phase 2 plans (generate_pre_market_plan.py) emitentry_hint/stop_hintformula strings that map to these triggers; Phase 3 reads bars (Alpaca live or fixture), walks the FSM, and writesintraday_monitorJSON with concreteentry_actual/stop_actual/shares_actual.FSM contracts implemented in Phase 3:
triggeredis not terminal — post-trigger bars are still evaluated for invalidation predicates so a reclaim flips the plan toinvalidated.invalidatedis terminal/absorbing — no further transitions for thatplan_idon that session date.- First Red same-bar tie-break: when a single bar both takes out
red_high(would invalidate) AND prints belowred_low(would trigger), invalidation wins. Short-side conservatism.- ORL post-trigger invalidation requires
close > orl_lowANDclose > current_vwap(BOTH reclaimed, not just one).- Idempotency: every Phase 3 run replays the full session bars; the FSM is a pure function of
(plan, bars, atr_14).prior_stateis consulted only for display continuity / notification diffs.- Bar timing (v0.5d):
ts_eton each bar is the bar-open instant (matches Alpaca wire). A bar withts_et = Tcovers[T, T+5min)and is confirmed atT+5min. The Phase 3 adapters only return confirmed bars (bar_open + 5min <= until_et); the FSM never sees an in-progress current bar.- ORL anchoring: the Opening Range bar must be the 09:30 ET bar. When Alpaca skips that interval (no trades / halt at the open), the ORL evaluator emits
evaluation_status="skipped"+skip_reason="opening_range_bar_unavailable"rather than anchoring on a later bar.
5-min Opening Range Low (ORL) break
plan_id template: <TICKER>-<YYYYMMDD>-ORL5
trigger_type: orl_5min_break
condition (ja): 5min ORL を出来高 1.2x 以上で下抜け
entry_hint: 5min_orl_low - 0.05
stop_hint: session_HOD + 0.25 * ATR
structural_targets: dma_10, dma_20Phase 3 evaluator:
- Wait for the first 5-minute bar to close. Mark its high (ORH) and low (ORL).
- After 9:35 ET, watch every 5-minute close. If a bar closes below ORL AND its volume ≥ 1.2× the ORL bar's volume, fire the trigger.
- Stop is
session_HOD + stop_buffer_atr * ATR(14). - Invalidates if a subsequent 5-minute close prints back above ORL AND VWAP (sign of failed breakdown).
First Red 5-minute candle
plan_id template: <TICKER>-<YYYYMMDD>-FR5
trigger_type: first_red_5min
condition (ja): 寄付後最初の赤 5min の安値割れ
entry_hint: first_red_5min_low - 0.05
stop_hint: first_red_5min_highPhase 3 evaluator:
- Track every 5-minute bar from 9:30 ET. Mark the first bar where
close < open(a red candle). - After that bar closes, fire the trigger when a later 5-minute bar prints below the red candle's low.
- Stop is the red candle's high.
- Invalidates if any subsequent 5-minute bar takes out the red candle's high before the trigger fires.
VWAP fail
plan_id template: <TICKER>-<YYYYMMDD>-VWF
trigger_type: vwap_fail
condition (ja): First crack 後 VWAP retest で 5min 終値拒否 + lower-high 下抜け
entry_hint: lower_high_low - 0.05
stop_hint: vwap_reclaim_5min_closePhase 3 evaluator (FSM):
State machine has six states:
armed → first_crack_seen → vwap_retest_seen → rejection_confirmed → triggered → invalidated
armed: market open, watching for first VWAP loss.first_crack_seen: 5-minute close prints below VWAP for the first time, AND price comes from session HOD (filters open-print VWAP noise).vwap_retest_seen: subsequent bar closes back at or above VWAP (the "retest").rejection_confirmed: next 5-minute bar prints a lower high than the retest bar AND closes back below VWAP.triggered: fire on the break of the rejection bar's low.invalidated: any 5-minute close back above VWAP aftertriggeredOR a clean uptrend line break beforetriggered.
Common evaluator concerns
- Time zone: all timestamps
America/New_York. - Halt handling: bars during halt are skipped; the FSM resumes from its last state when trading resumes.
- Bar close vs touch: triggers fire on bar close, not intra-bar. Reduces wick noise.
- No re-entry: once a plan is
triggeredorinvalidated, the FSM does not re-arm for the day.