Skip to main content
skill CX Codex

uptrend-analyzer — Claude Code skill: market breadth scoring

Scores market breadth 0–100 from Monty's Uptrend Ratio Dashboard data and suggests how much equity exposure fits the current environment.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tradermonty/claude-trading-skills --skill uptrend-analyzer -a claude-code
Open on GitHub

What uptrend-analyzer does

The skill pulls free CSVs from GitHub — roughly 2,800 US stocks across 11 sectors — and builds five components: overall breadth (30% weight), sector participation (25%), rotation (15%), momentum (20%) and historical context (10%). The output is a 0–100 score where higher means healthier. The score lands in a zone, from Strong Bull with full exposure down to Bear with capital preservation.

Slopes get smoothed with EMA(3), and acceleration compares a recent 10-point average against the prior one, falling back to 5v5 when fewer than 20 data points exist. Warnings sit on top of the composite: late cycle, a sector ratio spread above 40pp, divergence inside a group. Penalties stack up to -10, and two or more active warnings return +1.

You need Python 3.9+ with the requests library and an internet connection. No API key, unlike Market Top Detector, which reads from the paid FMP API. One command runs it: python3 skills/uptrend-analyzer/scripts/uptrend_analyzer.py. It writes a JSON and a Markdown report, both stamped with date and time.

What it helps with

  • check whether the rally is broad or carried by a few sectors
  • get an exposure target for the current market phase
  • see which sectors lead and which lag
  • catch divergence inside a sector group before it becomes obvious
  • compare momentum against its historical percentile instead of the raw level

Example prompts for the agent

  • run uptrend-analyzer and tell me if market breadth is healthy
  • check the uptrend ratios across sectors with uptrend-analyzer
  • how broad is the rally according to Monty's Uptrend Dashboard?

How to install uptrend-analyzer

1Skills CLI (Vercel)

npx skills add tradermonty/claude-trading-skills --skill uptrend-analyzer -a claude-code

2Manually: put the files in place

~/.claude/skills/uptrend-analyzer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/uptrend-analyzer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about uptrend-analyzer

How do I install uptrend-analyzer in Claude?

Run npx skills add tradermonty/claude-trading-skills --skill uptrend-analyzer -a claude-code. The skill lands at ~/.claude/skills/uptrend-analyzer/SKILL.md.

What does uptrend-analyzer do?

It produces a 0–100 composite score from five breadth components and returns exposure guidance. Data comes from free Monty's Uptrend Ratio Dashboard CSVs.

How is uptrend-analyzer different from Market Top Detector?

A higher score in uptrend-analyzer means a healthier market; a higher score in Market Top Detector means more risk. The first runs on free CSVs, the second needs an FMP key.

Source text

SKILL.md · MIT
---
name: uptrend-analyzer
description: Analyzes market breadth using Monty's Uptrend Ratio Dashboard data to diagnose the current market environment. Generates a 0-100 composite score from 5 components (breadth, sector participation, rotation, momentum, historical context). Use when asking about market breadth, uptrend ratios, or whether the market environment supports equity exposure. No API key required.
---

# Uptrend Analyzer Skill

## Purpose

Diagnose market breadth health using Monty's Uptrend Ratio Dashboard, which tracks ~2,800 US stocks across 11 sectors. Generates a 0-100 composite score (higher = healthier) with exposure guidance.

Unlike the Market Top Detector (API-based risk scorer), this skill uses free CSV data to assess "participation breadth" - whether the market's advance is broad or narrow.

## When to Use This Skill

**English:**
- User asks "Is the market breadth healthy?" or "How broad is the rally?"
- User wants to assess uptrend ratios across sectors
- User asks about market participation or breadth conditions
- User needs exposure guidance based on breadth analysis
- User references Monty's Uptrend Dashboard or uptrend ratios

**Japanese:**
- 「市場のブレドスは健全?」「上昇の裾野は広い?」
- セクター別のアップトレンド比率を確認したい
- 相場参加率・ブレドス状況を診断したい
- ブレドス分析に基づくエクスポージャーガイダンスが欲しい
- Montyのアップトレンドダッシュボードについて質問

## Prerequisites

- **Python 3.9+** with the `requests` library (CSV parsing uses the stdlib `csv`/`io` modules)
- **Internet connection** to fetch CSV data from GitHub (no API key required)
- No paid API subscriptions needed

## Difference from Market Top Detector

| Aspect | Uptrend Analyzer | Market Top Detector |
|--------|-----------------|-------------------|
| Score Direction | Higher = healthier | Higher = riskier |
| Data Source | Free GitHub CSV | FMP API (paid) |
| Focus | Breadth participation | Top formation risk |
| API Key | Not required | Required (FMP) |
| Methodology | Monty Uptrend Ratios | O'Neil/Minervini/Monty |

---

## Execution Workflow

### Phase 1: Execute Python Script

Run the analysis script (no API key needed):

```bash
python3 skills/uptrend-analyzer/scripts/uptrend_analyzer.py
```

The script will:
1. Download CSV data from Monty's GitHub repository
2. Calculate 5 component scores
3. Generate composite score and reports

### Phase 2: Present Results

Present the generated Markdown report to the user, highlighting:
- Composite score and zone classification
- Exposure guidance (Full/Normal/Reduced/Defensive/Preservation)
- Sector heatmap showing strongest and weakest sectors
- Key momentum and rotation signals

---

## 5-Component Scoring System

| # | Component | Weight | Key Signal |
|---|-----------|--------|------------|
| 1 | Market Breadth (Overall) | **30%** | Ratio level + trend direction |
| 2 | Sector Participation | **25%** | Uptrend sector count + ratio spread |
| 3 | Sector Rotation | **15%** | Cyclical vs Defensive balance |
| 4 | Momentum | **20%** | Slope direction + acceleration |
| 5 | Historical Context | **10%** | Percentile rank in history |

## Scoring Zones

| Score | Zone | Exposure Guidance |
|-------|------|-------------------|
| 80-100 | Strong Bull | Full Exposure (100%) |
| 60-79 | Bull | Normal Exposure (80-100%) |
| 40-59 | Neutral | Reduced Exposure (60-80%) |
| 20-39 | Cautious | Defensive (30-60%) |
| 0-19 | Bear | Capital Preservation (0-30%) |

### 7-Level Zone Detail

Each scoring zone is further divided into sub-zones for finer-grained assessment:

| Score | Zone Detail | Color |
|-------|-------------|-------|
| 80-100 | Strong Bull | Green |
| 70-79 | Bull-Upper | Light Green |
| 60-69 | Bull-Lower | Light Green |
| 40-59 | Neutral | Yellow |
| 30-39 | Cautious-Upper | Orange |
| 20-29 | Cautious-Lower | Orange |
| 0-19 | Bear | Red |

### Warning System

Active warnings trigger exposure penalties that tighten guidance even when the composite score is high:

| Warning | Condition | Penalty |
|---------|-----------|---------|
| **Late Cycle** | Commodity avg > both Cyclical and Defensive | -5 |
| **High Spread** | Max-min sector ratio spread > 40pp | -3 |
| **Divergence** | Intra-group std > 8pp, spread > 20pp, or trend dissenters | -3 |

Penalties stack (max -10) + multi-warning discount (+1 when ≥2 active). Applied after composite scoring.

### Momentum Smoothing

Slope values are smoothed using EMA(3) (Exponential Moving Average, span=3) before scoring. Acceleration is calculated by comparing the recent 10-point average vs prior 10-point average of smoothed slopes (10v10 window), with fallback to 5v5 when fewer than 20 data points are available.

### Historical Confidence Indicator

The Historical Context component includes a confidence assessment based on:
- **Sample size:** Number of historical data points available
- **Regime coverage:** Proportion of distinct market regimes (bull/bear/neutral) observed
- **Recency:** How recent the latest data point is

Confidence levels: High, Medium, Low.

---

## API Requirements

**Required:** None (uses free GitHub CSV data)

## Output Files

- JSON: `uptrend_analysis_YYYY-MM-DD_HHMMSS.json`
- Markdown: `uptrend_analysis_YYYY-MM-DD_HHMMSS.md`

## Reference Documents

### `references/uptrend_methodology.md`
- Uptrend Ratio definition and thresholds
- 5-component scoring methodology
- Sector classification (Cyclical/Defensive/Commodity)
- Historical calibration notes

### When to Load References
- **First use:** Load `uptrend_methodology.md` for full 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.

© tradermonty · MIT · tradermonty/claude-trading-skills

Similar skills

Everything for Finance and business →

From the same set73

economic-calendar-fetcher Pulls scheduled economic events from FMP and hands back raw JSON, so the assistant can turn them into a dated report. CX Codex +1 3,500installs stanley-druckenmiller-investment Combines outputs from up to eight trading analysis skills into a single 0 to 100 conviction score. Helps determine portfolio exposure and market regime using Stanley Druckenmiller principles. CX Codex +1 3,500installs sector-analyst Analyzes sector rotation and market-cycle positioning from CSV data. Use it to assess cyclical versus defensive conditions and spot overbought sectors. CX Codex +1 3,500installs earnings-calendar Pulls the upcoming US earnings calendar from Financial Modeling Prep and lays it out as a markdown table, grouped by date and release time. CX Codex +1 3,500installs market-top-detector Assesses tactical 2-8 week market top risk for 10-20% corrections using O'Neil distribution days, Minervini deterioration, and defensive rotation. CX Codex +1 3,400installs us-market-bubble-detector Scores US market bubble risk from hard numbers: Put/Call, VIX, margin debt, breadth, IPO data. Useful when you need to decide on profit-taking. CX Codex +1 3,400installs earnings-trade-analyzer Scores recent post-earnings stocks on five factors, giving each a 0–100 score and an A/B/C/D grade. CX Codex +1 3,400installs breadth-chart-analyst Evaluates US market breadth using S&P 500 moving averages and the Uptrend Stock Ratio. It pulls public CSV datasets, reads charts, and generates tactical markdown reports. CX Codex +1 3,400installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor