Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 10)

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

0.35 Hedging Strategy

by wynnforthework
2 stars

This strategy executes a recovery zone hedging system directly on the price chart. It initiates an initial position at periodic bar intervals when flat, setting a target take profit and an adverse recovery boundary. If the market moves against the position int

Strategy v5 Mean reversion
Updated 1 year ago · None stated GitHub repository of 0.35 Hedging Strategy

Simple Pullback Strategy

by Web3Degenerate
2 stars

This strategy executes long trades during pullbacks within an established uptrend, plotting moving averages, entry prices, and stop levels on the price chart. It buys when the close is above the long-term simple moving average and below the short-term moving a

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Simple Pullback Strategy
1 stars

This mean-reversion strategy implements Larry Connors' 2-period RSI system. It enters long positions when price trades above a long-term simple moving average (default 200) and the 2-period RSI drops below 10. Optional short positions enter below the trend ave

Strategy v6 Mean reversionOscillators & momentum
Updated 3 days ago · MPL-2.0 GitHub repository of RSI-2 (Larry Connors) [JR]

A strategy that uses ADX to decide between two sub-strategies. In ranging conditions it fades asymmetric Bollinger Band extremes with a 200 EMA trend filter. In trending conditions it trades Donchian channel breakouts, protected by optional volume, candle rang

Strategy v6 Mean reversionBreakout
Updated 7 days ago · GPL-3.0 GitHub repository of Hierarchical Trading System v6 Fakeout Protected

This strategy identifies potential reversal conditions using statistical bands derived from price extremes relative to moving averages and standard deviations. It enters long positions when a greed condition confirms over consecutive bars. Exits are handled vi

Strategy v4 Mean reversionVolatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Long Strategy (Daily)

Simpleton GROK

by eltonaguiar
4 stars

This strategy plots on the price chart and combines up to seven optional modules that vote for long or short conditions. The modules use a 20-period simple moving average, a five-period RSI, Bollinger Band squeezes, a simplified prior-bar break, stacked expone

Strategy v5 Oscillators & momentumMoving averages
Updated yesterday · None stated GitHub repository of Simpleton GROK

Alpy Vix

by avatar-lavventura
2 stars

This strategy plots the Williams Vix Fix indicator as a histogram in a separate pane to detect potential trend reversals. It calculates the Vix Fix value using a lookback period and standard deviation bands derived from Bollinger Bands on the Vix Fix. Multiple

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Vix

3C QFL Mean Reversal

by wynnforthework
2 stars

This strategy implements a Quickfinger Luc mean-reversion trading model tailored for automated execution. It calculates base support levels and volume moving averages across timeframes to identify sharp price dips below established base levels. The script incl

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of 3C QFL Mean Reversal
1 stars

A long-only strategy adapted from an academic study of intraday reversal. It measures the return over a ranking period given in minutes, skips a bar, and buys when that return falls in the lowest percentile of its own recent history, then holds for a set numbe

Strategy v6 Mean reversionScreeners & dashboards
Updated 7 days ago · GPL-3.0 GitHub repository of Intraday Reversal Feasibility Check
5 stars

Fear + Greed Reversal Projection measures market sentiment extremes by comparing price source values against historical highs and lows using standard deviation bands. It calculates fear and greed zones through simple or weighted moving averages. When market co

Indicator v4 Volatility & bandsMean reversion
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Projection

Alpy Vix

by avatar-lavventura
2 stars

Alpy Vix is a strategy that calculates and plots the Williams Vix Fix indicator adapted for BIST stocks in a separate pane. It generates entry signals when the Vix Fix crosses upper bands or percentile ranges and meets filtered criteria based on price action s

Strategy v4 Volatility & bandsOscillators & momentum Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Vix
1 stars

A Pine v5 strategy that fades price at VWAP standard deviation bands on the price chart. A long needs the low to reach the lower band with an up candle, and a short needs the high to reach the upper band with a down candle. An optional filter counts how many r

Strategy v5 Mean reversionVolume
Updated 8 months ago · None stated GitHub repository of VWapperAlgo VWAP Bands Strategy
5 stars

This strategy identifies shorting opportunities by calculating Fear and Greed zones based on price extremums relative to moving averages and standard deviation bands. It measures price deviation from recent highs or lows to detect extreme market conditions and

Strategy v4 Volatility & bandsMean reversion
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Short Strategy

Alpy VIX

by avatar-lavventura
2 stars

Calculates the synthetic Williams VIX Fix indicator in a separate pane to detect market bottoms and volatility spikes. It computes standard deviation bands and percentile boundaries over customizable lookback periods, coloring histogram bars when volatility re

Strategy v4 Volatility & bandsMean reversion Repaints
Updated 7 months ago · None stated GitHub repository of Alpy VIX
4 stars

This strategy combines nine technical indicators including RSI, SuperTrend, MACD, Triple EMA, Bollinger Bands, Ichimoku, HMA, Swing Failure Pattern, and Z-Score. Each indicator votes on long or short direction, with a Dynamic mode that weights votes based on m

Strategy v5 TrendOscillators & momentum
Updated yesterday · None stated GitHub repository of Simpleton v0.06 Kimi_Cursor

Volatility Momentum Score

by vedkanani123
1 stars

A separate-pane oscillator that combines a Z-score of price with a Z-score of volatility into one score, then applies bands from a band length with separate positive and negative multipliers. A signal type setting chooses how it is read, and optional signs mar

Indicator v6 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of Volatility Momentum Score
1 stars

Tn Adaptive Risk Regime v6 is a strategy that switches between mean reversion and breakout modes based on volatility regime. It compares ATR to its SMA over a lookback to classify high or low volatility. Low volatility triggers mean reversion by fading range e

Strategy v6 Volatility & bandsMean reversion
Updated 2 months ago · None stated GitHub repository of Tn Adaptive Risk Regime v6

Squeeze Cross

by JohnsonHsiao
1 stars

This indicator calculates a normalized volatility oscillator plotted in a separate pane. It measures the distance between the closing price and a simple moving average, standardized by a scaled standard deviation band. The script plots the resulting ratio alon

Indicator v5 Volatility & bandsOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Squeeze Cross
1 stars

A Pine v4 strategy that goes long when the MACD and the 14-period RSI are both rising while RSI is at or below an entry level. It can add to a long when RSI drops further below the previous entry, up to a maximum number of adds, and it can reopen longs. Longs

Strategy v4 Oscillators & momentumMean reversion
Updated 4 years ago · None stated GitHub repository of MACD Fast Shorts Add RSI Entry
330 stars

This mean-reversion strategy combines multi-timeframe exponential moving averages, Bollinger Bands, and the Relative Strength Index. It generates long and optional short trade signals when price interacts with the Bollinger Bands alongside RSI threshold confir

Strategy v5 Mean reversionMoving averages
Updated 2 months ago · None stated GitHub repository of MEMA + BB + RSI [Alorse]

MACD x RSI Study

by jerryinyang
5 stars

This indicator combines MACD and RSI to generate pullback signals on forex pairs. It plots MACD line, signal line and histogram alongside RSI and Wave Trend oscillator. Higher-timeframe MACD provides trend bias while RSI identifies overbought and oversold zone

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of MACD x RSI Study

Alpy VIX

by avatar-lavventura
2 stars

This strategy combines the Williams Vix Fix oscillator with volume-weighted moving average (VWMA) bands to identify reversal entries. It plots the VIX Fix histogram and optional Bollinger and percentile bands in a separate pane. Long entries trigger when the o

Strategy v4 Volatility & bandsMoving averages Repaints
Updated 7 months ago · None stated GitHub repository of Alpy VIX

CTC BB Hedge Strategy

by wynnforthework
2 stars

CTC BB Hedge Strategy calculates the Pearson correlation coefficient between the close prices of two symbols to determine market alignment. It applies Bollinger Bands to the primary symbol for mean-reversion signals while optionally filtering with a moving ave

Strategy v5 Volatility & bandsMean reversion Repaints
Updated 1 year ago · None stated GitHub repository of CTC BB Hedge Strategy
1 stars

A strategy that switches logic by volatility regime, measured as the percentile rank of ATR as a percent of price over 200 bars. In low volatility it buys RSI below 30 and sells above 70. In the middle regime it follows a 20 and 50 EMA crossover, with longs al

Strategy v6 Volatility & bandsMean reversion
Updated 2 months ago · None stated GitHub repository of TN Adaptive Vol Regime
228 stars

The Mean Reversion Strategy Template calculates a baseline mean using SMA, EMA, or VWAP alongside upper and lower deviation bands based on standard deviation, ATR, or percentage offsets. It generates long and short entries when price touches, bounces from, or

Strategy v6 Mean reversionMoving averages
Updated 3 months ago · None stated GitHub repository of Mean Reversion Strategy Template
1 stars

A strategy in a separate pane built on the WaveTrend oscillator. It enters long when the fast line crosses above the slow line while below the second oversold level, and short on a downward cross while above the second overbought level. Positions close on the

Strategy v5 Oscillators & momentumMean reversion
Updated 2 weeks ago · None stated GitHub repository of WaveTrend Cross Strategy

VWAP Distance

by nvFede
1 stars

A Pine v4 indicator in a separate pane that shows how far the close is from a daily-reset volume-weighted average price. It rebuilds VWAP from the chosen source, typical price by default, restarting each day, then plots the close divided by VWAP minus one, so

Indicator v4 VolumeMean reversion
Updated 3 years ago · None stated GitHub repository of VWAP Distance

FairValueGap B002

by ruckard
13 stars

This price-chart strategy measures the distance from the current price to the opposite end of the latest fair value gap and enters on the idea that price fills much of that gap. Take profit is set toward a large share of that distance, with a wider stop meant

Strategy v5 SMC / ICT / price actionMean reversion
Updated 1 year ago · None stated GitHub repository of FairValueGap B002

Linear Regression Channel

by pineforge-4pass
1 stars

This strategy builds a linear-regression midline of close and places upper and lower bands at a multiple of close standard deviation. It enters long when price is below the lower band and the close rises versus the prior bar, and short when price is above the

Strategy v6 Mean reversionVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of Linear Regression Channel
1 stars

Calculates a reversal confidence score combining Bollinger Band overextension, RSI exhaustion, and price distance from a exponential moving average. The strategy overlays VWAP, EMA, and Bollinger Bands directly on the price chart. Long signals trigger when pri

Strategy v5 Mean reversionOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Reversal Confidence Strategy
1 stars

A Pine v4 strategy that goes long when a MACD bottoming pattern or an RSI bottoming pattern below 30 appears while price trades under a VWAP band set half a percent below the close. It can add to longs on further RSI bottoms up to a maximum, reopen longs, and

Strategy v4 Oscillators & momentumMean reversion
Updated 4 years ago · None stated GitHub repository of MACD Please (RSI Bottoms)

FairValueGap E003

by ruckard
13 stars

Calculates the distance between the current price and the opposite end of the latest fair value gap, entering trades on the expectation that price will partially fill the gap. It incorporates risk management with customizable stop loss, take profit based on ri

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of FairValueGap E003

FairValueGap F004

by ruckard
13 stars

The FairValueGap F004 strategy trades fair value gap fills with automated risk management and Zignaly webhook integration. It calculates the distance between the current price and the opposite end of a recently created gap, entering positions with the expectat

Strategy v5 SMC / ICT / price actionMean reversion
Updated 1 year ago · None stated GitHub repository of FairValueGap F004
4 stars

This strategy draws on the price chart and identifies mean-reversion opportunities around daily volume-weighted average price (VWAP) bands. It enters long positions when the price crosses above the lower band while the Relative Strength Index indicates oversol

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · MIT GitHub repository of NQ VWAP Reversion [trugurpala]

NQ Phantom Scalper Pro

by rosijay17-cmd
1 stars

A strategy that trades around an anchored VWAP with standard-deviation bands. The VWAP can reset each session, week, month, quarter or year, with two adjustable band multipliers. A volume spike filter, a time-of-day filter with an optional lunch-hour exclusion

Strategy v6 Mean reversionVolume
Updated 7 days ago · GPL-3.0 GitHub repository of NQ Phantom Scalper Pro

Calculates a composite carry and decay oscillator fusing impulse-autocorrelation half-life, a Hurst exponent approximation, path efficiency, and range expansion ratios. It evaluates whether an impulse is likely to persist or mean-revert, plotting the oscillato

Indicator v6 TrendOscillators & momentum
Updated 2 days ago · MIT GitHub repository of Market Memory & Decay Oscillator [WavesUnchained]
3 stars

This strategy plots directly on the price chart, drawing a multi-line stepped channel calculated from a simple moving average of OHLC4 expanded by Average True Range multipliers. It identifies potential mean-reversion setups, executing buy, sell, trim, and exi

Strategy v5 Volatility & bandsMoving averages
Updated 5 months ago · None stated GitHub repository of Current Backtester

Z-Score Lab

by jayadevrana
1 stars

Z-Score Lab plots the simple moving average of close and bands at one and two standard deviations on the price chart, and computes the current z-score of price versus that mean. On the last bar it stores a rolling sample of z-scores and shows a histogram table

Indicator v6 Volatility & bandsMean reversion
Updated 3 days ago · MPL-2.0 GitHub repository of Z-Score Lab
46 stars

Leptokurtic Directional Bias is an overlay indicator that measures kurtosis on a chosen source and marks directional bias on the price chart. The source can be a moving average, ATR, volume, close, or a Bollinger-band trend stop. Bias mode switches among RSI m

Indicator v5 Volatility & bandsMean reversion
Updated 7 weeks ago · None stated GitHub repository of Leptokurtic Directional Bias

Calculates a combination of the Relative Strength Index, MACD histogram, and Bollinger Bands contraction to identify long trade entries. The strategy signals a long position on a bullish bar when the MACD histogram turns upward while negative, RSI remains belo

Strategy v4 Oscillators & momentumVolatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of RSI + MACD + BB Long Strategy (Not Good)

RSI Mean Reversion

by trugurpala
4 stars

The strategy identifies mean reversion opportunities using the RSI indicator. It calculates RSI with customizable length and generates long entries on RSI crossover above the oversold level and short entries on crossover below the overbought level. Entries are

Strategy v6 Mean reversionOscillators & momentum
Updated 2 months ago · MIT GitHub repository of RSI Mean Reversion

Quick Flip Scalper

by TradersPost
228 stars

This strategy executes an opening-range liquidity fade based on the first candle of a session. It qualifies the opening range against the daily ATR to confirm manipulation or liquidity spikes. If qualified, it searches for reversal candlestick patterns, such a

Strategy v6 Sessions & timeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Quick Flip Scalper

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