Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 8)

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

1 stars

The Detrending Net Distance Ratio indicator computes the difference between current close and close prices at ten different lookback periods ranging from seven to three hundred sixty bars. It sums the positive differences to create a net value and sums their a

Indicator v5 DivergenceMean reversion
Updated 3 years ago · None stated GitHub repository of Detrending Net Distance Ratio

DOT BTC Binance 1m

by tseitz
1 stars

This strategy trades the DOT/BTC pair on a one-minute chart. It plots the VWAP of the close and two offset VWAP bands on the price chart. It opens a long when the open is above the upper band and a short when the open is below the lower band, then closes those

Strategy v4 VolumeBreakout
Updated 4 years ago · None stated GitHub repository of DOT BTC Binance 1m
106 stars

A multi-timeframe Dollar Cost Averaging (DCA) trading strategy that combines signals from three RSI indicators, three CCI indicators, and Bollinger Bands. It places up to five weighted scale-in safety orders to lower the average entry price. The script offers

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of 3RSI 3CCI BB 5orders DCA Strategy+
53 stars

This strategy identifies long entry opportunities based on short-term price pullbacks below a major trend filter. It enters long when three consecutive lower closes occur below the 200-period simple moving average, followed by the current bar closing back abov

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of Ivan Scherman Pattern - TP/SL

RSI/BB 1minute Study

by SammyEnigma
18 stars

This strategy combines the Relative Strength Index with Bollinger Bands to generate mean-reversion entries. It plots the RSI oscillator and threshold lines in a separate pane, while calculating hidden Bollinger Bands and band width. Long entries trigger when R

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of RSI/BB 1minute Study

Variance Ratio Test

by Anderson-ALGO
9 stars

This indicator calculates the Variance Ratio Test statistic to evaluate random walk behavior across multiple sampling periods. It computes log returns, base period variance over a specified lookback window, and scaled multi-period variances to determine test Z

Indicator v4 Volatility & bandsMean reversion
Updated 5 years ago · None stated GitHub repository of Variance Ratio Test

WaveTrend with Crosses [LazyBear]

by avatar-lavventura
2 stars

This strategy calculates the WaveTrend oscillator using exponential moving averages of typical price and plots two signal lines alongside overbought and oversold thresholds in a separate pane. It enters long positions when the primary line crosses above the si

Strategy v4 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of WaveTrend with Crosses [LazyBear]
2 stars

This Pine Script indicator calculates Z-Score based bands for grid trading using a user-selectable moving average. It computes the MA from chosen type, length and source then derives upper and lower bands offset by stddevs. Grid ranges are set by min and max w

Indicator v6 Support & resistanceMean reversion Repaints
Updated 8 months ago · MIT GitHub repository of Grid Bot Z-Score [psyll]

RSI XO

by riegodavid-git
1 stars

A minimal overlay indicator that calculates an RSI and marks extremes directly on the price chart. A white O appears above a bar when the RSI is above the overbought level, and a white X appears below a bar when it is below the oversold level. RSI length, over

Indicator v6 Oscillators & momentumMean reversion
Updated 4 months ago · None stated GitHub repository of RSI XO

While Loop Counter

by Snappni
1 stars

This strategy sums the last len closing prices using a while loop then divides by len to obtain an average. It enters long when close exceeds the average and short when below. Positions close automatically on reversal. No stop loss is applied and entries occur

Strategy v6 Mean reversionTrend
Updated 4 months ago · MIT GitHub repository of While Loop Counter

VWAP Volatility Bands

by Focal-QuantAI
1 stars

An indicator on the price chart that smooths a VWAP with a T3 moving average cascade and surrounds it with ATR-scaled volatility bands. The VWAP can reset each session, week or month. Optional bounce signals mark reactions from the outer bands in the direction

Indicator v6 Volatility & bandsVolume
Updated 6 months ago · None stated GitHub repository of VWAP Volatility Bands
1 stars

A counter-trend indicator that complements a trend-following sibling. It looks for fading trends in two ways: four-hour EMAs narrowing together followed by a counter-cross on one hour, or RSI divergence on four hours with a rejection candle. A signal offset ca

Indicator v5 Mean reversionDivergence
Updated 7 months ago · None stated GitHub repository of V16 Trend Exhaustion Catcher

ES Professional Fade

by knectardev
1 stars

The ES Professional Fade strategy trades overnight price gaps during regular trading hours on intraday charts. It establishes an opening range and enters counter-trend positions when price fails near overnight extremes. Positions target the previous day's clos

Strategy v5 Mean reversionSessions & time
Updated 9 months ago · None stated GitHub repository of ES Professional Fade

Simple Short Term RSI

by juliencrn
1 stars

Simple Short Term RSI is an unfinished Pine v4 learning strategy, marked as such by its author. It calculates a 2-period and a 14-period RSI and plots both in a separate pane. Its only trading rule is a long entry whenever the 2-period RSI is above 50, which d

Strategy v4 Oscillators & momentumMean reversion Archived
Updated 4 years ago · None stated GitHub repository of Simple Short Term RSI
53 stars

This strategy implements Larry Connors' 2-period RSI mean-reversion algorithm overlaid on the price chart. It filters trades using a long-term Simple Moving Average (SMA), entering long positions when the price trades above the SMA and the short-term RSI drops

Strategy v6 Oscillators & momentumMean reversion
Updated 2 months ago · MPL-2.0 GitHub repository of Larry Connors 2-Period RSI Strategy

RSI/BB 1minute Study

by SammyEnigma
18 stars

This strategy combines Relative Strength Index and Bollinger Bands for short-term signal generation. It enters long positions when the price crosses below the lower Bollinger Band while the RSI falls at or below the oversold threshold. Positions are scaled dow

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of RSI/BB 1minute Study
4 stars

This strategy trades opening gap fades on the DAX index during the European Xetra session. At the 09:00 CET market open, it measures the opening price against the previous close relative to an ATR threshold. If a gap exceeds the threshold, it fades the move by

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · MIT GitHub repository of DAX Gap Fade [trugurpala]

Grid Bot [psyll]

by cullyk
2 stars

Grid Bot places a configurable number of long and short orders between a user-set grid top and bottom and draws those levels on the price chart. Direction can be longs, shorts, or both, with default or burst entry and an optional instant first fill. Exits use

Strategy v5 Mean reversionSupport & resistance
Updated 8 months ago · MIT GitHub repository of Grid Bot [psyll]

BB Upper Breakout Short

by kanylbullen
1 stars

A short-only strategy that sells when price pushes a set percentage above the upper Bollinger Band. The trigger can use the candle high or the close. After entry, it places a limit take profit a set percentage below the average entry price. Band length, multip

Strategy v5 Volatility & bandsMean reversion
Updated 7 days ago · None stated GitHub repository of BB Upper Breakout Short
1 stars

An indicator for four-hour charts that looks for a sharp drop followed by a slow, controlled recovery, treated as a rounded bottom, and the inverse for a rounded top. Window lengths, minimum percentage moves, a directional-bar ratio and a daily EMA direction f

Indicator v5 Mean reversionVolatility & bands
Updated 7 months ago · None stated GitHub repository of V8 Fast Rounded Bottom/Top Catcher

4x4 Futures Ghost Matrix

by knectardev
1 stars

This indicator generates intraday trading signals by combining dual-sigma standard deviation bands, Heikin Ashi candle vectors, and a four-bar confluence score. It triggers long and short signals during defined trading sessions using either mean-reversion boun

Indicator v5 Volatility & bandsMean reversion
Updated 9 months ago · None stated GitHub repository of 4x4 Futures Ghost Matrix

Neural Probability Channel

by tthanhvu002sgu
1 stars

Draws a volatility channel around a kernel regression baseline on the price chart. The baseline is a weighted average of recent hlc3 prices using a rational quadratic kernel, with bandwidth and alpha settings controlling smoothness. Channel width comes from th

Indicator v5 Mean reversionVolatility & bands
Updated 3 months ago · None stated GitHub repository of Neural Probability Channel
1 stars

This TradingView strategy detects directional trades on the price chart using multiple entry triggers including TMA-Crossing, Breakout, and VWAP-Crossing with price types like Close or Open. It applies optional logical combinations of triggers and enforces tim

Strategy v6 TrendBreakout
Updated 4 months ago · None stated GitHub repository of STT Trade Plan Directional
1 stars

This strategy trades Williams %R crossing into extreme zones. It enters long when the oscillator drops below the oversold level after being above it, and short when it rises above the overbought level after being below it. Each entry carries an ATR-based stop

Strategy v5 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of Williams %R Strategy

RSI/BB 1minute Study

by SammyEnigma
18 stars

This strategy calculates the Relative Strength Index (RSI) alongside Bollinger Bands to identify oversold bounce opportunities on fast timeframes. Drawn in a separate pane, it plots the RSI oscillator with customizable overbought and oversold thresholds. A lon

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of RSI/BB 1minute Study
9 stars

This strategy scaffold calculates a standard Volume Weighted Average Price (VWAP) alongside upper and lower volatility bands set 1.5 ATRs away. It generates long entry signals when a confirmed bar closes below the lower band and short entry signals when a conf

Strategy v5 Mean reversionMoving averages
Updated 13 days ago · Custom licence GitHub repository of Nexural VWAP Reversion Scaffold

SCDTM Indicator

by GreyssonEnterprises
1 stars

An indicator that applies a multi-step checklist on the price chart. The first step compares 9 and 18 period EMAs on the daily, four-hour and one-hour timeframes and requires all three to agree. The second uses Bollinger %B thresholds and a Stochastic RSI, wit

Indicator v5 TrendOscillators & momentum Repaints
Updated 2 months ago · MIT GitHub repository of SCDTM Indicator

Z-Score BB

by amico1234
1 stars

Z-Score BB measures statistical deviation by comparing a short-term 22-bar sample mean against a longer-term population baseline. It computes the population standard deviation and standard error to derive absolute Z-score offset bands around the selected basel

Indicator v4 Volatility & bandsMean reversion
Updated 2 years ago · None stated GitHub repository of Z-Score BB
99 stars

This indicator calculates the statistical autocorrelation coefficient of an input series over a user-defined lookback window at a specified lag. It tracks values using an internal circular buffer, computes sample mean, variance, and autocovariance, and normali

Indicator v6 TrendMean reversion
Updated 4 weeks ago · Apache-2.0 GitHub repository of Autocorrelation Function (ACF)

RSI/BB 1minute Study

by SammyEnigma
18 stars

This strategy plots an RSI line in a separate pane and calculates Bollinger Bands and band width without showing those plots. It enters long when price crosses under the lower band and RSI is at or below the buy level. When price crosses the upper band and RSI

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of RSI/BB 1minute Study
4 stars

This multi-mode trading strategy executes trades on the price chart using selectable technical models, including RSI-2 mean reversion, SuperTrend, MACD crossovers, Triple EMA, Bollinger Bands, or a combined multi-indicator approach. It filters trade entries us

Strategy v6 TrendOscillators & momentum
Updated yesterday · None stated GitHub repository of Simpleton KIMI – Enhanced

Monthly Performance Table

by Web3Degenerate
2 stars

This strategy combines an example trend pullback trading model with a modular monthly performance table displayed directly on the price chart. It buys when price is above a long-term moving average but below a short-term moving average, and exits when price cl

Strategy v5 Screeners & dashboardsMoving averages
Updated 2 years ago · None stated GitHub repository of Monthly Performance Table

XSP Daily Lotto

by majohnst
1 stars

This strategy models a zero-days-to-expiration (0DTE) Opening Range fade system on the price chart, designed around Mini-SPX index options. It calculates an opening range box and gauges directional sentiment from an external symbol like ES futures. Bullish con

Strategy v6 Sessions & timeSupport & resistance
Updated 4 months ago · None stated GitHub repository of XSP Daily Lotto

TESLA-BestPosition

by theteelek
1 stars

TESLA-BestPosition is a long-only dollar-cost averaging strategy that combines custom Relative Strength Index levels with smoothed highest-high and lowest-low channels. It calculates 10-period exponential moving averages of highest highs and lowest lows over a

Strategy v6 Mean reversionOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TESLA-BestPosition

ZWAP

by nvFede
1 stars

A Pine v4 indicator in a separate pane that computes a z-score of price against a volume-weighted average price over a chosen length, 20 bars by default, then smooths it with an exponential average. Shaded bands mark overbought and oversold zones, by default b

Indicator v4 Mean reversionVolume
Updated 3 years ago · None stated GitHub repository of ZWAP

Dead Cat Bounce

by TradersPost
228 stars

Calculates consecutive bar sequences that fail to create new price extremes and identifies potential reversal breakout points. When a run breaks, the script plots measured move projection arrows, high-water mark lines, and Fibonacci levels directly on the pric

Strategy v6 BreakoutMean reversion
Updated 3 months ago · None stated GitHub repository of Dead Cat Bounce
53 stars

This overlay indicator calculates the 14-period Relative Strength Index to identify overbought and oversold market conditions. When RSI crosses key thresholds, it plots initial long or short entry labels directly on the price chart. If price continues moving a

Indicator v6 Oscillators & momentumMean reversion
Updated 2 months ago · MPL-2.0 GitHub repository of RSI Multi-Layer Entry Indicator

Wyckoff Phase

by muammeryldrm42
7 stars

This strategy identifies Wyckoff consolidation ranges directly on the price chart to trade potential spring and upthrust events. It calculates highest highs and lowest lows over a customizable lookback period, filtering setups by average volume spikes and ATR

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of Wyckoff Phase
7 stars

This long-only strategy identifies pullback opportunities within a broader trend. It enters a long position when the closing price trades above a long-term exponential moving average while falling below a short-term exponential moving average. Once in a trade,

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Pullback Strategy for Stocks

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