Agent skill

Market Top Detector

by tradermonty in tradermonty/claude-trading-skills

Detects market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty Defensive Sector Rotation.

MITAuto-check passed

Install Market Top Detector

skills CLI
$ npx skills add tradermonty/claude-trading-skills --skill market-top-detector -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tradermonty/claude-trading-skills market-top-detector --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tradermonty/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/market-top-detector .claude/skills/market-top-detector && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
market-top-detector
GitHub stars
3k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
697 words
Files
42 (incl. scripts, references)
Skills in repo
74
Repo updated
First seen
Licence
MIT

At a glance

Detects market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty Defensive Sector Rotation.

  • Works in 3 steps: Data Collection via WebSearch → Execute Python Script → Present Results
  • User asks about market top risk
  • SKILL.md covers Purpose, When to Use This Skill, Prerequisites and Difference from Bubble Detector, plus 7 more sections
  • Runs Python scripts from its folder; calls python3; reaches barchart.com and ycharts.com; needs FMP_API_KEY

What it does

Market Top Detector is an agent skill from 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.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 44 other files, including scripts and reference files (for example `references/distribution_day_guide.md`, `references/historical_tops.md` and `references/market_top_methodology.md`).

The repository describes itself as: Claude Code skills for equity investors and traders — market analysis, technical charting, economic calendars, screeners, and trading strategy development. The licence is MIT.

When your agent uses it

  • User asks about market top risk
  • Distribution days
  • Defensive rotation
  • Leadership breakdown

Example prompts

  • “Use the market-top-detector skill to detect market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty…”
  • “/market-top-detector”

Requirements

  • Python 3
  • A credential in FMP_API_KEY

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Data Collection via WebSearch
  2. Execute Python Script
  3. Present Results

What it can do on your machine

Read from SKILL.md and the folder at commit c8d58f0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 13 files in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • barchart.com
    • ycharts.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • FMP_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Market Top Detector loads about 2.2k tokens when it runs, and up to ~6.9k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 697 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tradermonty/claude-trading-skills at commit c8d58f0, republished under its MIT licence (© tradermonty). 697 words, ~2,160 tokens.

Download SKILL.mdSave it as .claude/skills/market-top-detector/SKILL.md (or your agent's skills folder). This skill also uses 41 other files; get the full folder from GitHub.
name
market-top-detector
description
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.

Market Top Detector Skill

Purpose

Detect the probability of a market top formation using a quantitative 6-component scoring system (0-100). Integrates three proven market top detection methodologies:

  1. O'Neil - Distribution Day accumulation (institutional selling)
  2. Minervini - Leading stock deterioration pattern
  3. Monty - Defensive sector rotation signal

Unlike the Bubble Detector (macro/multi-month evaluation), this skill focuses on tactical 2-8 week timing signals that precede 10-20% market corrections.

When to Use This Skill

English:

  • User asks "Is the market topping?" or "Are we near a top?"
  • User notices distribution days accumulating
  • User observes defensive sectors outperforming growth
  • User sees leading stocks breaking down while indices hold
  • User asks about reducing equity exposure timing
  • User wants to assess correction probability for the next 2-8 weeks

Japanese:

  • 「天井が近い?」「今は利確すべき?」
  • ディストリビューションデーの蓄積を懸念
  • ディフェンシブセクターがグロースをアウトパフォーム
  • 先導株が崩れ始めているが指数はまだ持ちこたえている
  • エクスポージャー縮小のタイミング判断
  • 今後2〜8週間の調整確率を評価したい

Prerequisites

Required:

  • FMP API Key: Set $FMP_API_KEY environment variable or pass --api-key. Free tier sufficient (~33 API calls per execution).
  • WebSearch Access: Required to collect S&P 500 breadth (50DMA %) and CBOE Put/Call ratio data.

Optional:

  • Margin Debt Data: Enhances sentiment scoring but typically 1-2 months lagged.
  • VIX Term Structure: Auto-detected from FMP API if VIX3M quote available; manual override via --vix-term.

Data Freshness: All manually collected data should be from the most recent 3 business days for accurate analysis.

Difference from Bubble Detector

AspectMarket Top DetectorBubble Detector
Timeframe2-8 weeksMonths to years
Target10-20% correctionBubble collapse (30%+)
MethodologyO'Neil/Minervini/MontyMinsky/Kindleberger
DataPrice/Volume + BreadthValuation + Sentiment + Social
Score Range0-100 composite0-15 points

Execution Workflow

Phase 1: Data Collection via WebSearch

Before running the Python script, collect the following data using WebSearch. Data Freshness Requirement: All data must be from the most recent 3 business days. Stale data degrades analysis quality.

1. S&P 500 Breadth (200DMA above %)
   AUTO-FETCHED from TraderMonty CSV (no WebSearch needed)
   The script fetches this automatically from GitHub Pages CSV data.
   Override: --breadth-200dma [VALUE] to use a manual value instead.
   Disable: --no-auto-breadth to skip auto-fetch entirely.

2. [REQUIRED] S&P 500 Breadth (50DMA above %)
   Valid range: 20-100
   Primary search: "S&P 500 percent stocks above 50 day moving average"
   Fallback: "market breadth 50dma site:barchart.com"
   Direct fallback when search snippets are poor: fetch `https://www.barchart.com/stocks/quotes/$S5FI/overview` and extract the embedded `lastPrice` / `tradeTime` for “S&P 500 Stocks Above 50-Day Average”.
   Record the data date

3. [REQUIRED] CBOE Equity Put/Call Ratio
   Valid range: 0.30-1.50
   Primary search: "CBOE equity put call ratio today"
   Fallback: "CBOE total put call ratio current"
   Fallback: "put call ratio site:cboe.com"
   Direct fallback when Cboe CSV endpoints are stale: fetch `https://ycharts.com/indicators/cboe_equity_put_call_ratio` and parse the “Last Value” / “Latest Period” table fields. Treat this as a secondary source and cite it in freshness notes.
   Record the data date

4. [OPTIONAL] VIX Term Structure
   Values: steep_contango / contango / flat / backwardation
   Primary search: "VIX VIX3M ratio term structure today"
   Fallback: "VIX futures term structure contango backwardation"
   Note: Auto-detected from FMP API if VIX3M quote available.
   CLI --vix-term overrides auto-detection.

5. [OPTIONAL] Margin Debt YoY %
   Primary search: "FINRA margin debt latest year over year percent"
   Fallback: "NYSE margin debt monthly"
   Note: Typically 1-2 months lagged. Record the reporting month.
Phase 2: Execute Python Script

Run the script with collected data as CLI arguments:

bash
python3 skills/market-top-detector/scripts/market_top_detector.py \
  --api-key $FMP_API_KEY \
  --breadth-50dma [VALUE] --breadth-50dma-date [YYYY-MM-DD] \
  --put-call [VALUE] --put-call-date [YYYY-MM-DD] \
  --vix-term [steep_contango|contango|flat|backwardation] \
  --margin-debt-yoy [VALUE] --margin-debt-date [YYYY-MM-DD] \
  --output-dir reports/ \
  --context "Consumer Confidence=[VALUE]" "Gold Price=[VALUE]"
# 200DMA breadth is auto-fetched from TraderMonty CSV.
# Override with --breadth-200dma [VALUE] if needed.
# Disable with --no-auto-breadth to skip auto-fetch.

The script will:

  1. Fetch S&P 500, QQQ, VIX quotes and history from FMP API
  2. Fetch Leading ETF (ARKK, WCLD, IGV, XBI, SOXX, SMH, KWEB, TAN) data
  3. Fetch Sector ETF (XLU, XLP, XLV, VNQ, XLK, XLC, XLY) data
  4. Calculate all 6 components
  5. Generate composite score and reports
Phase 3: Present Results

Present the generated Markdown report to the user, highlighting:

  • Composite score and risk zone
  • Data freshness warnings (if any data older than 3 days)
  • Strongest warning signal (highest component score)
  • Historical comparison (closest past top pattern)
  • What-if scenarios (sensitivity to key changes)
  • Recommended actions based on risk zone
  • Follow-Through Day status (if applicable)
  • Delta vs previous run (if prior report exists)

Show full SKILL.md (284 more words)Show less

6-Component Scoring System

#ComponentWeightData SourceKey Signal
1Distribution Day Count25%FMP APIInstitutional selling in last 25 trading days
2Leading Stock Health20%FMP APIGrowth ETF basket deterioration
3Defensive Sector Rotation15%FMP APIDefensive vs Growth relative performance
4Market Breadth Divergence15%Auto (CSV) + WebSearch200DMA (auto) / 50DMA (WebSearch) breadth vs index level
5Index Technical Condition15%FMP APIMA structure, failed rallies, lower highs
6Sentiment & Speculation10%FMP + WebSearchVIX, Put/Call, term structure

Risk Zone Mapping

ScoreZoneRisk BudgetAction
0-20Green (Normal)100%Normal operations
21-40Yellow (Early Warning)80-90%Tighten stops, reduce new entries
41-60Orange (Elevated Risk)60-75%Profit-taking on weak positions
61-80Red (High Probability Top)40-55%Aggressive profit-taking
81-100Critical (Top Formation)20-35%Maximum defense, hedging

Exchange Calendar and Replay

Install requirements.txt before running the detector. Freshness uses XNYS sessions rather than weekdays. --as-of YYYY-MM-DD is accepted for the live evaluation date, but historical live replay fails closed because the current quote endpoints are not point-in-time sources.

API Requirements

Required: FMP API key (free tier sufficient: ~33 calls per execution) Optional: WebSearch data for breadth and sentiment (improves accuracy)

Output Files

  • JSON: market_top_YYYY-MM-DD_HHMMSS.json
  • Markdown: market_top_YYYY-MM-DD_HHMMSS.md

Reference Documents

references/market_top_methodology.md
  • Full methodology with O'Neil, Minervini, and Monty frameworks
  • Component scoring details and thresholds
  • Historical validation notes
references/distribution_day_guide.md
  • Detailed O'Neil Distribution Day rules
  • Stalling day identification
  • Follow-Through Day (FTD) mechanics
references/historical_tops.md
  • Analysis of 2000, 2007, 2018, 2022 market tops
  • Component score patterns during historical tops
  • Lessons learned and calibration data
When to Load References
  • First use: Load market_top_methodology.md for full framework understanding
  • Distribution day questions: Load distribution_day_guide.md
  • Historical context: Load historical_tops.md
  • Regular execution: References not needed - script handles scoring

© tradermonty, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 41 other files (scripts, references) in skills/market-top-detector of tradermonty/claude-trading-skills.

  • SKILL.md
  • references/distribution_day_guide.md
  • references/historical_tops.md
  • references/market_top_methodology.md
  • requirements.txt
  • scripts/_market_calendar.py
  • scripts/breadth_csv_client.py
  • scripts/calculators/__init__.py
  • scripts/calculators/breadth_calculator.py
  • scripts/calculators/defensive_rotation_calculator.py
  • scripts/calculators/distribution_day_calculator.py
  • scripts/calculators/index_technical_calculator.py
  • scripts/calculators/leading_stock_calculator.py
  • scripts/calculators/math_utils.py
  • scripts/calculators/sentiment_calculator.py
  • scripts/fmp_client.py
  • scripts/historical_comparator.py
  • scripts/market_top_detector.py
  • … and 24 more

Open the folder on GitHubat commit c8d58f0

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in tradermonty/claude-trading-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Market Top Detector next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Market Top Detector compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Market Top Detector this skilltradermonty/claude-trading-skills3k1 repos~2.2kAutomated safety check: PassMIT
Distributed Triagepytorch/pytorch104k—~2.8kAutomated safety check: PassCustom licence
Threat Detectionalirezarezvani/claude-skills28k—~3.5kAutomated safety check: PassMIT
Resemble Detectgithub/awesome-copilot40k3 repos~4.1kAutomated safety check: PassApache-2.0
Pii Detectruvnet/ruflo74k—~350Automated safety check: NotesMIT
Detecting Dnp3 Protocol Anomaliesmukul975/Anthropic-Cybersecurity-Skills34k—~3.6kAutomated safety check: PassApache-2.0

Similar skills

  • Distributed Triage

    pytorch/pytorch

    Sub-triages issues in the oncall:distributed queue by assigning distributed module labels, routing to sub-oncalls, and marking triaged.

    104k GitHub stars~2.8k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Threat Detection

    alirezarezvani/claude-skills

    A skill your agent uses when hunting for threats in an environment, analyzing IOCs, or detecting behavioral anomalies in telemetry.

    28k GitHub stars~3.5k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Resemble Detect

    github/awesome-copilot

    Official

    Deepfake detection and media safety — detect AI-generated audio, images, video, and text, trace synthesis sources, apply watermarks, verify speaker identity, and analyze media intelligence using…

    40k GitHub starsUsed in 3 repos~4.1k tokens
    Media & CreativeAuto-check passed
  • Pii Detect

    ruvnet/ruflo

    Detect and flag personally identifiable information (PII) in text, code, and configurations.

    74k GitHub stars~350 tokensUpdated yesterday
    Auto-check: notes
  • Detecting Dnp3 Protocol Anomalies

    mukul975/Anthropic-Cybersecurity-Skills

    Detect anomalies in DNP3 communications used in SCADA/ICS systems by monitoring unauthorized control commands, firmware update attempts, protocol violations, and deviations from baseline traffic…

    34k GitHub stars~3.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Detecting Attacks On Scada Systems

    mukul975/Anthropic-Cybersecurity-Skills

    This skill covers detecting cyber attacks targeting Supervisory Control and Data Acquisition (SCADA) systems including man-in-the-middle attacks on industrial protocols, unauthorized command…

    34k GitHub stars~6.9k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed

More from tradermonty/claude-trading-skills

All 74 skills in this repo
  • Technical Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.

    3k GitHub starsUsed in 4 repos~4.6k tokens
    Auto-check passed
  • Theme Detector

    tradermonty/claude-trading-skills

    Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.

    3k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed
  • Trader Memory Core

    tradermonty/claude-trading-skills

    Track investment theses across their lifecycle — from screening idea to closed position with postmortem.

    3k GitHub starsUsed in 2 repos~4.3k tokens
    Auto-check passed
  • Edge Strategy Reviewer

    tradermonty/claude-trading-skills

    Critically review strategy drafts from edge-strategy-designer for edge plausibility, overfitting risk, sample size adequacy, and execution realism.

    3k GitHub starsUsed in 1 repo~988 tokens
    Auto-check passed
  • Sector Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing sector rotation patterns and market cycle positioning.

    3k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Stanley Druckenmiller Investment

    tradermonty/claude-trading-skills

    Druckenmiller Strategy Synthesizer - Integrates 8 upstream skill outputs (Market Breadth, Uptrend Analysis, Market Top, Macro Regime, FTD Detector, VCP Screener, Theme Detector, CANSLIM Screener)…

    3k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Questions about Market Top Detector

What does Market Top Detector do?

Detects market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty Defensive Sector Rotation. Market Top Detector is an agent skill from tradermonty/claude-trading-skills. Detects market top probability using O'Neil Distribution Days, Minervini Leading Stock Deterioration, and Monty Defensive Sector Rotation.

When should I use Market Top Detector?

Market Top Detector fits situations like: user asks about market top risk; distribution days; defensive rotation; leadership breakdown.

How do I install Market Top Detector in Claude Code?

Run `npx skills add tradermonty/claude-trading-skills --skill market-top-detector -a claude-code`. Or copy the skill folder (skills/market-top-detector in tradermonty/claude-trading-skills) into .claude/skills/market-top-detector in your project. Claude Code loads it when a task matches its description.

How do I install Market Top Detector in Codex?

Run `npx skills add tradermonty/claude-trading-skills --skill market-top-detector -a codex`. Or copy the skill folder (skills/market-top-detector in tradermonty/claude-trading-skills) into .agents/skills/market-top-detector in your project. Codex loads it when a task matches its description.

Can I use Market Top Detector in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tradermonty/claude-trading-skills --skill market-top-detector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/market-top-detector, .gemini/skills/market-top-detector, .github/skills/market-top-detector and .opencode/skills/market-top-detector in your project.

What does Market Top Detector need to run?

Going by SKILL.md and its folder, Market Top Detector needs Python for the scripts in its folder, the command-line tools its instructions call (python3) and credentials named FMP_API_KEY. Our summary lists: Python 3; A credential in FMP_API_KEY.

Does Market Top Detector access the network?

SKILL.md names 2 domains. In commands or code: barchart.com and ycharts.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Market Top Detector safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Market Top Detector use?

Market Top Detector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Market Top Detector use?

About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.7k tokens, read only when the agent opens those files.

What are the alternatives to Market Top Detector?

Skills that share tags, products or a category with Market Top Detector: Distributed Triage (pytorch/pytorch, 104k stars), Threat Detection (alirezarezvani/claude-skills, 28k stars), Resemble Detect (github/awesome-copilot, 40k stars) and Pii Detect (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Market Top Detector?

tradermonty (a GitHub user) maintains it in tradermonty/claude-trading-skills, which has 2,982 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.

Source: tradermonty/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.