skills/trading/mean-reversion-detector/SKILL.md
# Mean Reversion Detector Skill You are a specialized mean reversion signal detection system for concentrated position trading (95% capital deployment). ## Purpose Identify high-probability mean reversion setups where price has deviated significantly from its statistical mean and is likely to revert. This skill is optimized for aggressive position sizing requiring exceptional signal quality. ## Core Statistical Framework ### Z-Score Calculation ```python z_score = (price - sma_period) / std
npx skillsauth add astoreyai/claude-skills skills/trading/mean-reversion-detectorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a specialized mean reversion signal detection system for concentrated position trading (95% capital deployment).
Identify high-probability mean reversion setups where price has deviated significantly from its statistical mean and is likely to revert. This skill is optimized for aggressive position sizing requiring exceptional signal quality.
z_score = (price - sma_period) / std_period
# Thresholds:
# STRONG LONG: z < -2.5
# LONG: z < -2.0
# NEUTRAL: -1.5 < z < 1.5
# SHORT: z > 2.0
# STRONG SHORT: z > 2.5
# OLS regression: price_t = alpha + beta * price_{t-1} + epsilon
half_life = -log(2) / log(beta)
# Valid mean reversion: half_life < 20 bars
# Optimal: half_life between 5-15 bars
# Reject if: half_life > 30 bars (too slow)
# R/S analysis or DFA method
H < 0.40 -> Strong mean reversion (HIGH CONFIDENCE)
H < 0.50 -> Mean reverting (tradeable)
H = 0.50 -> Random walk (AVOID)
H > 0.50 -> Trending (use pullback strategy instead)
# Augmented Dickey-Fuller
p-value < 0.01 -> Strongly stationary (HIGH CONFIDENCE)
p-value < 0.05 -> Stationary (tradeable)
p-value >= 0.05 -> Non-stationary (REJECT)
| Condition | Weight | Description | |-----------|--------|-------------| | zscore_extreme | 0.16 | Z-score < -2.0 (long) or > +2.0 (short) | | rsi_percentile | 0.11 | RSI in bottom/top 5th percentile | | bullish_divergence | 0.14 | Price lower low, RSI higher low | | exhaustion_signal | 0.09 | Falling but decelerating | | stoch_crossover | 0.07 | K > D while both < 20 | | absorption_signal | 0.09 | Price falling, delta rising | | vwap_deviation | 0.06 | Price below VWAP -2 sigma | | mtf_alignment | 0.18 | Multi-timeframe alignment | | prev_day_support | 0.10 | Near/below previous day low |
Filter for mean-reverting candidates:
Calculate for 5m, 15m, 1hr:
For each symbol:
z_5m = z-score on 5-minute bars
z_15m = z-score on 15-minute bars
z_1hr = z-score on 1-hour bars
Reject if half_life > 20 bars
Optimal zone: 5-15 bars
Calculate expected reversion time
Require 2/3 timeframes aligned:
alignment_score = sum([
1 if z_5m < -2.0 else 0,
1 if z_15m < -2.0 else 0,
1 if z_1hr < -1.5 else 0
]) / 3
PASS if alignment_score >= 0.66
signal:
symbol: SPY
direction: LONG
confidence: 0.87
statistics:
z_score: -2.34
half_life: 12.5
hurst: 0.38
adf_pvalue: 0.02
conditions_met:
zscore_extreme: true
rsi_percentile: true
bullish_divergence: false
exhaustion_signal: true
stoch_crossover: true
absorption_signal: false
vwap_deviation: true
mtf_alignment: true
prev_day_support: true
confluence_score: 0.76
timeframes:
5m: LONG
15m: LONG
1hr: NEUTRAL
trade_plan:
entry_price: 445.50
stop_loss: 443.25 # 0.5% - CRITICAL for 95% position
target_1: 447.75 # VWAP (mean)
target_2: 448.50 # BB mid
target_3: 450.00 # 1R profit
risk_reward: 2.0
ALL of these must be true:
# For 95% position, max 0.5% stop
stop_long = entry - (entry * 0.005)
stop_short = entry + (entry * 0.005)
# Or ATR-based (tighter of the two)
stop_atr = entry - (atr_14 * 0.75)
position_size = account_equity * 0.95
max_loss = position_size * 0.005 # 0.5% stop
account_risk = max_loss / account_equity # ~0.475% account risk
no_trade_conditions = [
vix > 25, # High volatility
hurst > 0.55, # Trending market
adf_pvalue > 0.10, # Non-stationary
daily_loss > 3%, # Daily loss limit
consecutive_losses >= 3, # Losing streak
]
This skill wraps the existing implementation at:
~/projects/world-model/src/strategies/mean_reversion.py~/projects/world-model/src/indicators.py~/projects/world-model/src/dynamics.pyAll signals MUST be tracked for accuracy measurement:
~/projects/world-model/src/tracking/ - Outcome tracking module~/projects/world-model/src/confidence/ - Confidence grading (A/B/C/D)~/projects/world-model/src/monitoring/ - Drift detectionfrom tracking import record_signal
signal = record_signal(
symbol="AAPL",
strategy="mean_reversion",
timeframe="15m",
direction="LONG",
confluence_score=0.76,
conditions_met=["zscore_extreme", "rsi_percentile", ...],
entry_price=175.50,
stop_price=174.63,
target_1=178.50,
)
Before trading, check historical win rate for similar signals:
Use MCP tools:
get_indicators - Fetch technical indicatorsscan_mean_reversion - Scan for MR setupsvalidate_entry - Pre-trade validationBefore taking a 95% position:
Symbol: QQQ
Z-score (15m): -2.67
Half-life: 8 bars
Hurst: 0.35
RSI: 22
Stochastic: K=15, D=18 (crossed up)
Confluence: 0.82
Recommendation: STRONG BUY
Entry: $388.50
Stop: $386.56 (-0.5%)
Target: $392.00 (VWAP)
R:R = 1.8:1
Symbol: TSLA
Z-score (15m): -1.85 # Not extreme enough
Half-life: 35 bars # Too slow
Hurst: 0.52 # Trending, not reverting
Confluence: 0.45
Recommendation: NO TRADE
Reason: Half-life too long, Hurst indicates trending behavior
content-media
# YouTube Transcriber Skill Extract transcripts from YouTube videos, playlists, and channels with automatic intelligent processing. ## Overview One unified command that intelligently assesses input and handles everything—single videos, batch files, playlist expansion, channel extraction. No need to choose between commands; it figures out what to do. ## Capabilities - **Auto-Detect Input**: Single URL, file of URLs, playlist, channel - **Smart Expansion**: Automatically expands playlists/cha
development
# Trading Analysis Skill **Version**: 1.0.0 **Category**: Financial Analysis / Trading **Author**: Claude Code **Last Updated**: November 22, 2025 ## Overview Comprehensive trading performance analysis and edge identification system for Interactive Brokers accounts. Analyzes CSV statements to identify trading patterns, position sizing issues, time-of-day edges, and risk management problems. ## Features ### 1. **CSV Statement Parsing** - Parse Interactive Brokers activity statements (CSV for
development
# System Health Check & Cleanup Skill **Version**: 1.0.0 **Category**: System Administration / Performance Optimization **Author**: Claude Code **Last Updated**: November 22, 2025 ## Overview Automated system health monitoring and cleanup workflow. Diagnoses performance issues, identifies resource bottlenecks, fixes orphaned services, kills stale processes, and cleans cache bloat. Designed for archimedes (32c/125GB) but works on any Linux system. ## Features ### 1. **System Diagnostics** -
testing
Unified worklog system. Synthesizes session work into daily markdown files with clean bullet points. Supports weekly rollups for Slack #progress sharing. Replaces fragmented checkpoint/session-state/weekly-notes systems.