strategy_mean_reversion

Identify mean reversion candidates in correlated stock baskets using cross-sectional return ranking and moving average filters.

2|4|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/khoks/ClaudeTrading --skill strategy-mean-reversion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategy_mean_reversion
Source: https://github.com/khoks/ClaudeTrading/tree/main/.claude/skills/strategy_mean_reversion
Command: npx skills add https://github.com/khoks/ClaudeTrading --skill strategy-mean-reversion

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

For traders managing a basket of correlated stocks, manually identifying true underperformers (not just stocks dropping with the broader market) and applying consistent risk filters is time-consuming and prone to emotional bias. This skill automates that process to systematically capture mean reversion opportunities while avoiding common pitfalls like catching falling knives or overexposing to recently bought positions.

Core Features & Use Cases

  • Cross-Sectional Laggard Identification: Compares each stock's N-day return to the pool's median return to isolate stock-specific underperformance, ignoring broad market moves that affect all holdings equally.
  • Built-In Risk Guardrails: Includes a 50-day moving average filter to avoid buying stocks in confirmed downtrends, a rebuy throttle to prevent stacking positions across consecutive trading ticks, and cash balance checks to stay within budget limits.
  • Use Case: If you run a paper trading portfolio of 8 correlated tech stocks, this skill will automatically buy the worst performer when it underperforms the group by at least 5% and trades above its 50-day moving average, no manual screening required.

Quick Start

Invoke the strategy_mean_reversion skill during a scheduled master_trading run to automatically evaluate your buyable stock pool and place small, risk-controlled buy orders for qualifying underperformers.

Frequently Asked Questions about strategy_mean_reversion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify stock-specific underperformance for mean reversion trading?

To identify stock-specific underperformance for mean reversion, compare each stock's N-day return against the median return of your correlated stock basket. This strips out systematic market drift to isolate true laggards rather than broad market drops.

Can I automate contrarian stock trading with Alpaca paper trading?

Yes, you can automate contrarian stock trading with Alpaca paper trading by running scheduled workflows. The strategy evaluates a pre-defined pool of buyable stocks to place small, risk-controlled long positions on qualifying underperformers automatically.

What is cross-sectional return ranking in automated trading?

Cross-sectional return ranking in automated trading compares individual asset returns against the median of a correlated pool. This isolates stock-specific price drops by filtering out broad market moves, helping find mean reversion candidates.

Does mean reversion strategy avoid buying stocks in confirmed downtrends?

Yes, mean reversion strategy avoids buying stocks in confirmed downtrends by applying a 50-day moving average trend filter. This risk guardrail ensures the skill only buys underperforming stocks that still trade above their long-term trend.

How do I prevent stacking positions across consecutive automated trading ticks?

To prevent stacking positions across consecutive automated trading ticks, apply a rebuy throttle. This built-in risk guardrail restricts the strategy from repeatedly buying the same recently purchased stock during multiple scheduled evaluations.

Do I need jq to run mean reversion paper trading scripts?

Yes, you need jq installed to run mean reversion paper trading scripts. This dependency is required to process JSON data from the Alpaca trading API and parse the cross-sectional return rankings for your stock basket.