Skip to content
tradermonty avatar

Downtrend Duration Analyzer

Interactive HTML histograms of historical downtrend durations, segmented by sector and market cap tier.

CCM score
61 of 100
skills.sh installs
3.7K
GitHub stars
8.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers peak-to-trough downtrend detection on OHLC data, with durations in trading days and depth as percentage decline
  • Includes analyze_downtrends.py for analysis, generate_histogram_html.py for Plotly charts, and a methodology reference
  • Outputs JSON and markdown summaries with median, mean, and P25 to P90 percentiles, plus filterable HTML visualizations
  • Designed for traders setting mean reversion holding periods, stop-loss timeouts, and realistic recovery expectations

Install

$ npx -y skills add tradermonty/claude-trading-skills --skill downtrend-duration-analyzer -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Downtrend Duration Analyzer

Overview

Analyze historical price data to identify downtrend periods (peak-to-trough) and build statistical distributions of correction durations. Generate interactive HTML visualizations with histograms segmented by sector and market cap to help traders understand typical recovery timeframes and set realistic expectations for mean reversion strategies.

When to Use

  • Trader asks about typical correction lengths for a sector or market cap tier
  • User wants to understand historical drawdown recovery times
  • Building mean reversion or pullback strategies that need realistic holding period estimates
  • Comparing correction behavior across different market segments
  • Setting stop-loss timeouts or position holding period limits

Prerequisites

  • Python 3.9+
  • FMP API key (set FMP_API_KEY environment variable or use --api-key). The stock universe comes from the company screener, which the free FMP plan does not include (HTTP 402/403); a plan that includes it is required (see docs/en/getting-started.md#fmp-plans)
  • Required packages: requests, pandas, numpy (standard data analysis stack)

Details

Repository
github.com/tradermonty/claude-trading-skills
Categories
Finance & Trading, Data Science & Analytics
First seen
Jun 3, 2026

Questions

What does the downtrend-duration-analyzer skill do?

The downtrend-duration-analyzer skill analyzes historical price data to find peak-to-trough downtrends and builds distributions of correction durations. It generates interactive HTML histograms segmented by sector and market cap, showing typical correction lengths.

How do I install the downtrend-duration-analyzer skill?

Run npx -y skills add tradermonty/claude-trading-skills --skill downtrend-duration-analyzer -y in a project to install it. After installation, the downtrend-duration-analyzer lets the agent compute downtrend durations and summary statistics from price history.

What does downtrend-duration-analyzer need to run?

The downtrend-duration-analyzer needs Python 3.9 or newer and an FMP API key set as FMP_API_KEY or passed with --api-key. Its stock universe comes from the FMP company screener, which the free FMP plan does not include, so a plan that includes it is required.

Which sectors and market caps does downtrend-duration-analyzer cover?

The downtrend-duration-analyzer groups results by sector and by market cap tier of Mega, Large, Mid and Small. It reports median, mean and percentile durations so traders can compare correction behavior across these segments.

More from tradermonty/claude-trading-skills

All 54

Similar to Downtrend Duration Analyzer

More Finance & Trading