strategy_mean_reversion_v2

Rank underperforming stocks against basket median returns for mean reversion buys.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill eliminates the manual effort of identifying legitimate contrarian buy opportunities in correlated stock baskets, filtering out market-wide price drift to isolate stock-specific underperformance and avoid emotional, trend-chasing trades.

Core Features & Use Cases

  • Basket-Relative Laggard Ranking: Compares each stock's short-term return to the median return of the entire buyable basket to strip out systematic market moves and identify true underperformers.
  • Built-in Trading Guardrails: Includes a 50-day moving average filter to avoid catching falling knives in confirmed downtrends, a rebuy throttle to prevent overexposure to the same stock across consecutive ticks, and cash balance checks to avoid overextending the trading account.
  • Real-World Use Case: For a paper trading portfolio of 10 correlated tech stocks, this skill automatically identifies the worst-performing laggard that is not in a confirmed downtrend and places a small buy order when the required cooldown period has passed.

Quick Start

Invoke the master_trading_v2 skill during a scheduled trading tick to automatically run this mean reversion strategy against your configured buyable stock basket.

Frequently Asked Questions about strategy_mean_reversion_v2

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

FAQPage Schema
How does mean reversion stock trading identify underperforming basket stocks?

Basket-relative laggard ranking compares each stock's short-term return against the median return of the entire buyable basket to strip out systematic market moves and identify true underperformers for contrarian buy opportunities.

How do I automate contrarian investing strategies for paper trading?

You automate contrarian investing for paper trading by invoking a master trading orchestrator during scheduled ticks, which automatically runs the mean reversion strategy against your configured correlated stock basket to place small buy orders.

What guardrails prevent overexposure when algorithmic trading mean reversion buy signals?

Algorithmic trading mean reversion guardrails include a 50-day moving average downtrend filter to avoid falling knives, a rebuy throttle to prevent consecutive overexposure, and cash balance validation before order placement.

Does mean reversion algorithmic trading work with Alpaca for paper trading?

Mean reversion algorithmic trading integrates with Alpaca paper trading workflows by operating as a sub-skill called by a master trading orchestrator during scheduled trading ticks to validate cash balances and place automated orders.

Why avoid buying stocks in a confirmed downtrend for mean reversion strategies?

Avoid buying stocks in confirmed downtrends for mean reversion strategies because a 50-day moving average filter prevents catching falling knives, ensuring the stock is not in a sustained downward trend before placing a contrarian buy order.