Gojiberry AI
AI agents that find and contact high-intent leads for you
Try Gojiberry free →
Hermes Agent
Run your Hermes agent, fully managed
Launch on Hostinger →
Hostinger VPS
Spin up a VPS in one click, 20% off
Launch on Hostinger →
Firecrawl
Crawl and scrape any site into clean data
Try Firecrawl free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
Context.dev
One API to scrape, enrich, and extract the web
Start building free →
Jotform
Forms, workflows, and AI Agents for your team
Try Jotform free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
OpenClaw
Deploy a managed OpenClaw agent in 60 seconds
Launch on Hostinger →
Sponsor here
9/10 sponsor slots taken — 1 left
Claim it →
Claude Market
Menu
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Claude Market
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Skills/tradermonty/claude-trading-skills/downtrend-duration-analyzer
downtrend-duration-analyzer logo

downtrend-duration-analyzer

tradermonty/claude-trading-skills
858 installs3K stars
Run it on Hostinger, 20% off →Your friend gets 20% off too, using this linkFree API →|External DownloadsCommand ExecutionData ExfiltrationPrompt Injection|View on GitHub|Create your own skill →

Installation

npx skills add https://github.com/tradermonty/claude-trading-skills --skill downtrend-duration-analyzer

Summary

Analyze historical downtrend durations and generate interactive HTML histograms showing typical correction lengths by sector and market cap.

SKILL.md

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)
  • Required packages: requests, pandas, numpy (standard data analysis stack)

Workflow

Step 1: Fetch Historical Price Data

Run the analysis script to fetch OHLC data for a universe of stocks and identify downtrend periods.

python3 skills/downtrend-duration-analyzer/scripts/analyze_downtrends.py \
  --sector "Technology" \
  --lookback-years 5 \
  --output-dir reports/

Step 2: Analyze Downtrend Durations

The script automatically:

  1. Identifies local peaks and troughs using rolling window analysis
  2. Calculates duration (trading days) and depth (% decline) for each downtrend
  3. Segments results by sector and market cap tier (Mega, Large, Mid, Small)
  4. Computes summary statistics (median, mean, percentiles)

Step 3: Generate Interactive HTML Visualization

python3 skills/downtrend-duration-analyzer/scripts/generate_histogram_html.py \
  --input reports/downtrend_analysis_*.json \
  --output-dir reports/

This creates an interactive HTML file with:

  • Histogram of downtrend durations
  • Filters for sector and market cap
  • Hover tooltips with percentile information
  • Summary statistics table

Step 4: Review Distribution Insights

Load the generated markdown report to interpret the findings:

  • Short corrections (5-15 days): Typical pullbacks within uptrends
  • Medium corrections (15-40 days): Standard sector rotations
  • Extended corrections (40+ days): Trend changes or bear markets

Output Format

JSON Report

{
  "schema_version": "1.0",
  "analysis_date": "2026-03-28T07:00:00Z",
  "parameters": {
    "lookback_years": 5,
    "sector_filter": "Technology",
    "peak_window": 20,
    "trough_window": 20
  },
  "summary": {
    "total_downtrends": 1234,
    "median_duration_days": 18,
    "mean_duration_days": 24.5,
    "p25_duration_days": 10,
    "p75_duration_days": 32,
    "p90_duration_days": 55
  },
  "by_sector": {
    "Technology": {
      "count": 456,
      "median_days": 15,
      "mean_days": 20.3
    }
  },
  "by_market_cap": {
    "Mega": {"count": 200, "median_days": 12},
    "Large": {"count": 300, "median_days": 16},
    "Mid": {"count": 400, "median_days": 22},
    "Small": {"count": 334, "median_days": 28}
  },
  "downtrends": [
    {
      "symbol": "AAPL",
      "sector": "Technology",
      "market_cap_tier": "Mega",
      "peak_date": "2025-01-15",
      "trough_date": "2025-02-10",
      "duration_days": 18,
      "depth_pct": -12.5
    }
  ]
}

Markdown Report

# Downtrend Duration Analysis

**Date**: 2026-03-28
**Lookback**: 5 years
**Sector**: Technology

## Summary Statistics

| Metric | Value |
|--------|-------|
| Total Downtrends | 1,234 |
| Median Duration | 18 days |
| Mean Duration | 24.5 days |
| 25th Percentile | 10 days |
| 75th Percentile | 32 days |
| 90th Percentile | 55 days |

## By Market Cap Tier

| Tier | Count | Median | Mean |
|------|-------|--------|------|
| Mega ($200B+) | 200 | 12 days | 15.2 days |
| Large ($10-200B) | 300 | 16 days | 20.1 days |
| Mid ($2-10B) | 400 | 22 days | 28.4 days |
| Small (<$2B) | 334 | 28 days | 35.6 days |

## Key Insights

1. Larger companies recover faster from corrections
2. Technology sector shows shorter median correction than market average
3. 90% of corrections resolve within 55 trading days

HTML Visualization

Interactive histogram saved to reports/downtrend_histogram_YYYY-MM-DD.html with:

  • Plotly.js-based interactive charts
  • Sector and market cap dropdown filters
  • Duration distribution with bin controls
  • Percentile markers (P25, P50, P75, P90)

Reports are saved to reports/ with filenames:

  • downtrend_analysis_YYYY-MM-DD_HHMMSS.json
  • downtrend_analysis_YYYY-MM-DD_HHMMSS.md
  • downtrend_histogram_YYYY-MM-DD_HHMMSS.html

Resources

  • scripts/analyze_downtrends.py -- Main analysis script for fetching data and computing downtrend durations
  • scripts/generate_histogram_html.py -- HTML visualization generator with interactive histograms
  • references/downtrend_methodology.md -- Peak/trough detection algorithms and market cap tier definitions

Key Principles

  1. Statistical Rigor: Use robust peak/trough detection to avoid noise-induced false signals
  2. Segmentation Matters: Always analyze by sector and market cap; averages hide important differences
  3. Realistic Expectations: Use percentiles (not just means) to understand the full distribution of outcomes

Score

0–100
65/ 100

Grade

C

Popularity17/30

858 installs — growing adoption. Source repo has 2,609 GitHub stars.

Completeness27/30

Documented: full SKILL.md body, description, one-line install. Missing: category/license metadata.

Trust15/25

Community skill with a public GitHub source repository you can review.

Freshness6/15

No update timestamp is tracked for this skill in our catalog.

Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.

Proud of your score? Add this badge to your README.

Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.

Downtrend Duration Analyzer skill score badge previewScore badge

Markdown

[![Downtrend Duration Analyzer skill](https://www.claudemarket.ai/skills/tradermonty/claude-trading-skills/downtrend-duration-analyzer/badges/score.svg)](https://www.claudemarket.ai/skills/tradermonty/claude-trading-skills/downtrend-duration-analyzer)

HTML

<a href="https://www.claudemarket.ai/skills/tradermonty/claude-trading-skills/downtrend-duration-analyzer"><img src="https://www.claudemarket.ai/skills/tradermonty/claude-trading-skills/downtrend-duration-analyzer/badges/score.svg" alt="Downtrend Duration Analyzer skill"/></a>

Downtrend Duration Analyzer FAQ

How do I install the Downtrend Duration Analyzer skill?

Run “npx skills add https://github.com/tradermonty/claude-trading-skills --skill downtrend-duration-analyzer” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.

What does the Downtrend Duration Analyzer skill do?

Analyze historical downtrend durations and generate interactive HTML histograms showing typical correction lengths by sector and market cap. The full SKILL.md on this page shows the exact instructions the skill gives your agent.

Is the Downtrend Duration Analyzer skill free?

Yes. Downtrend Duration Analyzer is a free, open-source skill published from tradermonty/claude-trading-skills. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.

Does Downtrend Duration Analyzer work with Claude Code and OpenClaw?

Yes. Skills use the portable SKILL.md format, so Downtrend Duration Analyzer works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.

Recommended skills

Browse all →
find-skills logo

find-skills

vercel-labs/skills

2.9M installsInstall
grill-me logo

grill-me

mattpocock/skills

817K installsInstall
frontend-design logo

frontend-design

anthropics/skills

762K installsInstall
grill-with-docs logo

grill-with-docs

mattpocock/skills

696K installsInstall
improve-codebase-architecture logo

improve-codebase-architecture

mattpocock/skills

671K installsInstall
agent-browser logo

agent-browser

vercel-labs/agent-browser

652K installsInstall

Related guides

Hand-picked reading to help you choose, install, and use agent skills.

GuideBest Openclaw Skills 2026GuideHow To Evaluate Openclaw Skill Before InstallingGuideOpenclaw Skills Complete Guide

Skills by category

FrontendBackend & APIsTesting & QASecurityDevOps & CI/CDMCP & ToolingAutomationData & Analysis+27 more

MCP servers by category

MCP & ToolingBackend & APIsData & AnalysisDevOps & CI/CDAutomationSecurityDocsTesting & QA+24 more

Plugins by category

AutomationDevOps & CI/CDData & AnalysisDesign & CreativeSecurityBackend & APIsFrontendTesting & QA+16 more

Marketplaces by category

AutomationData & AnalysisDevOps & CI/CDDesign & CreativeFrontendBackend & APIsTesting & QASecurity+21 more

The Agent Stack

Weekly Claude Code, Agent SDK, and MCP moves worth your time — free.

Claude Market

AI agent skills directory, marketplace, and workflow hub for OpenClaw, Hermes Agent, Claude Code, Codex, and MCP-powered operator stacks.

Independent project, not affiliated with Anthropic.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Plugins
  • Browse Marketplaces
  • Newsletter

More

  • Submit a Tool
  • Create a Skill
  • Advertise
  • Free Tools
  • API
  • Shipping
  • Contact
  • Terms
  • Privacy
© 2026 Claude Market · Not affiliated with Anthropic
Fazier badgeFeatured on Twelve ToolsFeatured on Wired BusinessRemote OpenClaw - Featured on AI Agents DirectoryListed on Turbo0Featured on Uneed