Mean reversion assumes that a price far from its average tends to come back. Scripts measure "far" with bands, z-scores or oscillator readings and signal a fade of the move.
The approach works in ranges and suffers in strong trends, where a stretched price can keep stretching. Look for a trend filter or a firm stop in any mean reversion strategy.
71 of these 657 scripts are marked Repaints, or read higher-timeframe data with lookahead on.
Before You Use One
Check what happens in a strong trend.
Make sure the strategy has a stop-loss.
Test it on more than one market and period.
Mean reversion: Indicators, Strategies and Libraries
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds
This indicator combines Bollinger Bands, RSI, Stochastic RSI, and volume spike detection to identify mean-reversion conditions during range-bound market regimes. It calculates Bollinger Band width to identify low-volatility states and triggers buy or sell sign
This strategy builds a spot grid between user-set high and low prices and draws it on the price chart. It splits that range into ten levels and places up to five long limit orders at the lower levels, sizing each from current equity. Orders already below price
This Pine Script indicator overlays institutional liquidity levels on the price chart. It identifies order block levels using pivot highs and lows, then draws mean reversion lines from the 20 and 50 period simple moving averages, a volatility range midpoint pr
Peak Reversal v3 identifies potential mean-reversion points by plotting configurable Keltner Channels alongside a squeeze detector directly on the price chart. It detects momentum extremes when candles cross or trade completely outside the inner or outer chann
3hr Stoch is a short-only trading strategy based on a smoothed Stochastic Oscillator. It calculates the %K and %D lines using configurable period and smoothing settings. The strategy enters a short position when the %K line crosses below the %D line while drop
Kalman Percentile Bands plots a volatility-adaptive Kalman mean along with three empirical percentile bands on each side of the price chart. It calculates a local-level Kalman filter as the fair value mean, normalizes price deviations by an EWMA of volatility,
Markov Strategy is a mean-reversion quantitative strategy inspired by streak-based Markov chain analysis. Applied directly to the price chart, it monitors price action for consecutive downward closes. The strategy enters a long position after detecting six con
This strategy plots Bollinger Bands on the price chart using a simple moving average and a standard-deviation multiplier. It enters long when close crosses above the lower band while still below the basis, and short when close crosses under the upper band whil
This indicator plots standard Bollinger Bands and identifies potential mean-reversion setup signals directly on the main price chart. A bullish signal triggers when a bullish candlestick follows a bearish candlestick while both consecutive bars' lows drop belo
This strategy plots a simple moving average basis and upper and lower Bollinger bands on the price chart, with a fill between the bands. It also calculates RSI. It opens one long trade when RSI is above 25, price is at or below the lower band, and no position
This strategy calculates volume-weighted Relative Strength Index (RSI) values across multiple timeframes, specifically 15-minute and daily periods. It averages the resulting short- and long-term RSIs into an oscillator to identify extreme overbought and overso
This strategy enters one long trade when the bar low comes within a set point tolerance of the prior day's low and the close finishes above that level. Entries are allowed only inside a UTC session and are blocked after a Friday cutoff hour. It stays flat unti
This indicator implements Tom DeMark's TD Sequential methodology on the price chart to detect trend exhaustion and reversal zones. It counts the Setup phase of nine consecutive bars comparing closes to four bars prior, tracks setup perfection, and advances int
This strategy automates dollar-cost averaging entries based on multi-timeframe Bollinger Bands and mean reversion logic. It calculates an exponential moving average and standard deviation bands using a user-defined timeframe. When the price crosses under the l
Greeffer's Scalping Indicator overlays higher-timeframe exponential moving averages, Bollinger Bands, and Donchian channels on the price chart. It flags a long when price touches the lower Donchian and lower band while the faster averages are not stacked beari
Lucid 100K is an automated evaluation strategy tailored for micro futures contracts such as MES, MGC, and MNQ on lower timeframes. It operates a two-phase state machine that moves from an initial risk-averse lock-in phase to an expanded payout phase once targe
This strategy enters long when a series labeled ADX is above a threshold and RSI is below 40, and enters short when that series is above the threshold and RSI is above 60. Both series are calculated with the RSI function, so the trend filter is not a true ADX.
This indicator calculates standard Bollinger Bands using a simple moving average and standard deviation multiplier. Instead of plotting continuous band lines, it evaluates whether the current price trades within a configurable threshold distance of the band bo
This strategy simulates Dollar Cost Averaging (DCA) trading bot behavior on the chart. It triggers an initial entry when the RSI drops below a specified oversold limit and price is under a maximum price cap. As price falls, it calculates simulated safety order
This strategy plots Bollinger Bands on the price chart and enters long only when flat. It buys on a strong bullish close above the middle band or on a small-body pullback that tags the middle band with a long lower wick. The stop sits below the signal bar by a
Medallion Cipher is a separate-pane indicator that combines a four-state hidden Markov model (bull, bear, range, and crisis) with weighted confluence signals. It can include mean reversion, trend, session timing, pattern matching, Hurst exponent, Shannon entro
Mean Reversion T is a dual-engine intraday indicator designed for 15-minute charts to detect mean-reversion and shock-reversal trading opportunities. It calculates Z-score price deviations from a moving average mean alongside regime scores across 15-minute and
The Buy/Sell Position Strategy combines a long-term Exponential Moving Average (EMA) with a short-term Relative Strength Index (RSI) to capture pullbacks in an uptrend. It enters a long position on the price chart when the price is above the EMA filter and the
This strategy calculates standard Bollinger Bands and Average True Range to implement a basic mean-reversion system. It opens long positions when price drops below the lower band and short positions when price pierces above the upper band. Open trades are exit
DP2 is a price-chart strategy that looks for a short dump between the chosen from and to prices, optionally requiring a break of a multi-day low while ignoring moves larger than a dump cap. It can enter through classic, two-close, break-and-retest, ATR-stop, a
This strategy plots Bollinger Bands on the price chart and trades a long-only mean-reversion idea. It enters when the close is below the lower band, or when the low touches that band if Touch mode is selected, and only while flat. With the opposite-band exit e
This strategy plots RSI and Bollinger Bands on the price chart. It calculates the 14-period RSI and 4-period RSI to detect overbought and oversold conditions. The strategy enters short positions when the RSI crosses above 70 and long positions when it falls be
This indicator plots entry signals and moving average lines for three Fibonacci-period strategies directly on the price chart: Momentum Breakout, Mean Reversion, and Fibonacci Retracement. Each strategy uses combinations of Fibonacci-length moving averages (su
This strategy opens a long base order and preplaces up to seven limit safety orders below entry, increasing size by a volume scale as price falls. It recalculates an average entry and closes the whole position when price reaches a take-profit percentage above
This strategy plots Bollinger bands and a simple moving average on the price chart. It opens a short when price crosses above the upper band while below the average, and a long when price crosses below the lower band while above the average. Entries are allowe
This strategy combines Relative Strength Index momentum signals with standard deviation dynamic thresholds to identify trade entries. Long orders execute when RSI drops below 37 while price stays above the lower dynamic boundary. Short orders trigger when RSI
BB RSI Strategy combines Bollinger Bands, RSI, and multiple simple moving averages directly on the main price chart. It enters long positions when price drops below the lower Bollinger Band while RSI is below a set limit, and enters short positions when price
ATR% Multiple from MA measures price extension relative to a moving average, expressed in multiples of Average True Range percentage. It calculates ATR as a percentage of close, evaluates the percentage distance between the price and its moving average, and no
This indicator measures how far price sits from a simple moving average, expressed as a percentage, then smooths that difference and plots it as an area in a separate pane. Green marks a positive deviation and red a negative one, so the series acts as a direct
The ATR Reversion System is a long-only mean-reversion strategy that plots ATR bands around a short-term EMA (20) and a long-term EMA (200) filter on the price chart. It signals entries by checking if the close is below the bottom ATR band and above the long E
VWAP Percent Distance calculates and plots the relative percentage difference between the closing price and the Volume Weighted Average Price (VWAP). Designed as a mean-reversion tool, it helps traders measure how far price has stretched from VWAP in percentag
This strategy builds a spot grid on the price chart from a user-set upper price and a percentage spacing. It calculates ten descending levels, plots the upper and lower bounds, and allows up to ten stacked entries sized as a percentage of equity. Orders are pr
A dollar-cost averaging strategy template designed to simulate algorithmic DCA trading bots. It initiates a base order immediately or based on indicator inputs, then scales into positions with safety orders as price deviates against the entry, applying configu
A price-chart indicator for leveraged turbo and mini products on stocks, built on the daily 14-period RSI. It computes the price at which today's close would take the daily RSI below the oversold level, using the previous day's averages, and works on intraday
An overlay for same-day expiry credit spreads on the S&P 500 index that reproduces signals from the author's separate backend. It watches an opening observation window, then flags directional entries when stochastic, RSI, trend, a VWAP alignment gate and a con
A Pine v6 indicator that looks for a dip followed by confirming candles. A long setup is an oversold red flush followed by green candles, and a short setup is an overbought green move followed by red candles. A composite score from RSI depth, range against ATR
A long-only dip signal indicator that combines a 200-bar Bollinger Band filter with MACD crossovers. A buy marker appears when price has touched the lower band and, by default, still closes below the midline, then a standard or Impulse MACD crossover confirms.
A mean reversion strategy that buys when price dips below the lower Bollinger Band while Stochastic RSI is oversold and crosses up, and sells short on the mirror setup at the upper band. Entries are skipped when ADX is above a maximum, to avoid strong trends.
A long-only daily strategy for E-mini S&P futures. It enters long when the 200-period SMA is rising, the candle is bearish and the whole bar sits below the 5-period SMA, and it closes the position when price closes above the 5-period SMA. Size is a fixed one c
A long-only strategy for short-term crypto trading that combines Bollinger Bands, RSI, a 9-period EMA, a 21-period SMA and a Fibonacci window covering about ten minutes of bars. It sizes positions as a percentage of equity and can require a minimum gain before
Sequential Countdown is an overlay indicator that writes a 9-13 sequential count on the price chart. It plots buy setup numbers below bars and sell numbers above them, marking a perfected nine differently from an unperfected nine, then draws countdown numbers
Third-party code. ForexR lists open-source Pine scripts from GitHub; it did not write, test or endorse them, and their summaries are generated automatically from each script's code and README. Indicators describe the past, and a strategy's backtest can look better than live trading. Check a script on a demo account before you rely on it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.
Learn to Use Pine Scripts
Free, plain-English guides: add a script to TradingView, read what it does, test it and avoid the common traps.