← Back to Home
Trading Strategy
πŸ”„

Mean Reversion Strategy

Buy the dip, sell the rip β€” profit from price returning to average.

Start Automating Free β†’

Want to automate this strategy? Try auto-Trading free β€” no credit card required.

Mean Reversion Strategy chart

Overview

What is Mean Reversion Strategy?

Mean reversion is based on the statistical observation that extreme price deviations from a long-run average tend to be temporary. Just as a stretched rubber band snaps back, overextended prices tend to return to their mean over time. This principle is especially reliable in markets that exhibit stationary or co-integrated behaviour.

The strategy involves identifying when price has moved significantly away from a measure of central tendency β€” such as a moving average, the VWAP, or a regression line β€” and taking a position anticipating the return. Common entry triggers include price crossing more than two standard deviations outside a Bollinger Band, an RSI reading above 70 or below 30, or a Z-score exceeding Β±2 on a rolling regression.

Risk management is critical in mean reversion: the strategy can suffer large losses if a trending market extends far beyond expected bounds. Position sizing must account for the possibility of further extension before reversal. Traders often scale into positions as price moves further from the mean (pyramiding into a contrarian trade) and use wide stops to avoid premature exit.

Mean reversion works best in range-bound equity markets, currency pairs with long-term equilibrium rates, and in pair trading where two co-integrated assets temporarily diverge.

How It Works in auto-Trading

Automate It

auto-Trading implements mean reversion by monitoring the Z-score of price relative to a rolling mean and standard deviation. When the Z-score exceeds a configurable threshold (default Β±2.0), a counter-trend order is placed. The take-profit is set at the mean, and the stop-loss is set at a further standard deviation multiple to account for continued deviation.

Try Free β†’

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script strategy example for this page concept. Paste it into the TradingView Pine Editor, add it to your chart, and run it in the Strategy Tester.

//@version=6
strategy("Mean Reversion Strategy", overlay=true)
len = input.int(20, "BB Length")
mult = input.float(2.0, "Std Dev")
basis = ta.sma(close, len)

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript strategy example for this page concept. Open thinkorswim, create a custom strategy, paste the script, and apply it to your chart.

input length = 20;
input numDev = 2.0;
def mid = Average(close, length);
def up = mid + numDev * StDev(close, length);
def dn = mid - numDev * StDev(close, length);

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Mean Reversion Strategy?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free β†’

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators