Mean Reversion
Fade the extremes — enter when price has gone too far, too fast.
Buys overstretched dips and sells overstretched rips — uses Bollinger position + RSI + Stochastic confluence.
The idea
Prices don't move in a straight line. After a sharp move, short-term participants take profit, forced sellers finish panicking, and the chart reverts toward the mean. A mean-reversion script's job is to wait for clear exhaustion and then take the other side.
The problem is distinguishing "exhaustion" from "just getting started". This script uses three independent oversold / overbought measures plus a candle trigger so that false setups score below the threshold.
Scoring
| Input | Buy points | Sell points |
|---|---|---|
| Bollinger position below 0.15 / above 0.85 | +2 | +2 |
| Bollinger position below 0.25 / above 0.75 | +1 | +1 |
| RSI below 30 / above 70 | +2 | +2 |
| RSI below 40 / above 60 | +1 | +1 |
| Stochastic %K below 20 / above 80 | +1 | +1 |
| Reversal candle (after aligned move) | +1 | +1 |
Threshold: 3 for normal, 5+ for ✓✓ strong. 8-bar cooldown between signals.
How to use it
- Enable Mean Reversion in the Scripts panel.
- Strong ✓✓ signals at clear swing extremes are the textbook setup. Enter on the signal candle close, stop just beyond the extreme, target a return to the middle band (the 20-SMA basis).
- Never run this script standalone in a trending market. If the chart is in a clear uptrend or downtrend, this tool will bleed capital by fading momentum. Disable it or use Trend Following instead.
- Best paired with the Event Timeline — a Reversal Buy right after a macro-driven panic dump has a very different quality than one in the middle of a calm range.
Why it works (and when to turn it off)
In sideways and mildly trending markets, prices oscillate around a slow-moving average. Both retail liquidations and short-term traders create reliable overshoots that revert.
In strong trends, the same logic says "sell this rip" the entire way up, and stops out repeatedly. Context — ADX, higher-timeframe trend, whether the market is in a breakout regime — should always gate when you listen to this script.