# Mean Reversion Strategy

## What is Mean Reversion?

**"What goes up must come down"** - Profit from prices bouncing back to normal levels after moving too far.

### Core Principle

Prices naturally oscillate around an average value, creating predictable patterns that mean reversion strategies exploit. When prices move too far above their average, they become statistically likely to fall back toward the mean. Conversely, when prices drop too far below their average, they tend to rise back up. These extremes are typically temporary, as the average acts like a magnetic force pulling prices back to equilibrium.

### When It Works Best

**Ideal Conditions:** Range-bound markets, clear support and resistance levels, low trending volatility, oscillating price action.

**Avoid During:** Strong trends (up or down), breakouts and momentum moves, high volatility expansions, news-driven directional moves.

## Mean Reversion Indicators

### Bollinger Bands

**Structure:** Bollinger Bands consist of three lines that create a dynamic trading channel around price action. The middle band represents the 20-period moving average, which serves as the "mean" that prices tend to revert to. The upper band is positioned 2 standard deviations above this mean, while the lower band sits 2 standard deviations below it, creating a statistical framework for identifying when prices have moved too far from their average.

**Signals:**

| Signal                   | Meaning                 | Action                                 |
| ------------------------ | ----------------------- | -------------------------------------- |
| Price touches lower band | Oversold                | Enter long, expect bounce to middle    |
| Price touches upper band | Overbought              | Enter short, expect pullback to middle |
| Price returns to middle  | Mean reversion complete | Exit position                          |

### RSI for Mean Reversion

**Different from momentum usage:**

| Condition               | RSI Level                             | Action                   |
| ----------------------- | ------------------------------------- | ------------------------ |
| **Oversold Bounce**     | Drops below 30, then turns back above | Enter long               |
| **Overbought Pullback** | Rises above 70, then turns back below | Enter short or exit long |

### Moving Average Deviation

**How it works:** This simple yet effective method measures how far the current price has deviated from its moving average, then enters positions when the deviation becomes statistically significant. The strategy assumes that extreme deviations from the average are temporary and will correct themselves.

**Example:** When price drops 5% or more below the 20-day moving average, it signals an oversold condition where a bounce back toward the average is likely. Conversely, when price rises 5% or more above the 20-day moving average, it indicates an overbought condition where a pullback toward the average is expected.

## Pre-Built Mean Reversion Strategies

| Strategy                      | Logic                                                       | Parameters                             | Best For                                  |
| ----------------------------- | ----------------------------------------------------------- | -------------------------------------- | ----------------------------------------- |
| **Bollinger Band Bounce**     | Buy at lower band, sell at upper band, exit at middle       | BB:20, StdDev:2, TP:3%, SL:1.5%        | Range-bound markets, conservative traders |
| **RSI Extremes**              | Long when RSI<30 turning up, short when RSI>70 turning down | RSI:14, OB:70, OS:30, TP:2.5%, SL:1.5% | Oscillating markets, frequent trading     |
| **Support/Resistance Bounce** | Buy near support, sell near resistance                      | Lookback:50, TP:3%, SL:2%              | Clear ranges, patient traders             |

## Creating Custom Mean Reversion Strategy

### Step 1: Identify the "Mean"

**Choosing Your Baseline:** Select the appropriate average that best represents the "normal" price level for your chosen timeframe. Simple moving averages (SMA) provide equal weight to all periods, exponential moving averages (EMA) give more weight to recent prices, volume-weighted average price (VWAP) incorporates trading volume, and support/resistance midpoints use key technical levels.

**Period Selection Strategy:** Shorter periods (10-20) are more responsive to price changes but may generate more false signals. Medium periods (20-50) offer a balanced approach between responsiveness and reliability. Longer periods (50-200) provide smoother signals but may miss shorter-term opportunities. Choose based on your trading timeframe and risk tolerance.

### Step 2: Define "Extreme"

| Method          | Extreme Definition       |
| --------------- | ------------------------ |
| Bollinger Bands | 2 standard deviations    |
| Percentage      | 3-5% from moving average |
| RSI             | Below 30 or above 70     |
| ATR-based       | 1.5x Average True Range  |

### Step 3: Set Entry Rules

**Example:**

```
Enter Long When:
1. Price touches lower Bollinger Band OR
2. RSI < 30 AND
3. Price making higher low (bullish structure)

Confirmation required before entry
```

### Step 4: Define Exit Strategy

**Take profit options:** Exit when price returns to the middle band for mean reversion completion, use fixed percentage targets (2-3%) for consistent profit taking, target the opposite band for maximum reversion capture, or exit when RSI returns to 50 for momentum confirmation.

**Stop loss:**

* Slightly beyond band (e.g., 2% below lower band)
* Fixed percentage (1.5-2%)
* Recent swing low/high

## Strategy Comparison

| Approach         | Entry                          | TP | SL   | Timeframe | Pros                              | Cons                                  |
| ---------------- | ------------------------------ | -- | ---- | --------- | --------------------------------- | ------------------------------------- |
| **Aggressive**   | First touch of bands           | 2% | 1.5% | 5-15min   | Many opportunities, quick profits | More false signals, active monitoring |
| **Conservative** | Wait for reversal confirmation | 4% | 2%   | 4h-daily  | Higher win rate, less whipsaw     | Miss opportunities, hold longer       |

## Optimizing Mean Reversion Strategies

### Parameter Tuning

**Bollinger Bands:**

* Period: 10-50 (shorter = more signals)
* Std Dev: 1.5-3.0 (wider = fewer signals)

**RSI:**

* Period: 7-21 (shorter = more sensitive)
* Overbought: 65-80
* Oversold: 20-35

**Moving Average:**

* Shorter (10-20): More trades, more noise
* Longer (50-100): Fewer trades, more reliable

### Market Condition Adjustments

| Condition           | Adjustments                                                  |
| ------------------- | ------------------------------------------------------------ |
| **Tight Range**     | Tighter profit targets, smaller stops, more frequent trading |
| **Wide Range**      | Wider profit targets, larger stops, patience for extremes    |
| **Low Volatility**  | Bands contract, consider tighter parameters or pausing       |
| **High Volatility** | Bands expand, use wider stops, reduce position sizes         |

## Common Mean Reversion Mistakes

| Mistake                     | Problem                    | Solution                                       |
| --------------------------- | -------------------------- | ---------------------------------------------- |
| **Fighting Strong Trends**  | Catching "falling knife"   | Only trade in range-bound conditions           |
| **No Stop Losses**          | Averaging down on losers   | Always use stops, cut losses quickly           |
| **Profit Targets Too Wide** | Waiting for full reversion | Take profits at middle band or smaller targets |
| **Ignoring Fundamentals**   | Trading during news events | Avoid trading around major announcements       |

## Strategy Checklist

### Before Activation

* [ ] Market conditions are range-bound (not trending)
* [ ] Support and resistance levels are clear
* [ ] Indicator parameters set and tested
* [ ] Entry and exit rules clearly defined
* [ ] Position sizing appropriate (1-2% risk)
* [ ] Backtested in sideways market periods
* [ ] Paper traded successfully for 2+ weeks

### During Trading

* [ ] Monitor for trend breakouts
* [ ] Verify range is holding
* [ ] Check exits executing at targets
* [ ] Ensure stops working properly
* [ ] Track win rate vs expectations

## Performance Expectations

| Quality       | Win Rate | Profit Factor | Avg Win/Loss | Max Drawdown |
| ------------- | -------- | ------------- | ------------ | ------------ |
| **Good**      | 55-65%   | 1.3-1.8       | 1.5-2x       | 10-15%       |
| **Excellent** | 65-75%   | 1.8-2.5       | 2x+          | <10%         |

### Market Dependency

| Market Type     | Performance | Win Rate | Notes                       |
| --------------- | ----------- | -------- | --------------------------- |
| **Range-Bound** | Best        | Higher   | Consistent small wins       |
| **Trending**    | Losses      | Lower    | Important to pause strategy |
| **Mixed**       | Moderate    | 50-60%   | Critical to identify regime |

## Combining Mean Reversion with Momentum

### Multi-Strategy Approach

**Diversify strategy types:**

* 50% mean reversion (ranges)
* 50% momentum (trends)
* Adapt strategy allocation to changing market conditions

**Benefits:** Mean reversion strategies provide performance in all market conditions, deliver smoother equity curves with less volatility, and achieve reduced drawdowns compared to trend-following approaches.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://quantsedge.gitbook.io/quantsedge-docs/trading-strategies/strategy-mean-reversion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
