news-reaction-failure-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNews Reaction Failure Analyzer
新闻反应失败分析器
Overview
概述
Implements step 2 of Jason Shapiro's COT contrarian process: once a market
is flagged as crowded (, 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).
cot-contrarian-detectorWhy 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
for the full statistical rationale.
references/news-failure-patterns.md实现Jason Shapiro的COT反向策略流程的第二步:一旦某市场被标记为拥挤状态(由工具的第一步流程识别),检查该市场是否未能对本应让拥挤头寸获利的新闻做出反应。拥挤多头市场未在真正利好的新闻下上涨,或拥挤空头市场未在真正利空的新闻下下跌,这是表明拥挤群体已耗尽买卖力量的核心行为信号——这一步确认流程将“拥挤状态”转化为反向交易候选机会(后续第3-5步仍需人工操作:价格行为确认、入场、出场)。
cot-contrarian-detector为何不采用简单失败率检查:早期设计中,只要不足半数相关事件“做出反应”就标记为“新闻反应失败”——但在纯噪声情况下,约69%的单个事件会随机无反应,因此该规则会在48%-83%的时间内误判为确认状态(取决于样本量)。本工具则要求市场对有利于拥挤头寸的新闻做出显著反向变动(采用经蒙特卡洛验证的零假设假阳性边界的漂移显著性测试),而非仅仅“反应不足”。详细统计原理请见。
references/news-failure-patterns.mdWhen to Use This Skill
适用场景
English:
- "Did the market shrug off [event] even though [asset] is crowded long/short?"
- "Run a news-failure check on [symbol]"
- "Is [symbol] confirmed for a Shapiro-style contrarian setup?"
- After flags a market CROWDED_LONG / CROWDED_SHORT and the user wants to move to step 2
cot-contrarian-detector
Japanese:
- 「この市場は好材料に反応しなかった?」
- 「COTで偏っているこの銘柄のニュース失敗を確認して」
Do NOT use when:
- The market isn't crowded (NEUTRAL classification) — this skill refuses
fail-closed without an explicit override
--direction - No curated events JSON exists yet — WebSearch must run first (Phase 2 below); never fabricate events or URLs to get a verdict
英文场景:
- "Did the market shrug off [event] even though [asset] is crowded long/short?"
- "Run a news-failure check on [symbol]"
- "Is [symbol] confirmed for a Shapiro-style contrarian setup?"
- 当标记某市场为CROWDED_LONG/CROWDED_SHORT,且用户希望进入第二步流程时
cot-contrarian-detector
日语场景:
- 「この市場は好材料に反応しなかった?」
- 「COTで偏っているこの銘柄のニュース失敗を確認して」
不适用场景:
- 市场未处于拥挤状态(NEUTRAL分类)——若无明确覆盖参数,本工具将拒绝生成判定结果
--direction - 尚未生成整理后的事件JSON文件——需先运行WebSearch(下文第二阶段);绝不允许伪造事件或URL来生成判定结果
Prerequisites
前置条件
- FMP API Key: Required. Set or pass
FMP_API_KEY. Used for price data only (--api-key) — coverage varies by symbol; seestable/historical-price-eod/light.references/price-source-map.md - Python 3.9+ with installed.
requests - WebSearch access to curate the events JSON (Phase 2). Skill degrades gracefully without it (states the limitation; never fabricates events).
- Optional: a JSON report (
cot-contrarian-detector) to auto-resolve symbol + direction, or supply--detector-jsonexplicitly.--direction
- **FMP API密钥:**必填。设置环境变量或通过
FMP_API_KEY参数传入。仅用于获取价格数据(--api-key)——覆盖范围因标的而异;详见stable/historical-price-eod/light。references/price-source-map.md - Python 3.9+ 环境,并已安装库。
requests - WebSearch访问权限:用于整理事件JSON文件(第二阶段)。若无该权限,工具会优雅降级(说明限制;绝不伪造事件)。
- 可选:生成的JSON报告(
cot-contrarian-detector参数):用于自动解析标的+方向,也可直接通过--detector-json参数明确指定方向。--direction
Workflow
工作流程
Phase 1: Obtain symbol + direction
第一阶段:获取标的+方向
From a report (, symbol looked
up in ) or directly from the user ( + ).
A classification, a symbol missing from the report, or a report
older than (default 10) all refuse fail-closed
with a specific reason — only an explicit overrides.
cot-contrarian-detector--detector-jsonmarkets[]--symbol--directionNEUTRAL--max-detector-age-days--direction通过报告(参数,从中读取标的)或直接从用户输入获取( + 参数)。若报告中为NEUTRAL分类、标的未在报告中存在、或报告早于(默认10天),工具将明确拒绝生成判定结果——仅当传入明确的覆盖参数时例外。
cot-contrarian-detector--detector-jsonmarkets[]--symbol--direction--max-detector-age-days--directionPhase 2: Curate the events JSON via WebSearch
第二阶段:通过WebSearch整理事件JSON文件
Search news in the evaluation window (, default 10) using
the 4-tier source hierarchy (issuer/primary → SEC/official stats → wire →
portal — see ). Write findings into
an events JSON from 's template —
, (ISO8601 with explicit UTC offset), ,
, (BULLISH/BEARISH) per event.
--window-daysreferences/news-failure-patterns.mdreferences/news-failure-patterns.mdeventevent_timesource_urlsource_tierexpected_impactNever fabricate events or URLs. WebSearch unavailable → state it
explicitly; proceed without an events JSON only if the user accepts an
result (reason ) — the CLI
never raises an exception for a missing events file, it always exits 0
with a documented reason.
INSUFFICIENT_EVIDENCEno_events_provided在评估窗口内(,默认10天)搜索新闻,采用4层级来源优先级(发行方/官方来源→SEC/官方统计→通讯社→门户平台——详见)。将搜索结果写入模板中的事件JSON文件——每个事件需包含、(带明确UTC偏移的ISO8601格式)、、、(BULLISH/BEARISH)字段。
--window-daysreferences/news-failure-patterns.mdreferences/news-failure-patterns.mdeventevent_timesource_urlsource_tierexpected_impact绝不允许伪造事件或URL。若无WebSearch访问权限→明确说明;仅当用户接受结果(原因)时,才可在无事件JSON文件的情况下继续——CLI绝不会因缺少事件文件抛出异常,始终会返回0退出码并说明原因。
INSUFFICIENT_EVIDENCEno_events_providedPhase 3: Run the CLI
第三阶段:运行CLI
bash
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 ; see
), computes effective dates / returns /
z-scores per event, clusters events whose 3-trading-day windows overlap
(independence guard), and synthesizes the verdict.
rows == 0references/price-source-map.mdbash
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/脚本会获取价格序列(有文档记录的回退链——优先使用期货标的,若返回402/受限或则使用ETF替代;详见),计算每个事件的有效日期/收益率/z值,对3个交易日窗口重叠的事件进行聚类(独立性校验),并生成最终判定结果。
rows == 0references/price-source-map.mdPhase 4: Present verdict + handoff
第四阶段:展示判定结果+流程交接
Present the verdict, aggregate stats (, ), and
the evidence table (per-event returns/z-scores/reaction labels, with any
reasons shown — never silently hidden). If a proxy
() was used, note the tracking-error caveat.
drift_statresponded_ratiodropped_eventsrun_context.proxy_usedEmit a handoff block for (#241, not yet built):
contrarian-setup-gatejson
{"news_failure": {"verdict": "CONFIRMED", "confidence": "HIGH", "report_path": "reports/nrf_B6_2026-07-12.json"}}展示判定结果、汇总统计数据(、)以及证据表格(每个事件的收益率/z值/反应标签,同时展示的原因——绝不隐藏)。若使用了替代标的(),需注明跟踪误差提示。
drift_statresponded_ratiodropped_eventsrun_context.proxy_used输出用于(#241,尚未开发)的交接块:
contrarian-setup-gatejson
{"news_failure": {"verdict": "CONFIRMED", "confidence": "HIGH", "report_path": "reports/nrf_B6_2026-07-12.json"}}Output
输出结果
- 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(mean_z3/drift_stat/responded_ratio),aggregate,evidence[],dropped_events[].run_context - Markdown: — human-readable verdict, aggregate stats, evidence table, dropped-events table, proxy caveat (if used), and methodology footnote.
reports/nrf_<symbol>_<as-of-date>.md
- 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(mean_z3/drift_stat/responded_ratio)、aggregate、evidence[]、dropped_events[]字段。run_context - Markdown文件:——人类可读的判定结果、汇总统计数据、证据表格、事件剔除表格、替代标的提示(若使用)以及方法论脚注。
reports/nrf_<symbol>_<as-of-date>.md
Guardrails
防护规则
- CONFIRMED is not a trade signal. It confirms step 2 of 5 — price- action confirmation (step 3), entry (step 4), and exit (step 5) are still manual and still required before any position.
- INSUFFICIENT_EVIDENCE never advances the pipeline. Fewer than
(default 3) usable relevant event clusters, a missing detector report, or a detector vintage (
--min-events) that's missing, unparsable, dated afterdata_date, or older than--as-of(stale), a--max-detector-age-daysclassification without an explicit override, or no working price source all produce this verdict — never a crash, never a forced call on inadequate data.NEUTRAL - COT publication lag. COT data is 3-9 days old by the time it's read
(see ); news-failure evidence should be read in that context, not as same-day confirmation.
cot-contrarian-detector - Counter-direction events are context only — shown in the evidence
table but excluded from the verdict (only events whose matches the crowd's
expected_impactcount).expected_direction - Proxy-based prices are noted, not hidden. When an ETF proxy was used
(), the report says so — tracking error, expense drag, and roll-timing differences make the reaction-direction read approximate, not exact.
run_context.proxy_used - Residual statistical risk under extreme correlation. The verdict's
null false-CONFIRMED rate is hard-verified under i.i.d. noise (<8%) and
under a realistic residual-correlation stress (AR(1) ρ=0.1, <10%). Under
an intentionally extreme correlation stress (lag-1 ρ=0.3 across
non-clustered event windows — roughly 10x liquid-futures empirical
autocorrelation), the measured null rate rises to ~11-13%. This is a
documented v1 limitation, not a silent gap — see
for the full numbers. Users who want the stricter <10% margin even under that stress can pass
references/news-failure-patterns.md(at the cost of missing some genuine news-failure signals, not just noise).--drift-z 1.75 - Not investment advice. Research/educational purposes only.
- CONFIRMED并非交易信号:它仅确认5步流程中的第2步——价格行为确认(第3步)、入场(第4步)、出场(第5步)仍需人工操作,且是建立头寸前的必要步骤。
- INSUFFICIENT_EVIDENCE绝不会推进流程:可用相关事件聚类数少于(默认3个)、缺少detector报告、detector报告的时间戳(
--min-events)缺失/无法解析/晚于data_date/早于--as-of(过期)、无明确覆盖参数的NEUTRAL分类、无可用价格来源等情况,都会生成该判定结果——绝不会崩溃,绝不会基于不足数据强行生成判定。--max-detector-age-days - COT数据发布延迟:COT数据在读取时已滞后3-9天(详见);新闻反应失败的证据需结合该背景解读,不可视为当日确认信号。
cot-contrarian-detector - 反向事件仅作为参考——会在证据表格中展示,但不纳入判定结果(仅与拥挤群体
expected_impact匹配的事件才会被统计)。expected_direction - 替代标的价格会明确标注:当使用ETF替代标的时(),报告中会明确说明——跟踪误差、费用损耗和滚动时间差异会导致反应方向的判断为近似值,而非精确值。
run_context.proxy_used - 极端相关性下的残留统计风险:在独立同分布噪声下,判定结果的零假设假CONFIRMED率经严格验证低于8%;在现实残留相关性压力下(AR(1) ρ=0.1)低于10%。在刻意极端的相关性压力下(非聚类事件窗口的滞后1阶ρ=0.3——约为流动性期货实际自相关性的10倍),测得的零假设率会升至约11-13%。这是v1版本的已记录限制,而非隐性漏洞——详细数据请见。若用户希望在该压力下仍保持<10%的假阳性率,可传入
references/news-failure-patterns.md参数(代价是会错过部分真实的新闻反应失败信号,而非仅过滤噪声)。--drift-z 1.75 - 不构成投资建议:仅用于研究/教育目的。
Resources
参考资源
references/news-failure-patterns.md
references/news-failure-patterns.mdreferences/news-failure-patterns.md
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).
完整方法论:相关事件的定义、4层级来源优先级、示例、事件JSON整理指南+模板、判定阈值原理(为何采用漂移显著性而非简单比率;蒙特卡洛验证的零假设边界)。
references/price-source-map.md
references/price-source-map.mdreferences/price-source-map.md
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 cases: VX, ZQ, HO, all agri on
this key).
no_price_source各市场的价格来源回退链、验证/402/0行状态(实现时实时探测)、ETF替代标的提示、以及无可用来源的市场(已记录的案例:VX、ZQ、HO、所有农产品标的)。
no_price_sourceWhen to Load References
何时加载参考资源
- First use / explaining the methodology: Load
references/news-failure-patterns.md - Explaining why a market has no verdict (no_price_source): Load
references/price-source-map.md - Regular execution: References not needed for the CLI itself — needed for Phase 2 (events curation) and for explaining results to the user
- **首次使用/解释方法论:**加载
references/news-failure-patterns.md - **解释为何某市场无判定结果(no_price_source):**加载
references/price-source-map.md - **常规执行:**CLI本身无需参考资源——仅在第二阶段(事件整理)和向用户解释结果时需要