Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 6)

Open-source Pine scripts that bet on a stretched price returning to its average: band fades, oscillator extremes and statistical tools.

Pine scripts657
Code shown here317open licence
Updated in a year411
No repaint flag586

Mean reversion: Indicators, Strategies and Libraries

AutoCorrelation Function

by Anderson-ALGO
9 stars

This indicator calculates sample autocorrelation across multiple lag intervals for a selected price series. It computes correlation values over a user-specified lookback period using raw prices, log returns, absolute log returns, or squared log returns. Plotte

Indicator v4 TrendMean reversion
Updated 5 years ago · None stated GitHub repository of AutoCorrelation Function

Bollinger Bands

by piecioshka
2 stars

This indicator plots standard Bollinger Bands directly on the price chart using a simple moving average and standard deviation bounds. It displays filled background channels between the center moving average and the outer bands. Optional mean-reversion signal

Indicator v6 Volatility & bandsTrend
Updated 11 days ago · MIT GitHub repository of Bollinger Bands
2 stars

This mean-reversion trading strategy targets XAUUSD during the Asian trading session. It generates buy signals when price touches the lower Bollinger Band and RSI is oversold, and sell signals when price reaches the upper band and RSI is overbought. Trades are

Strategy v6 Mean reversionSessions & time
Updated 4 months ago · None stated GitHub repository of XAUUSD Mean Reversion Strategy

Alpy Vix

by avatar-lavventura
2 stars

This strategy calculates a rolling volume-weighted average price and Chris Moody's Williams Vix Fix to detect market bottoms and oversold volatility spikes. It plots in a separate pane and colors chart bars based on filtered exhaustion criteria and price actio

Strategy v5 Volatility & bandsMean reversion Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Vix

A strategy that classifies each bar as bull or bear trend, bull or bear expansion, chop or neutral using EMA slope, ADX and an ATR ratio, with an optional higher timeframe EMA bias. Depending on the regime it uses trend pullback entries, expansion breakout ent

Strategy v6 TrendBreakout Repaints
Updated 7 days ago · GPL-3.0 GitHub repository of Adaptive Market Regime Hierarchy Strategy v1

A Pine v6 strategy for crypto charts that looks for an RSI oversold setup together with a Fibonacci-spaced Bollinger Band setup, then waits for a reclaim as confirmation. Optional filters include a trend moving average on the chart and a higher timeframe, a vo

Strategy v6 Mean reversionOscillators & momentum
Updated 11 days ago · MIT GitHub repository of Crypto TA Pro RSI + Fibonacci BB Regime
1 stars

A long-only strategy template meant to send webhook alerts to an external bot. It enters on a fast and slow EMA cross with a volume surge while RSI is below the overbought level, or on an oversold RSI at the lower Bollinger Band with a volume surge. Each entry

Strategy v5 Oscillators & momentumMean reversion
Updated 6 weeks ago · None stated GitHub repository of Algo Bot Signal Generator

Dynamic MAs ZSCORE

by vedkanani123
1 stars

A separate-pane indicator that takes a selectable moving average of price, converts it to a Z-score over a lookback, and draws it against dynamic standard deviation bands with separate positive and negative multipliers. It can be read as a trend-following sign

Indicator v6 Oscillators & momentumMean reversion
Updated 2 months ago · None stated GitHub repository of Dynamic MAs ZSCORE

BVortex XAUUSD 1H

by Alberto082544
1 stars

This strategy trades XAUUSD on the one-hour chart. It builds a scaled Vortex oscillator from directional movement and flags bars that leave an upper or lower extreme with a matching candle. Entries also need ADX at or above a set minimum and a swing-pivot tren

Strategy v6 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of BVortex XAUUSD 1H

QUANT-OMEGA Strategy

by princeleuel-code
1 stars

A strategy version of the QUANT-OMEGA regime and ensemble signal. It classifies the market with ADX and ATR, scores trend, mean-reversion and breakout signals into a confidence value, and enters only above set thresholds. Stops and targets are ATR multiples. P

Strategy v5 TrendMean reversion
Updated 5 months ago · None stated GitHub repository of QUANT-OMEGA Strategy
1 stars

A futures strategy for 30-minute charts that fades extreme moves away from a daily-reset VWAP. It looks for price beyond a configurable number of standard deviations from VWAP, a short RSI in oversold or overbought territory, and an ADX reading below a maximum

Strategy v6 Mean reversionSupport & resistance
Updated 6 months ago · None stated GitHub repository of AlgoBot VWAP Mean Reversion Strategy

Estimates the Hurst exponent with detrended fluctuation analysis on log returns, indicating whether recent price behaviour leans toward trending or mean reverting around a 0.5 mid line. Inputs set the sample size, base and maximum scales, an optional smoothing

Indicator v5 TrendMean reversion
Updated 6 months ago · None stated GitHub repository of Hurst Exponent - Detrended Fluctuation Analysis

Trend-Filtered Reversal

by caizongxun
1 stars

A separate-pane indicator for counter-trend reversal setups that are filtered by a baseline EMA trend. A bearish setup needs price at a wide upper Bollinger Band, high volume or an overbought RSI, and a rejection wick; the bullish setup mirrors this. In a stro

Indicator v5 Mean reversionVolatility & bands
Updated 8 months ago · MIT GitHub repository of Trend-Filtered Reversal
1 stars

An overlay that finds pivot highs and lows over an adjustable lookback, stores them, and tries to draw blue trend lines between consecutive pivots. It then marks Buy or Sell labels when a line has been touched within one percent for the chosen number of recent

Indicator v5 Support & resistanceMean reversion
Updated 2 years ago · None stated GitHub repository of Custom Trend Line Indicator
1 stars

This long-only strategy buys when a short 3-period RSI crosses back above an oversold level of 35, provided the 14-period RSI is above 40 and price is above a 150-period EMA. It closes the position when price crosses under a 9-period EMA or falls below an 89-p

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of RSI 14 and 3 Mean Reversion Strategy
1 stars

An indicator on the price chart that shades the background green when a possible dip bottom forms. It looks for RSI turning up from a local low while the earlier RSI reading sits below a buy threshold, combined with MACD either flattening its decline or turnin

Indicator v4 Oscillators & momentumMean reversion
Updated 4 years ago · None stated GitHub repository of Binance Buy The Dip
330 stars

This strategy divides a fixed price range between an upper and a lower limit into equally spaced grid levels and plots them on the price chart. It marks a buy when price crosses down through a grid and a sell when price crosses up through a grid, using either

Strategy v5 Support & resistanceMean reversion Repaints
Updated 2 months ago · None stated GitHub repository of Grid Bot Simulator [Alorse]

3C QFL Mean Reversal

by hasnocool
106 stars

3C QFL Mean Reversal is a strategy based on the Quickfinger Luc (QFL) trading methodology. It identifies breakdown buying opportunities below established price base levels and enters mean-reversion trades. The strategy includes multi-safety order DCA scaling,

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3C QFL Mean Reversal

Greeffer BB Strategy

by SammyEnigma
18 stars

Greeffer BB Strategy is a volatility-based mean reversion system that calculates Bollinger Bands using price and standard deviation. It generates long and short signals when price crosses the upper and lower bands respectively. Entries are filtered with RSI(14

Strategy v4 Volatility & bandsOscillators & momentum Repaints
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy
4 stars

This strategy is a multi-strategy backtesting engine that draws entries and exits on the price chart. The user picks one approach, including Connors RSI-2, z-score mean reversion, EMA and MACD momentum, Bollinger squeeze, VWAP reversion, Supertrend, Ichimoku,

Strategy v6 Oscillators & momentumMean reversion Repaints
Updated yesterday · None stated GitHub repository of Simpleton v0.01 CURSOR [Elton Engine]
4 stars

This intraday strategy executes trades using dual EMA crossovers and RSI mean-reversion near VWAP. Designed primarily for 5-minute index futures charts like ES and MES, it offers momentum entries on fast and slow EMA crosses confirmed by VWAP, as well as count

Strategy v6 Moving averagesOscillators & momentum
Updated 2 days ago · None stated GitHub repository of Ultimate Combo v2 (Relaxed)
4 stars

This long-only strategy identifies mean-reversion dip opportunities within established uptrends on daily charts. It opens a position when price is trading above a simple moving average and the Relative Strength Index (RSI) crosses back above a specified overso

Strategy v6 Mean reversionOscillators & momentum
Updated 5 months ago · None stated GitHub repository of RSI Mean Reversion (Long Only)

This strategy buys after a sharp down bar with a long lower wick. It opens one long when the lower wick exceeds the candle body by the pin-bar ratio and the one-bar close change falls past the decline threshold. Size defaults to the full account equity. While

Strategy v6 Candlestick patternsMean reversion Repaints
Updated 10 months ago · Apache-2.0 GitHub repository of youtube布欧量化策略-接针策略

Strategy Examples

by danielbodnar
2 stars

Strategy Examples is a Pine Script strategy template demonstrating multiple classic technical trading approaches directly on the price chart. It incorporates a moving average crossover system using SMA or EMA, an RSI mean reversion model operating on overbough

Strategy v6 Moving averagesOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Strategy Examples
1 stars

An overlay for the S&P 500 index that measures the opening range over an observation window, classifies the day as volatile or not by comparing that range with the daily ATR, and projects high and low boundaries for the session. Reversal signal triangles appea

Indicator v5 Sessions & timeMean reversion
Updated yesterday · None stated GitHub repository of ZeroDTE Range Predictor

Market-Neutral Pairs

by nvolpe2007-cell
1 stars

Calculates a z-score of the log price ratio between two crypto pairs, chosen from three Kraken combinations, and shows it in a separate pane. Over a lookback of 168 bars it flags entry when the absolute z-score passes 2, exit when it falls to 0.5, a stop at 3.

Indicator v6 Mean reversion
Updated yesterday · None stated GitHub repository of Market-Neutral Pairs

Candlestick Patterns

by pineforge-4pass
1 stars

This strategy detects bullish and bearish engulfing candles, hammers, shooting stars, and morning stars from current and prior bar bodies. It enters long when a bullish pattern occurs while price is below a simple moving average, and short when a bearish patte

Strategy v6 Candlestick patternsTrend Repaints
Updated 6 days ago · Apache-2.0 GitHub repository of Candlestick Patterns
1 stars

A counter-trend strategy that fades price when it reaches a Pivot Point SuperTrend band, selling into upward stretches and buying into downward ones. Signals can fire on a touch of the band, on a regime flip, or both. Optional filters use the opening range of

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · None stated GitHub repository of Contra Pivot SuperTrend Fade
1 stars

An overlay that trades pullbacks to VWAP in the direction of a higher-timeframe EMA trend. In an uptrend with VWAP rising it signals a buy when price dips back to VWAP, and in a downtrend a sell when price rallies to it. A stricter grade needs price to have st

Indicator v6 Mean reversionTrend
Updated 4 months ago · None stated GitHub repository of VWAP Pullback A+ Dip Scanner

Kalman Filter

by Teerth1
1 stars

Applies a Kalman filter to the chosen price source to produce a smoothed estimate of the underlying price level, drawn on the main chart. Process noise and measurement noise inputs control how quickly the line adapts versus how smooth it is. Optional uncertain

Indicator v5 TrendMean reversion
Updated 6 months ago · None stated GitHub repository of Kalman Filter

BTCDOM Strategy

by AlanGuo
1 stars

A long-only strategy that reads Bitcoin daily closes through request.security and compares them with a 30-day simple moving average widened by a slippage percentage. It buys when Bitcoin falls below the lower offset line and closes the position when Bitcoin ri

Strategy v6 Mean reversionMoving averages
Updated 7 months ago · None stated GitHub repository of BTCDOM Strategy
1 stars

An indicator for four-hour charts that builds a rolling VWAP with standard deviation bands. A long signal appears when one bar closes below the lower band and the next closes back above it, and the reverse for shorts. Filters skip trades when ATR volatility is

Indicator v6 Mean reversionVolatility & bands
Updated 7 months ago · None stated GitHub repository of V21 VWAP Mean Reversion
1 stars

This intraday strategy identifies mean-reversion fade setups around the previous day's high and low (PDH/PDL). Operating within a configurable morning session window, it seeks rejection setups confirmed by volume spikes above an average threshold. Trades use s

Strategy v6 Mean reversionSupport & resistance
Updated 7 months ago · MIT GitHub repository of PDH/PDL Mean Reversion Fade
1 stars

MACD Divergence - Reversal Hunter detects regular and hidden divergences between price action and the MACD line using pivot points. It generates buy signals on bullish divergences and sell signals on bearish divergences, with optional RSI filter for overbought

Strategy v5 DivergenceOscillators & momentum
Updated 7 months ago · None stated GitHub repository of MACD Divergence - Reversal Hunter

P/E BANDs

by lumduan
1 stars

An indicator in a separate pane that divides price by trailing twelve month diluted earnings per share to get a price to earnings series, then wraps it in Bollinger-style bands. The basis can be an SMA, EMA, SMMA, WMA or VWMA of the chosen length, with upper a

Indicator v6 Volatility & bandsMean reversion
Updated 1 year ago · None stated GitHub repository of P/E BANDs

Stochastic RSI MTF

by kritarth2121
1 stars

This strategy computes a smoothed Stochastic RSI and compares it with a signal line taken from the four-hour timeframe. It goes long when the four-hour reading is above its signal, the chart reading crosses up through 30 and price is above an exit EMA. It goes

Strategy v5 Oscillators & momentumMean reversion
Updated 2 years ago · None stated GitHub repository of Stochastic RSI MTF

Greeffer BB Strategy

by SammyEnigma
18 stars

Greeffer BB Strategy is a mean-reversion strategy that combines Bollinger Bands with the Relative Strength Index. It enters long positions when price crosses below the lower band with RSI above 30, and enters short positions when price crosses above the upper

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy

Simpleton v0.01_Claude is a multi-strategy trading engine designed for crypto markets that plots directly on the main price chart. It allows traders to execute individual strategies or combine signals into a multi-consensus model from up to twelve systems, inc

Strategy v6 TrendOscillators & momentum
Updated yesterday · None stated GitHub repository of Simpleton v0.01_Claude [12-Strategy Engine]

RSI Mean Reversion

by latentwill
4 stars

This strategy calculates a short-term Relative Strength Index (RSI) oscillator to identify mean-reverting conditions. It triggers a long entry when the RSI drops below a customizable oversold threshold and a short entry when it rises above an overbought level.

Strategy v5 Oscillators & momentumMean reversion
Updated 7 days ago · None stated GitHub repository of RSI Mean Reversion
4 stars

This long-only strategy overlays a slow simple moving average and Bollinger bands on the price chart and uses RSI as a filter. It enters when the close is at or below the lower band and RSI is at or below the oversold input, and it closes when the close is at

Strategy v6 Mean reversionVolatility & bands
Updated 5 months ago · None stated GitHub repository of Tetrad Elektro BB (Long Only)

This strategy combines Williams Vix Fix calculations with Stochastic and RSI indicators to identify potential market bottoms. It calculates synthetic volatility using standard deviation Bollinger Bands and percentile thresholds on the Williams Vix Fix. Long en

Strategy v4 Volatility & bandsOscillators & momentum
Updated 6 years ago · Apache-2.0 GitHub repository of Vix FIX / StochRSI Strategy
1 stars

An indicator that reads open, high, low, close and volume for a chosen symbol from a Pine Seeds repository, set by owner and repository inputs, and plots the seed close on the chart. It adds a simple moving average of the seed close with optional one standard

Indicator v6 Mean reversion
Updated yesterday · None stated GitHub repository of GitHub CSV Seed (Daily Refresh)

ZeroDTE Wave v1

by xynkro
1 stars

An overlay that marks reversal entries and exits for same-day index option trades on five-minute bars. Entries need a stochastic reversal cross, an EMA trend filter, a cooldown and a time window, and must pass a confluence score, a VIX stand-aside gate, an opt

Indicator v5 Mean reversionSessions & time
Updated yesterday · None stated GitHub repository of ZeroDTE Wave v1
1 stars

A signal-only indicator that looks for exhaustion after a run of consecutive same-colour candles ending in a doji. A top needs bullish candles with RSI overbought and a new high versus recent bars; a bottom mirrors this. A separate news mode flags unusually la

Indicator v6 Mean reversionCandlestick patterns
Updated 2 weeks ago · None stated GitHub repository of Top Bottom Reversal
1 stars

This long-only strategy buys short-term oversold dips only inside a strong uptrend: price above a rising 200-period SMA and within a set percentage of its one-year high. Entry needs a two-period RSI below a threshold, then an up-close, and volatility below an

Strategy v6 Mean reversionTrend
Updated 2 months ago · Custom licence GitHub repository of Regime-Gated Dip Reversion
1 stars

A strategy that rests a limit order at the session VWAP when a higher-timeframe 50 and 100 EMA stack shows an uptrend, VWAP is rising and price is above it, with the mirror image for shorts. The stop is an ATR multiple beyond VWAP and the target is a fixed rew

Strategy v6 Mean reversionTrend
Updated 4 months ago · None stated GitHub repository of VWAP Pullback Strategy MNQ

More Pine Script Categories

Browse the whole Pine Library

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.

  1. 1Using this librarySearch, filters, licences and what the badges mean.
  2. 2Add a script to TradingViewCopy, paste into the Pine Editor, save and add to chart.
  3. 3Indicators, strategies and librariesWhat each type does and how to tell them apart.
  4. 4Spot a script that repaintsWhy some signals change after the bar closes.
  5. 5Backtest a strategyStrategy Tester settings that keep results honest.
  6. 6Send alerts to MT4 or MT5From a TradingView alert to an order in MetaTrader.
  7. 7What Pine Script isThe language, what it can and cannot do, and where to start.
  8. 8Write your first indicatorA complete script, line by line, in the Pine Editor.
  9. 9Read a script before you trust itA routine for checking inputs, logic and red flags.
  10. 10Edit a script safelyChange colours and lengths, add a filter or an alert.
  11. 11Pine Script alertsalertcondition(), alert(), placeholders and webhooks.
  12. 12Build a crossover strategyAn EMA cross strategy with an ATR stop, ready to test.

Trade Your Charts With a Regulated Broker

Compare regulated brokers on platforms, spreads, minimum deposit and leverage.

Compare brokers