跳到正文
cccskills
免费在 GitHub 公开

market-breadth-analyzer

Assess how broadly stocks participate in market moves using public CSV data. Combine six measures into a market health score from 0 to 100, with component breakdowns, changes across runs, and reports in JSON and Markdown.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Quantifies market breadth health using TraderMonty's public CSV data. Generates a 0-100 composite score across 6 components (100 = healthy). No API key required. Use when user asks about market breadth, participation rate, advance-decline health, whether the rally is broad-based, or general market health assessment.

实测评分 未实测

查看安装方法

适用场景

  • Check whether a rally extends across many stocks
  • Track changes in market participation
  • Compare strong and weak market health measures
  • Review stock exposure guidance based on market breadth

包含的文件(29)

  • SKILL.md7.0 KB
  • references/breadth_analysis_methodology.md13.7 KB
  • requirements.txt128 B
  • scripts/calculators/__init__.py47 B
  • scripts/calculators/bearish_signal_calculator.py4.6 KB
  • scripts/calculators/cycle_calculator.py5.3 KB
  • scripts/calculators/divergence_calculator.py5.4 KB
  • scripts/calculators/historical_context_calculator.py3.4 KB
  • scripts/calculators/ma_crossover_calculator.py3.2 KB
  • scripts/calculators/trend_level_calculator.py3.9 KB
  • scripts/csv_client.py8.0 KB
  • scripts/history_tracker.py2.9 KB
  • scripts/market_breadth_analyzer.py11.6 KB
  • scripts/provenance_contract.py7.4 KB
  • scripts/report_generator.py14.5 KB
  • scripts/scorer.py8.9 KB
  • scripts/tests/conftest.py1.5 KB
  • scripts/tests/test_bearish_signal_calculator.py5.5 KB
  • scripts/tests/test_csv_client.py7.2 KB
  • scripts/tests/test_cycle_calculator.py1.6 KB
  • scripts/tests/test_divergence_calculator.py5.4 KB
  • scripts/tests/test_historical_context_calculator.py3.6 KB
  • scripts/tests/test_history_tracker.py4.1 KB
  • scripts/tests/test_ma_crossover_calculator.py4.4 KB
  • scripts/tests/test_main_provenance.py2.4 KB
  • scripts/tests/test_provenance_contract.py5.9 KB
  • scripts/tests/test_report_generator.py15.5 KB
  • scripts/tests/test_scorer.py4.3 KB
  • scripts/tests/test_trend_level_calculator.py4.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Market Breadth Analyzer Skill

Purpose

Quantify market breadth health using a data-driven 6-component scoring system (0-100). Uses TraderMonty's publicly available CSV data to measure how broadly the market is participating in a rally or decline.

Score direction: 100 = Maximum health (broad participation), 0 = Critical weakness.

No API key required - uses freely available CSV data from GitHub Pages.

When to Use This Skill

English:

  • User asks "Is the market rally broad-based?" or "How healthy is market breadth?"
  • User wants to assess market participation rate
  • User asks about advance-decline indicators or breadth thrust
  • User wants to know if the market is narrowing (fewer stocks participating)
  • User asks about equity exposure levels based on breadth conditions

Japanese:

  • 「マーケットブレッドスはどうですか?」「市場の参加率は?」
  • 「上昇は広がっている?」「一部の銘柄だけの上昇?」
  • ブレッドス指標に基づくエクスポージャー判断
  • 市場の健康度をデータで確認したい

Prerequisites

  • Python 3.9+ with requests library (for fetching CSV data)
  • Internet access to reach GitHub Pages URLs
  • No API keys required - uses freely available public CSV data

Difference from Breadth Chart Analyst

AspectMarket Breadth AnalyzerBreadth Chart Analyst
Data SourceCSV (automated)Chart images (manual)
API RequiredNoneNone
OutputQuantitative 0-100 scoreQualitative chart analysis
Components6 scored dimensionsVisual pattern recognition
RepeatabilityFully reproducibleAnalyst-dependent

Execution Workflow

Phase 1: Execute Python Script

Run the analysis script. If using a nested or date-stamped --output-dir in cron runs, create it first; the history writer expects the directory to already exist.

mkdir -p reports/<routine-or-date>
python3 skills/market-breadth-analyzer/scripts/market_breadth_analyzer.py \
  --detail-url "https://tradermonty.github.io/market-breadth-analysis/market_breadth_data.csv" \
  --summary-url "https://tradermonty.github.io/market-breadth-analysis/market_breadth_summary.csv" \
  --output-dir reports/<routine-or-date>

For a simple ad-hoc run, omit --output-dir or use an existing directory. In scheduled cron runs from the repository root, prefer a repo-relative output directory such as reports/after-close-YYYY-MM-DD rather than an absolute path. If an absolute nested --output-dir unexpectedly fails at the history-writing step despite the directory existing, rerun once with the equivalent repo-relative path before treating the breadth analysis as unavailable.

The script will:

  1. Fetch detail CSV (~2,500 rows, 2016-present) and summary CSV (8 metrics)
  2. Validate data freshness (warn if > 5 days old)
  3. Calculate all 6 component scores (with automatic weight redistribution if any component lacks data)
  4. Generate composite score with zone classification
  5. Track score history and compute trend (improving/deteriorating/stable)
  6. Output JSON and Markdown reports

Phase 2: Present Results

Present the generated Markdown report to the user, highlighting:

  • Composite score and health zone
  • Strongest and weakest components
  • Recommended equity exposure level
  • Key breadth levels to watch
  • Any data freshness warnings

6-Component Scoring System

#ComponentWeightKey Signal
1Breadth Level & Trend25%Current 8MA level + 200MA trend direction + 8MA direction modifier
28MA vs 200MA Crossover20%Momentum via MA gap and direction
3Peak/Trough Cycle20%Position in breadth cycle
4Bearish Signal15%Backtested bearish signal flag
5Historical Percentile10%Current vs full history distribution
6S&P 500 Divergence10%Multi-window (20d + 60d) price vs breadth divergence

Weight Redistribution: If any component lacks sufficient data (e.g., no peak/trough markers detected), it is excluded and its weight is proportionally redistributed among the remaining components. The report shows both original and effective weights.

Score History: Composite scores are persisted across runs (keyed by data date). The report includes a trend summary (improving/deteriorating/stable) when multiple observations are available.

Health Zone Mapping (100 = Healthy)

ScoreZoneEquity ExposureAction
80-100Strong90-100%Full position, growth/momentum favored
60-79Healthy75-90%Normal operations
40-59Neutral60-75%Selective positioning, tighten stops
20-39Weakening40-60%Profit-taking, raise cash
0-19Critical25-40%Capital preservation, watch for trough

Data Sources

Detail CSV: market_breadth_data.csv

  • ~2,500 rows from 2016-02 to present
  • Columns: Date, S&P500_Price, Breadth_Index_Raw, Breadth_Index_200MA, Breadth_Index_8MA, Breadth_200MA_Trend, Bearish_Signal, Is_Peak, Is_Trough, Is_Trough_8MA_Below_04

Summary CSV: market_breadth_summary.csv

  • 8 aggregate metrics (average peaks, average troughs, counts, analysis period)

Both are publicly hosted on GitHub Pages - no authentication required.

Output Files

  • JSON: market_breadth_YYYY-MM-DD_HHMMSS.json
  • Markdown: market_breadth_YYYY-MM-DD_HHMMSS.md
  • History: market_breadth_history.json (persists across runs, max 20 entries)

Reference Documents

references/breadth_analysis_methodology.md

  • Full methodology with component scoring details
  • Threshold explanations and zone definitions
  • Historical context and interpretation guide

When to Load References

  • First use: Load methodology reference for framework understanding
  • Regular execution: References not needed - script handles scoring

Same-run provenance

Pass --run-id daily-20261017-unique to both required market-regime-daily producers. Without it each producer generates its own unique ID. JSON includes schema 1.0 data_provenance with actual primary timeseries business date, UTC retrieval time, source and run ID. Unknown adjustment, point-in-time, survivorship and corporate-action flags are false. Auxiliary summary dates are unverified; this does not certify the freshness of every composite input. Missing or malformed primary dates stop report generation.

Pass the exact JSON paths printed by these invocations to Exposure Coach's --require-provenance --run-id … --as-of … mode. Run IDs are caller-provided consistency markers, not authenticity or point-in-time proof.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Plan and assess backtests, which test trading rules against historical data. Examine sensitivity to rule changes, trading costs, and data bias, then use supplied performance metrics to generate a structured evaluation with reasons that block adoption.

中文简介正在准备中。当前显示英语简介。

  • Define a backtesting plan for rule-based trading
  • Test sensitivity to parameters and trading costs
  • Investigate suspiciously strong backtest results
tradermonty/claude-trading-skills32222026年10月21日 更新

Assess how broadly US stock market gains are shared across stocks using public CSV data and optional charts. Produce English reports covering market conditions, trading signals, scenarios, and positioning for different investment timeframes.

中文简介正在准备中。当前显示英语简介。

  • Checking how broadly US stocks are participating in a market rise
  • Reviewing medium- to long-term market positioning
  • Assessing short-term swing trading signals
tradermonty/claude-trading-skills32222026年10月21日 更新

Analyze chart images showing how broadly US stocks are participating in market trends. Assess medium-term conditions and short-term signals, then produce an English report with positioning guidance, alternative scenarios, and risks based on the visible data.

中文简介正在准备中。当前显示英语简介。

  • Assessing the market cycle from an S&P 500 breadth chart
  • Checking short-term signals in an uptrend stock ratio chart
  • Comparing medium-term and short-term market signals
tradermonty/claude-trading-skills32222026年10月21日 更新

Turn VCP screening results, which identify narrowing price swings, into breakout trade plans. Calculate entry, stop-loss, target prices, and position sizes using worst-case entries, while applying portfolio risk limits and producing Alpaca-compatible order templates.

中文简介正在准备中。当前显示英语简介。

  • Planning entries, stop-losses, and profit targets for VCP candidates
  • Calculating position sizes from account size and risk limits
  • Checking total portfolio risk and sector exposure
tradermonty/claude-trading-skills32222026年10月21日 更新

Screen US growth stocks with William O'Neil's CANSLIM method, which evaluates seven factors including earnings, price strength, trading volume, and market direction. Receive ranked candidates with composite scores, factor breakdowns, market warnings, and data quality notes.

中文简介正在准备中。当前显示英语简介。

  • Find US stocks with earnings growth and price momentum
  • Compare a chosen list of stocks using CANSLIM scores
  • Screen a sector-focused stock list
tradermonty/claude-trading-skills32222026年10月21日 更新

Combine three reports on crowded positions, failed reactions to news, and weekly price reversals into one trading setup status. Identify missing or invalid evidence and determine whether the setup is ready for planning.

中文简介正在准备中。当前显示英语简介。

  • Combine three contrarian strategy reports
  • Check which confirmations are still missing
  • Find stale or inconsistent input reports
tradermonty/claude-trading-skills32222026年10月21日 更新

查看 tradermonty 的全部技能

报告此技能的问题