Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 5)

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

AlgoBot GC Mean-Reversion Strategy

by ghostnathan30-ops
1 stars

A gold futures strategy meant for the micro contract on the 30-minute chart. It records the first New York hour range from 9:30 to 10:30, then fades the first breakout between 10:30 and 13:00, taking the opposite direction of the break. ATR-based stop and targ

Strategy v6 Mean reversionSessions & time
Updated 6 months ago · None stated GitHub repository of AlgoBot GC Mean-Reversion Strategy
1 stars

A single indicator that combines two systems and enables each only on its own timeframe. On a fifteen-minute chart it runs a volatility squeeze breakout using an ATR percentile and a regime filter. On a four-hour chart it runs a VWAP mean reversion with standa

Indicator v6 BreakoutMean reversion
Updated 7 months ago · None stated GitHub repository of V19 (15M) + V21 (4H) Hybrid
1 stars

This strategy identifies Initial Balance periods on NQ and ES futures charts using user-defined start and end hours in Eastern Time. It classifies days as narrow or wide based on average range lookback and skips narrow or trending days per settings. Entries tr

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

This strategy calculates the RSI indicator to detect mean reversion in AU stocks. It enters long positions when RSI falls below the oversold level with no current position and closes positions when RSI rises above the overbought level. Position size uses a fix

Strategy v5 Mean reversionOscillators & momentum
Updated 8 months ago · None stated GitHub repository of AU RSI Mean Reversion

VMC Strat Flex Corrected

by matlaenousse
1 stars

This strategy evaluates market conditions using a combination of WaveTrend, RSI, Stochastic RSI, and a custom Money Flow Index calculation inspired by VuManChu. It enters long positions when multiple oscillators hit oversold thresholds and generate an upward c

Strategy v6 Oscillators & momentumDivergence
Updated 10 months ago · None stated GitHub repository of VMC Strat Flex Corrected

RSI Strategy

by SOWRAJ
1 stars

This strategy calculates the relative strength index of the close and plots that oscillator plus oversold and overbought horizontal levels on the price chart because overlay is on. It opens a long when RSI crosses above the oversold level and a short when RSI

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

TD_Indicator

by subhrapratim07
1 stars

This indicator implements Tom DeMark Sequential logic directly on the price chart. It calculates TD buy and sell setups by comparing closes against four bars prior, tracks setup counts up to nine, and evaluates bar lows and highs to identify perfected setup co

Indicator v5 Mean reversionTrend
Updated 2 years ago · None stated GitHub repository of TD_Indicator

Rocket Launches

by yankeexlr
1 stars

An overlay for crypto charts that follows a staged sequence built from RSI and four simple moving averages. It flags bearish candles with RSI under 20, records their lows, watches for crosses above the 50-period and 300-period averages, and stores the low of a

Indicator v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Rocket Launches
1 stars

This strategy trades mean-reversion bounces using Bollinger Bands and constructs JSON webhook payloads for automated execution. It opens a long position when the price crosses back above the lower band within a specified date filter and closes the position whe

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · MPL-2.0 GitHub repository of Bolinger Bands Strategy

Kama-WAP

by nvFede
1 stars

A Pine v4 indicator in a separate pane that is a variant of a volume-weighted z-score oscillator. It measures the close against a rolling volume-weighted mean and divides by a volatility term smoothed with an adaptive Kaufman-style average instead of a simple

Indicator v4 Mean reversionVolume
Updated 3 years ago · None stated GitHub repository of Kama-WAP

Bollinger Bands Strategy

by cklose2000
105 stars

This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po

Strategy v5 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Strategy

Pair Trade: Apple & Google

by PythonForForex
64 stars

This pair trading strategy calculates the daily price movement ratio of Google using multi-symbol data requests and plots it in a separate pane. When Google drops by more than 5% within a day, the strategy enters a long position of 100 units on the chart symbo

Strategy v5 Mean reversion
Updated 4 years ago · None stated GitHub repository of Pair Trade: Apple & Google

Exhaustion Reversal

by milocaetano
48 stars

Exhaustion Reversal identifies potential market exhaustion and reversal points on the price chart by detecting strong force bars followed by price give-back patterns. A force bar is defined by an above-average body reaching recent extreme highs or lows. The sc

Indicator v5 Candlestick patternsMean reversion
Updated 3 days ago · MIT GitHub repository of Exhaustion Reversal

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy fades Bollinger Band extremes on the close. It opens a short when price crosses above the upper band and the 14-period RSI is above 75, and a long when price crosses below the lower band and RSI is above 25. Shorts close when RSI falls below 30 a

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

BodyOutlier A003

by ruckard
13 stars

BodyOutlier A003 is a mean-reversion trading strategy designed for automated execution via Zignaly alerts. It identifies candlestick body outliers to place limit orders, buying at the low of unusually large bullish candles or selling at the high of large beari

Strategy v5 Candlestick patternsMean reversion
Updated 1 year ago · None stated GitHub repository of BodyOutlier A003

Enhanced DCA Strategy

by SynergOps
7 stars

The Enhanced DCA Strategy invests a fixed dollar amount at regular intervals (daily, weekly or monthly) into the asset after start date, deducting trading fees and tracking total invested, units acquired, current value, profit, ROI, Sharpe ratio, Sortino ratio

Strategy v6 ScalpingMean reversion Repaints
Updated 1 year ago · MPL-2.0 GitHub repository of Enhanced DCA Strategy
5 stars

This strategy enters long positions when price tests and bounces off the prior week's low level within an allowed point tolerance during designated UTC trading hours. It requires the bar low to approach the prior week low and the close to rebound above it whil

Strategy v5 Support & resistanceMean reversion
Updated 5 months ago · MIT GitHub repository of WKL — Prior Week Level Retest (Bull)
4 stars

This indicator plots directional trade signals, ATR-based target and stop-loss boxes, and SuperSmoother reversal bands directly on the price chart. It evaluates market conditions across selectable technical strategies, displaying confidence scores alongside an

Indicator v6 Screeners & dashboardsTrend Repaints
Updated 2 days ago · None stated GitHub repository of Elton's Predictions Decision Engine

RSI Mean Reversion

by LePotoRico2105
4 stars

This strategy executes mean-reversion trades when the Relative Strength Index rebounds from overbought or oversold zones in the direction of a higher-period trend EMA. It calculates indicators using confirmed bar closes to prevent live-bar recalculation. Entri

Strategy v5 Mean reversionOscillators & momentum
Updated 7 months ago · MIT GitHub repository of RSI Mean Reversion
3 stars

Sapphire Fibonacci Strategies is a multi-mode strategy that combines Momentum Breakout, Mean Reversion, and Fibonacci Retracement models built on Fibonacci-period moving averages. It generates long and short trade signals based on price crossovers and moving a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Sapphire Fibonacci Strategies

Scalp Agiota - By H7

by leocairos
3 stars

The Scalp Agiota strategy calculates RSI and MFI values to identify overbought and oversold conditions for cryptocurrency scalping trades. It plots upward triangles on the price chart below the bar when RSI drops to 20 or lower and MFI to 10 or lower, signalin

Strategy v5 Oscillators & momentumScalping Repaints
Updated 2 years ago · MIT GitHub repository of Scalp Agiota - By H7
3 stars

Plots Donchian Channels and identifies trading setups based on price testing the channel extremes during high volume spikes. In long mode, it places limit buy orders when the low touches the lower Donchian band with volume exceeding a volume moving average mul

Strategy v4 Mean reversionVolatility & bands
Updated 4 years ago · CC0-1.0 GitHub repository of Greeffer's Long Strategy

RSI Bounce

by blackcat1402
3 stars

RSI Bounce calculates custom Relative Strength Index levels scaled back onto price, creating nine price-equivalent RSI band series centered around a median RSI baseline. It combines short-term RSI extreme checks with customized MACD signal line crossovers to i

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · MIT GitHub repository of RSI Bounce
2 stars

This strategy fades liquidity sweeps of confirmed swing highs and lows. It enters a reversal only after price sweeps a prior swing and closes back inside the range. The stop sits an ATR multiple beyond the sweep wick, the target is a fixed reward-to-risk multi

Strategy v6 SMC / ICT / price actionMean reversion
Updated 2 months ago · Custom licence GitHub repository of Liquidity Sweep Reversal [Vantrade]
2 stars

Calculates custom exponential moving averages and standard deviation envelopes based on price offsets and lookback windows. It plots dynamic channel bands, mean reversion zones, and squeeze indicators in a separate pane. Users can adjust the moving average len

Indicator v5 Moving averagesVolatility & bands
Updated 3 years ago · None stated GitHub repository of [CBB] Rising Falling Color Band

ZeroDTE Wave v2

by xynkro
1 stars

A Pine version 6 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-asid

Indicator v6 Mean reversionSessions & time
Updated 2 days ago · None stated GitHub repository of ZeroDTE Wave v2

GEKO Scalp

by grzegorzkowalskigk-jpg
1 stars

This indicator is a mean-reversion scalper for index futures on one to five minute charts. It plots session VWAP with one and two standard deviation bands and previous day high and low, and arms setups only when an Efficiency Ratio shows choppy rather than tre

Indicator v6 Mean reversionScalping
Updated 3 months ago · Custom licence GitHub repository of GEKO Scalp

Custom Reversal

by rubbermetal
1 stars

An overlay indicator that flags possible reversals using pivot points, candle patterns and confirmation filters. It detects swing highs and lows with separate left and right bar counts, bullish and bearish engulfing candles, and pin bars such as hammers and sh

Indicator v6 Candlestick patternsMean reversion
Updated 4 months ago · MPL-2.0 GitHub repository of Custom Reversal

BVortex Strategy v1

by Alberto082544
1 stars

BVortex Strategy v1 calculates a scaled Vortex Indicator difference to detect overbought and oversold conditions relative to predefined upper and lower thresholds. It filters entries using market trend direction established by confirmed swing pivot highs and l

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

This strategy calculates intraday volatility mean reversion using session VWAP standard deviation bands, RSI overbought and oversold levels, and candle wick exhaustion ratios. It enters trades when price reaches statistical extremes filtered by RSI and wick co

Strategy v6 Mean reversionVolatility & bands
Updated 7 months ago · MIT GitHub repository of Intraday Volatility Reversion Z-Score

Double Star Strategy

by mkdir700
1 stars

A strategy for the price chart that combines Bollinger Bands, the MACD line and a small-candle-body test. Shorts follow a close above the upper band with a small body and MACD above zero, then a lower close; longs follow a close below the lower band with a sma

Strategy v5 Mean reversionCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Double Star Strategy

The Pirate Compass

by yankeexlr
1 stars

An overlay for crypto, stocks and commodities that runs two parallel sets of the same staged logic, each with its own RSI length and 21, 50, 100 and 300-period simple moving averages. The logic flags bearish candles with RSI below 20, tracks crosses above the

Indicator v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of The Pirate Compass

ARI-Overextension

by alessioricco
1 stars

This indicator measures how far the close sits from a Hull moving average and plots that gap as a percentage in a separate pane. It also calculates an exponential moving average over the same trend length. The plotted line is red above 20, green below zero, an

Indicator v4 Moving averagesMean reversion
Updated 2 years ago · Apache-2.0 GitHub repository of ARI-Overextension
1 stars

This long-only strategy plots Bollinger Bands, 20 bars and 2.5 deviations by default, along with a 10 and a 50 period EMA and a background that shades the EMA trend. When flat, it buys after the close crosses back above the lower band, and it closes the positi

Strategy v5 Mean reversionVolatility & bands
Updated 2 years ago · MPL-2.0 GitHub repository of Bolinger Bands Strategy

A long-only strategy that buys when the 14-bar RSI is below 30 inside a chosen date range. It closes all positions when price reaches a percentage profit target or falls to a percentage stop loss, checked on closes. The order size doubles after each close, a p

Strategy v5 Oscillators & momentumMean reversion Repaints

This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,

Strategy v5 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Indicator Strategy (StochRSI, MFI & EMA) With Safety Orders

Pair Trade: Inputs

by PythonForForex
64 stars

This strategy executes trades on the current chart based on daily percentage price changes of an external ticker (GOOG). It fetches the daily open and close prices of the reference symbol to compute its intraday price change ratio. When the reference asset dro

Strategy v5 Mean reversion
Updated 4 years ago · None stated GitHub repository of Pair Trade: Inputs

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy builds Bollinger bands from a simple moving average and the standard deviation of the close. It opens a short when price crosses above the upper band and the 14-period RSI is above 80, and opens a long when price crosses below the lower band and

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

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