PluginBench
Skill
Review
Audit score 70

market-breadth-analyzer

tradermonty/claude-trading-skills

How to install market-breadth-analyzer

npx skills add https://github.com/tradermonty/claude-trading-skills --skill market-breadth-analyzer
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from tradermonty/claude-trading-skills.


name: market-breadth-analyzer description: 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.

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

Related skills

More from tradermonty/claude-trading-skills and the wider catalog.

MAmarket-environment-analysis logo

market-environment-analysis

tradermonty/claude-trading-skills

Comprehensive market environment analysis and reporting tool. Analyzes global markets including US, European, Asian markets, forex, commodities, and economic indicators. Provides risk-on/risk-off assessment, sector analysis, and technical indicator interpretation. Triggers on keywords like market analysis, market environment, global markets, trading environment, market conditions, investment climate, market sentiment, forex analysis, stock market analysis, 相場環境, 市場分析, マーケット状況, 投資環境.

1.2k installs
MAmarket-news-analyst logo

market-news-analyst

tradermonty/claude-trading-skills

Analyze market-moving news from the past 10 days and assess impact on equities and commodities.

1.5k installs
MAmarket-top-detector logo

market-top-detector

tradermonty/claude-trading-skills

Detects market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty Defensive Sector Rotation. Generates a 0-100 composite score with risk zone classification. Use when user asks about market top risk, distribution days, defensive rotation, leadership breakdown, or whether to reduce equity exposure. Focuses on 2-8 week tactical timing signals for 10-20% corrections.

695 installs
OPoptions-strategy-advisor logo

options-strategy-advisor

tradermonty/claude-trading-skills

Options trading strategy analysis and simulation tool. Provides theoretical pricing using Black-Scholes model, Greeks calculation, strategy P/L simulation, and risk management guidance. Use when user requests options strategy analysis, covered calls, protective puts, spreads, iron condors, earnings plays, or options risk management. Includes volatility analysis, position sizing, and earnings-based strategy recommendations. Educational focus with practical trade simulation.

1.0k installsAudited
PApair-trade-screener logo

pair-trade-screener

tradermonty/claude-trading-skills

Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair trading opportunities, statistical arbitrage screening, mean-reversion strategies, or market-neutral portfolio construction. Supports correlation analysis, cointegration testing, and spread backtesting.

765 installs
PEpead-screener logo

pead-screener

tradermonty/claude-trading-skills

Screen post-earnings gap-up stocks for PEAD (Post-Earnings Announcement Drift) patterns. Analyzes weekly candle formation to detect red candle pullbacks and breakout signals. Supports two input modes - FMP earnings calendar (Mode A) or earnings-trade-analyzer JSON output (Mode B). Use when user asks about PEAD screening, post-earnings drift, earnings gap follow-through, red candle breakout patterns, or weekly earnings momentum setups.

642 installs