Normative specification. Module 2 is deterministic (no LLM). It classifies a scheduled economic release and the market's reaction to it, and decides whether the information is stable enough for the trading bot to review. It does not decide bullish/bearish, pick sectors/stocks, or place orders — those belong to the specialist macro modules, Output 2, and the trading bot.
Implementation: routes/module2.py → snapshots/module2.json, surfaced in the
"Module 2" navbar view.
Module 2 must not produce one vague event result. It produces three separate decisions, which remain separate:
EVENT_DATA_OUTCOME — what the released figures were vs expectations.MARKET_REACTION_OUTCOME — how stocks, volatility and breadth reacted.EVENT_TRADE_REVIEW_STATUS — whether the info is complete/stable enough for
the trading bot to examine a possible trade.Example: CPI materially hotter than expected — Confirmed risk-off reaction —
Ready for trading-bot review.
For every numeric component:
RAW_SURPRISE = ACTUAL_VALUE − CONSENSUS_MEDIAN
(e.g. CPI 0.4% vs 0.3% → +0.1pp; payrolls 250k vs 180k → +70k).RELATIVE_SURPRISE_PCT = RAW_SURPRISE ÷ |CONSENSUS_MEDIAN| × 100.
Skip when consensus is zero. Display-only — not used in the score (percentages
distort near zero).STD_SURPRISE = RAW_SURPRISE ÷ SURPRISE_SCALE.
Cap to ±3.00 for the score; display the uncapped value separately.| Std surprise | Class |
|---|---|
| ≥ +2.00 | EXTREME ABOVE-EXPECTATION |
| +1.00 … <+2.00 | MATERIAL ABOVE-EXPECTATION |
| +0.50 … <+1.00 | SMALL ABOVE-EXPECTATION |
| −0.50 … <+0.50 | IN LINE |
| −1.00 … ≤−0.50 | SMALL BELOW-EXPECTATION |
| −2.00 … ≤−1.00 | MATERIAL BELOW-EXPECTATION |
| ≤ −2.00 | EXTREME BELOW-EXPECTATION |
REVISED_PREVIOUS − ORIGINAL_PREVIOUS.RAW_REVISION ÷ REVISION_SCALE, capped ±3.00.Assign an exact multiplier to every component: +1 if a higher figure increases the
named event condition, −1 if it decreases it.
ORIENTED_COMPONENT_SCORE = CAPPED_STD_SURPRISE × DIRECTION_MULTIPLIER.
Examples: higher CPI → hotter inflation (+1); higher payrolls → stronger employment (+1); higher unemployment → weaker employment (−1); higher layoffs → weaker (−1). This is an economic-condition score, not a stock-direction call.
EVENT_DATA_SCORE = Σ(ORIENTED_COMPONENT_SCORE × WEIGHT) ÷ TOTAL_AVAILABLE_WEIGHT.| Score | Band |
|---|---|
| ≥ +2.00 | EXTREME POSITIVE |
| +1.00 … <+2.00 | MATERIAL POSITIVE |
| +0.50 … <+1.00 | SMALL POSITIVE |
| −0.50 … <+0.50 | IN LINE |
| −1.00 … ≤−0.50 | SMALL NEGATIVE |
| −2.00 … ≤−1.00 | MATERIAL NEGATIVE |
| ≤ −2.00 | EXTREME NEGATIVE |
"Positive/negative" are replaced by event-specific words (inflation: hotter/cooler; employment/growth/demand: stronger/weaker; central bank: tighter/easier than priced).
MATERIAL_COMPONENT_CONFLICT = TRUE): one critical
component ≥ +1.00 std surprise and another critical ≤ −1.00 →
EVENT_DATA_OUTCOME = MATERIAL COMPONENTS MIXED (still display the score).SMALL_COMPONENT_CONFLICT = TRUE): one critical ≥ +0.50
and another ≤ −0.50, and no material conflict → SMALL COMPONENTS MIXED.COMPONENTS_CONSISTENT = TRUE): all non-neutral critical
components point the same way, or all are in line.Implementation note (v1, headline-first): the engine currently scores the primary component at 100% for every event type (§20 fallback). The full component weight tables below are the target once FMP calendar-row matching per release is proven. Weights and critical-component sets are recorded here as the authoritative reference.
Critical: Core CPI MoM, Headline CPI MoM. Weights: Core MoM 40%, Headline MoM 25%, Core YoY 15%, Headline YoY 10%, prev Core MoM revision 5%, prev Headline MoM revision 5%. Direction: all +1. Labels: EXTREMELY / MATERIALLY / SLIGHTLY HOTTER · BROADLY IN LINE · SLIGHTLY / MATERIALLY / EXTREMELY COOLER · CPI COMPONENTS MIXED.
Critical: Core PCE MoM, Headline PCE MoM. Weights: Core MoM 45%, Headline MoM 20%, Core YoY 15%, Headline YoY 10%, prev Core MoM revision 5%, prev Headline MoM revision 5%. Direction: all +1. Same bands as CPI. Pass-through to Consumer Strength module (not mixed into inflation score): personal income, personal spending, real personal spending, savings rate.
Critical: Headline PPI MoM, Core PPI MoM. Weights: Core MoM 35%, Headline MoM 30%, ex-food/energy/trade 20%, Core YoY 5%, Headline YoY 5%, prev Core revision 3%, prev Headline revision 2%. Direction: all +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY HOTTER · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY COOLER · COMPONENTS MIXED.
Critical: Nonfarm Payrolls, Unemployment rate, Avg hourly earnings MoM. Weights: NFP 35%, Unemployment 20%, AHE MoM 20%, two-month net payroll revision 15%, private payrolls 5%, avg weekly hours 5%. Direction: NFP +1, Unemployment −1, AHE +1, revision +1, private payrolls +1, weekly hours +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONGER · BROADLY IN LINE · SLIGHTLY/ MATERIALLY/EXTREMELY WEAKER · EMPLOYMENT COMPONENTS MIXED.
Critical: Job openings. Weights: openings 70%, prev openings revision 10%, quits rate 10%, hiring rate 5%, layoffs & discharges 5%. Direction: openings +1, revision +1, quits +1, hiring +1, layoffs −1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONG · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY WEAK LABOUR DEMAND · COMPONENTS MIXED.
Critical: control group, headline. Weights: control group 40%, headline 25%, ex-autos 20%, ex-autos-and-fuel 10%, prev control-group revision 5%. Direction: +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONGER · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY WEAKER CONSUMER DEMAND · COMPONENTS MIXED.
Σ(range_midpoint × normalised_probability) from
Fed Funds Futures.(ACTUAL_LOWER + ACTUAL_UPPER) ÷ 2.POLICY_RATE_SURPRISE_BPS = (ACTUAL_MID − EXPECTED_MID) × 100.Same calculations as §16 (expected/actual midpoint, bps surprise, probability class). Statement/guidance/asset-purchases/press-conference → Central Banks module.
Output EVENT_DATA_OUTCOME = TEXT EVENT — NUMERIC OUTCOME NOT AVAILABLE,
OFFICIAL_TEXT_STATUS, TRANSCRIPT_STATUS, TEXT_DIFFERENCES_FROM_PREVIOUS,
MARKET_REACTION_OUTCOME, SPECIALIST_INTERPRETATION_REQUIRED = TRUE. Never invent
a numeric score.
Per numeric component: actual, dealer/market consensus, raw surprise, std surprise, above/in-line/below. Components: borrowing estimate, refunding amount, auction size by maturity, change in auction size, buybacks, issuance-schedule changes. Do not combine into one directional score. Output TREASURY COMPONENTS CONSISTENT / MIXED / REPORT INCOMPLETE. Funding-pressure verdict → Treasury Auctions module.
Primary headline component at weight 100%; compute raw + std surprise; classify above/in-line/below. Do not invent secondary weights; pass secondary components separately.
(CURRENT ÷ PRE_EVENT − 1) × 100.(CURRENT_YIELD − PRE_EVENT_YIELD) × 100 bps.CURRENT_MOVE ÷ HISTORICAL_MEDIAN_ABS_MOVE, capped ±3.00.Positive = risk-on, negative = risk-off. Weights: S&P 35%, QQQ/Nasdaq 20%,
IWM/Russell 15%, VIX 20%, breadth 10%. Equity up = +, breadth improving = +,
VIX up = − (ORIENTED_VIX = NORMALISED_VIX × −1).
MARKET_REACTION_SCORE = weighted average of valid oriented reactions.
S&P and VIX are critical; ≥70% of weight must be available (renormalise to 100%);
missing critical data → REACTION DATA INVALID.
| Score | Band |
|---|---|
| ≥ +2.00 | EXTREME RISK-ON |
| +1.00 … <+2.00 | MATERIAL RISK-ON |
| +0.50 … <+1.00 | SMALL RISK-ON |
| −0.50 … <+0.50 | NO MATERIAL DIRECTION |
| −1.00 … ≤−0.50 | SMALL RISK-OFF |
| −2.00 … ≤−1.00 | MATERIAL RISK-OFF |
| ≤ −2.00 | EXTREME RISK-OFF |
Compute a separate reaction score at every required horizon.
Start at 0. Add +1 each: SPY/QQQ/IWM not materially disagreeing; VIX confirms equities; breadth confirms equities; 15/30/60-min directions agree; close confirms 60-min; next-day 09:45 confirms event-day. Subtract: −2 two-sided; −2 unusually volatile; −1 equity-index conflict; −1 equity/VIX conflict; −1 30-min reverses 5-min. Classification: ≥4 HIGH · 2–3 MEDIUM · 0–1 LOW · <0 CONFLICTING.
Critical data invalid → REACTION DATA INVALID · not released → REACTION NOT STARTED · 5-min incomplete → COLLECTING REACTION DATA · two-sided → CONFLICTING TWO-SIDED · unusually volatile → CONFLICTING HIGH-VOLATILITY · confidence <0 → CONFLICTING REACTION · next-day confirm → NEXT-DAY CONFIRMED RISK-ON/OFF · close confirm → CLOSING-CONFIRMED RISK-ON/OFF · 15/30/60 agree → INTRADAY-CONFIRMED RISK-ON/OFF · only 30-min → PROVISIONAL RISK-ON/OFF/NEUTRAL · only 5-min → INITIAL REACTION ONLY.
MODULE_2_EVENT_OUTCOME_LABEL = EVENT_DATA_OUTCOME — MARKET_REACTION_OUTCOME
(e.g. CPI MATERIALLY HOTTER THAN EXPECTED — CLOSING-CONFIRMED RISK-OFF). Never
reduce the two to a single bullish/bearish number; the specialist module interprets
macro meaning.
Analysis disabled → EVENT TRADE MODE DISABLED · cancelled → NOT APPLICABLE · not occurred → EVENT TRADE BLOCKED · waiting period active → COLLECTING REACTION DATA · event data invalid → SKIP — INVALID EVENT DATA · reaction data invalid → SKIP — INVALID REACTION DATA · two-sided → SKIP — TWO-SIDED REACTION · unusually volatile → SKIP — UNUSUALLY VOLATILE · confidence <0 → SKIP — CONFLICTING REACTION · confidence 0–1 with a stage remaining → CONTINUE COLLECTING · confidence 0–1 after final stage → SKIP — NO CLEAR REACTION · confidence ≥2 with no pause → READY FOR TRADING-BOT REVIEW.
"Ready for trading-bot review" ≠ trade approved; it only means the info is complete enough to examine.
For every event, Output 1 contains the full trail:
Event-data: actual, consensus median, previous, revised previous, raw surprise,
relative surprise, surprise scale, uncapped & capped std surprise, direction
multiplier, oriented component score, component weight, weighted contribution,
available total weight, event-data score, component-conflict status, event-data
outcome.
Market-reaction: pre-event reference per instrument; price/yield/VIX move per
horizon; historical median abs move; normalised & oriented reaction; instrument
weight; weighted contribution; reaction score per horizon; equity-index conflict;
equity/VIX conflict; two-sided; unusually volatile; confidence points &
classification; final reaction outcome.
Permission/handoff: normal swing-trade permission; pause start/end; earliest
event-trade review time; event-trade review status; module-2 event-outcome label;
specialist module receiving the event; specialist interpretation status; Output-2
handoff status; trading-bot handoff status; trade_approved = FALSE;
order_generated = FALSE.
Whether hotter CPI / stronger employment is bullish or bearish under the current regime; whether a Fed statement is dovish/hawkish; sector or stock preference; position size or count; entry, stop, target; trade execution. Those belong to the specialist macro modules, Output 2, and the trading bot.