Implements step 2 of Jason Shapiro's COT contrarian process: tests whether a crowded market failed to react to favorable news using a statistically validated drift-significance test. Consumes a COT report and curated events JSON, fetches price data, and produces a CONFIRMED/NOT_CONFIRMED/INSUFFICIENT_EVIDENCE verdict.
Ships in tradermonty-claude-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Implements step 2 of Jason Shapiro's COT contrarian process: once a market
is flagged as crowded (cot-contrarian-detector, step 1), check whether it
FAILED to react to news that should have rewarded the crowd. A crowded-long
market that doesn't rally on genuinely bullish news, or a crowded-short
market that doesn't sell off on genuinely bearish news, is the core
behavioral tell that the crowd has run out of buying/selling power — this
is the confirmation step that turns "crowded" into a contrarian setup
candidate (steps 3-5, still manual: price-action confirmation, entry, exit).
Why this isn't a naive failure-ratio check: an earlier design flagged
"news failure" whenever fewer than half the relevant events "responded" —
but under pure noise, roughly 69% of individual events fail to respond by
chance, so that rule would CONFIRM on random noise 48-83% of the time
depending on sample size. This skill instead requires the market to have
moved significantly against the crowd's favorable news (a drift-
significance test with a Monte-Carlo-verified null false-positive bound),
never merely "didn't respond enough." See
references/news-failure-patterns.md for the full statistical rationale.
English:
cot-contrarian-detector flags a market CROWDED_LONG / CROWDED_SHORT
and the user wants to move to step 2Japanese:
Do NOT use when:
--direction overrideFMP_API_KEY or pass --api-key. Used
for price data only (stable/historical-price-eod/light) — coverage
varies by symbol; see references/price-source-map.md.requests installed.cot-contrarian-detector JSON report (--detector-json)
to auto-resolve symbol + direction, or supply --direction explicitly.Validate run_context.data_date and every supplied vintage for the selected market:
markets[].data_date and data_provenance.market_data_dates[symbol]. Each must
be nonempty, parseable, not after --as-of, and no older than
--max-detector-age-days (the boundary itself is accepted). Use the oldest
validated date for the audit age; keep the original run context unchanged.
Legacy reports may omit row/map dates and fall back to the report date. A
present invalid/null/empty date or malformed provenance/map container fails
closed using the existing missing/invalid/future/stale reason codes. Other
symbols' row/map dates do not replace the selected market's vintage. Existing
first-10-character date parsing remains compatible; this is not a stricter
full-timestamp or provenance-schema validator.
PriceClient uses the adjacent generated FMP client for stable light EOD requests, preserving exact symbol/from/to ranges, the strict price boundary, source/proxy order and the information cutoff. There is no legacy endpoint fallback. CLI --api-key still takes priority over FMP_API_KEY. Endpoint entitlement depends on the provider plan; no new live endpoint verification is claimed.
The shared transport now owns pacing (default 0.25 seconds; --sleep-seconds overrides it), the bounded 429 retry and one malformed-JSON retry. The former five-attempt exponential loop is removed: other HTTP or transport failures advance the source chain without local retries. Exhausted 429 retains the generated daily-limit stop state. api_calls_made now exposes the shared counter of received HTTP responses, including retry responses; transport exceptions are not counted by this version of the shared core. It is not a count of source probes.
Diagnostics retain only fixed error markers/classifications, never provider body or exception details. Empty successful data, invalid schema, post-cutoff-only rows and HTTP failures remain distinct in price_attempts. The price field, proxy choice, event vintage rules and reaction formulas are unchanged. The CLI closes its owned session before reporting; Python callers should use with PriceClient(...) as client: or call close(). Injected replacement sessions become owned by that client.
From a cot-contrarian-detector report (--detector-json, symbol looked
up in markets[]) or directly from the user (--symbol + --direction).
A NEUTRAL classification, a symbol missing from the report, or a report
older than --max-detector-age-days (default 10) all refuse fail-closed
with a specific reason — only an explicit --direction overrides.
Search news in the evaluation window (--window-days, default 10) using
the 4-tier source hierarchy (issuer/primary → SEC/official stats → wire →
portal — see references/news-failure-patterns.md). Write findings into
an events JSON from references/news-failure-patterns.md's template —
event, event_time (ISO8601 with explicit UTC offset), source_url,
source_tier, expected_impact (BULLISH/BEARISH) per event.
Never fabricate events or URLs. WebSearch unavailable → state it
explicitly; proceed without an events JSON only if the user accepts an
INSUFFICIENT_EVIDENCE result (reason no_events_provided) — the CLI
never raises an exception for a missing events file, it always exits 0
with a documented reason.
python3 skills/news-reaction-failure-analyzer/scripts/analyze_news_reaction.py \
--symbol B6 --detector-json reports/cot_crowding_2026-07-12.json \
--events-json reports/nrf_events_B6_2026-07-12.json \
--output-dir reports/
The script fetches the price series (documented fallback chain — futures
symbol first, ETF proxy if 402/restricted or rows == 0; see
references/price-source-map.md), computes effective dates / returns /
z-scores per event, clusters events whose 3-trading-day windows overlap
(independence guard), and synthesizes the verdict.
Present the verdict, aggregate stats (drift_stat, responded_ratio), and
the evidence table (per-event returns/z-scores/reaction labels, with any
dropped_events reasons shown — never silently hidden). If a proxy
(run_context.proxy_used) was used, note the tracking-error caveat.
Emit a handoff block for contrarian-setup-gate (#241, not yet built):
{"news_failure": {"verdict": "CONFIRMED", "confidence": "HIGH", "report_path": "reports/nrf_B6_2026-07-12.json"}}
reports/nrf_<symbol>_<as-of-date>.json — schema_version,
symbol, direction, expected_direction, actual_reaction
(FAILED_TO_RALLY/FAILED_TO_SELL_OFF/RALLIED/SOLD_OFF/
MIXED_REACTION/NO_DATA), verdict, confidence,
relevant_events_used, aggregate (mean_z3/drift_stat/responded_ratio),
evidence[], dropped_events[], run_context.reports/nrf_<symbol>_<as-of-date>.md — human-readable
verdict, aggregate stats, evidence table, dropped-events table, proxy
caveat (if used), and methodology footnote.--min-events (default 3) usable relevant event clusters, a missing
detector report, or a detector vintage (data_date) that's missing,
unparsable, dated after --as-of, or older than
--max-detector-age-days (stale), a NEUTRAL classification without an
explicit override, or no working price source all produce this verdict
— never a crash, never a forced call on inadequate data.cot-contrarian-detector); news-failure evidence should be read in
that context, not as same-day confirmation.expected_impact
matches the crowd's expected_direction count).run_context.proxy_used), the report says so — tracking error, expense
drag, and roll-timing differences make the reaction-direction read
approximate, not exact.references/news-failure-patterns.md for the full numbers. Users who
want the stricter <10% margin even under that stress can pass
--drift-z 1.75 (at the cost of missing some genuine news-failure
signals, not just noise).references/news-failure-patterns.mdFull methodology: what qualifies as a relevant event, the 4-tier source hierarchy, worked examples, the events-JSON curation guide + template, and the verdict-threshold rationale (why drift-significance, not a naive ratio; the Monte-Carlo-verified null bounds).
references/price-source-map.mdPer-market price-source fallback chain, verified/402/0-rows status (live-
probed at implementation time), ETF-proxy caveats, and markets with no
viable source (documented no_price_source cases: VX, ZQ, HO, all agri on
this key).
references/news-failure-patterns.mdreferences/price-source-map.mdreferences/news-failure-patterns.md (opens in a new tab)references/price-source-map.md (opens in a new tab)requirements.txt (opens in a new tab)scripts/analyze_news_reaction.py (opens in a new tab)scripts/fmp_client.py (opens in a new tab)scripts/reaction_math.py (opens in a new tab)scripts/tests/test_analyze_news_reaction.py (opens in a new tab)scripts/tests/test_cot_market_vintage.py (opens in a new tab)scripts/tests/test_generated_transport.py (opens in a new tab)scripts/tests/test_price_source_cutoff.py (opens in a new tab)scripts/tests/test_reaction_math.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cot, contrarian, news-failure, market-analysis, behavioral-finance
/tradermonty-claude-trading-skills:news-reaction-failure-analyzerfrom tradermonty-claude-trading-skills
tradermonty-claude-trading-skills@cascade-business-ops is listed by joshuarweaver/cascade-business-ops — review the source before installing
npx claudepluginhub joshuarweaver/cascade-business-ops --plugin tradermonty-claude-trading-skills74 skills in this plugin
/backtest-expertExpert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development./breadth-chart-analystThis skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the US Stock Market Uptrend Stock Ratio charts. Use this skill when the user provides breadth chart images for analysis, requests market breadth assessment, positioning strategy recommendations, or wants to understand medium-term strategic and short-term tactical market outlook based on breadth indicators. Also works WITHOUT chart images by fetching CSV data directly from public sources. All analysis and output are conducted in English./breakout-trade-plannerGenerate Minervini-style breakout trade plans from VCP screener output with worst-case risk calculation, portfolio heat management, and Alpaca-compatible order templates (stop-limit bracket for pre-placement, limit bracket for post-confirmation). Use when user has VCP screener results and wants actionable trade plans with entry/stop/target levels and position sizing.Other plugins' skills for the same job