Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 3)

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

Absolute Swings Crypto

by yankeexlr
1 stars

A strategy-type script for crypto that combines Bollinger Bands (22 periods, 1.62 deviations) with %B and an 18-period RSI. It looks for %B crossing back above zero together with RSI crossing back above 28 as one sequence, and %B falling below 1.33 together wi

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Absolute Swings Crypto

Señal Compra/Venta

by LucasNatoli
1 stars

This indicator plots buy and sell markers on the price chart using RSI and Bollinger Bands. A buy triangle appears when RSI is at or below the oversold level and the close is at or below the lower band. A sell triangle appears when RSI is at or above the overb

Indicator v4 Oscillators & momentumVolatility & bands
Updated 2 years ago · CC0-1.0 GitHub repository of Señal Compra/Venta
1 stars

A very simple strategy that opens a long position when the close has fallen for six bars in a row, and closes it on the first bar that closes higher than the previous bar. It sizes each trade at all of the account equity and has no stop loss or take profit. Th

Strategy v5 Mean reversion
Updated 2 years ago · None stated GitHub repository of Markov Down-Streak Strategy

An overlay indicator that draws Bollinger-style bands around a 20-period simple moving average using four standard deviation multipliers based on Fibonacci ratios: 2, 2.618, 3.618 and 4.618 by default. Upper bands are red and lower bands green, and the outermo

Indicator v5 Volatility & bandsMean reversion
Updated 3 years ago · GPL-3.0 GitHub repository of Bollinger Bands Fibonacci Ratios
1 stars

A strategy written for 15-minute charts that looks for pullbacks within an uptrend. It requires the 50 EMA above the 200 EMA, the close below the 50 EMA, a recent oversold reading on a smoothed Stochastic RSI, and a stochastic cross up that is higher than an e

Strategy v5 Oscillators & momentumMean reversion
Updated 3 years ago · GPL-3.0 GitHub repository of Fluffy 15M Stochastic RSI Top
1 stars

A long-only strategy hard-coded to the BTCUSDT 5-minute series through a security request. It enters long when price crosses a 9-period simple moving average while RSI is below 50. It closes all positions when price is one percent above the average entry price

Strategy v5 Moving averagesMean reversion
Updated 3 years ago · MIT GitHub repository of Advanced Crypto Trading Strategy

Nadaraya-Watson Envelope

by 0xfffangel
1 stars

An overlay that fits a Nadaraya-Watson kernel regression curve to recent prices and wraps it with upper and lower bands set at a multiple of the mean absolute error. The window size, bandwidth, band multiplier and source are adjustable. Arrows mark where price

Indicator v5 Mean reversionVolatility & bands Repaints
Updated 4 years ago · None stated GitHub repository of Nadaraya-Watson Envelope

Eth Strategy

by samliu0206
1 stars

This script aggregates spot and perpetual futures price data across multiple cryptocurrency exchanges to calculate a volume-weighted futures premium index. It computes the log ratio between perpetual futures and spot prices, applies a user-selected moving aver

Strategy v4 Moving averagesMean reversion
Updated 4 years ago · None stated GitHub repository of Eth Strategy
1 stars

A multi-study overlay that plots a triple exponential moving average, short SMAs, EMAs at 9, 20, 50, 100 and 200, and an ATR band around an EMA midline. It shades the background when the 9 and 20 EMAs cross and when the CCI moves back through plus or minus 100

Indicator v5 Moving averagesVolatility & bands
Updated 4 years ago · None stated GitHub repository of TEMA + 9 EMA + ATR + CCI + WR

This strategy draws a Donchian channel with a very long default period of 1440 bars, its midline and a 250-period simple moving average. It places limit orders to sell at the upper band after a high touches it and to buy at the lower band after a low touches i

Strategy v4 BreakoutMean reversion
Updated 4 years ago · MIT GitHub repository of Greeffer's Donchian Channel Strategy
330 stars

This strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities. It enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specifi

Strategy v5 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger bands + Aroon [Alorse]
285 stars

Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a

Indicator v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Study
104 stars

This strategy combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at

Strategy v5 Oscillators & momentumVolatility & bands
Updated 3 years ago · MIT GitHub repository of Bollinger Bands and RSI Strategy

FVG RSI Strategy (Optimized)

by skywalker0803r
42 stars

This strategy plots on the price chart and trades fair value gaps filtered by RSI and two EMAs. It opens a long when a bullish gap, a rising candle, RSI below the oversold level, and price under both EMAs align, and a short on the opposite conditions. Each tra

Strategy v5 SMC / ICT / price actionOscillators & momentum
Updated 2 months ago · None stated GitHub repository of FVG RSI Strategy (Optimized)

RSI Technique - V

by Tikam02
20 stars

RSI Technique - V identifies rapid reversal pivot points based on the Relative Strength Index. It monitors an RSI oscillator, configurable via the lookback setting, looking for sharp V-shaped spikes around extreme zones. A bullish signal appears when the indic

Indicator v5 Oscillators & momentumMean reversion
Updated 2 years ago · Apache-2.0 GitHub repository of RSI Technique - V

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy fades Bollinger Band extremes using the close. It enters short when price crosses above the upper band and the 14-period RSI is above 70, and enters long when price crosses below the lower band and RSI is below 30. It closes half of an open short

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

This strategy overlays the price chart to trade DAX futures during European market hours. It calculates exponential and simple moving averages, RSI, MACD, Bollinger Bands, ATR, and realized volatility to simulate VIX levels. Trades execute when session time fi

Strategy v5 Sessions & timeOscillators & momentum
Updated 8 months ago · Custom licence GitHub repository of ClaudeHedge - DAX Session Strategy
5 stars

This indicator identifies long mean-reversion trade opportunities when price stretches significantly below the Volume Weighted Average Price (VWAP). It triggers a signal during regular trading hours when price moves a defined minimum number of ticks below VWAP

Indicator v5 Mean reversionVolume
Updated 5 months ago · Custom licence GitHub repository of Path B — VWAP Reversion (Demo)

SA-TEST 03

by durdenbtc
5 stars

This strategy calculates a 14-period RSI of close and plots it in a separate pane with horizontal lines at 30 and 70. It opens a long when RSI crosses above the oversold level and closes that long when RSI crosses below the overbought level. There are no short

Strategy v6 Oscillators & momentumMean reversion Repaints
Updated 5 months ago · MIT GitHub repository of SA-TEST 03
5 stars

Greeffer's Scalping Strategy combines multi-timeframe Exponential Moving Averages, Bollinger Bands, and Donchian Channels to execute dip-buying trades directly on the price chart. It triggers long entries when price dips below both the lower Donchian Channel a

Strategy v5 Moving averagesVolatility & bands
Updated 4 years ago · None stated GitHub repository of Greeffer's Scalping Strategy

Antigravity Elite

by eltonaguiar
4 stars

Antigravity Elite is an overlay strategy that switches among seven named engines or auto-detects one, including Connors RSI, EMA stack, Supertrend, volatility-spike reversal, multi-sigma Bollinger reversal, and a weighted consensus. It enters long by default,

Strategy v6 TrendOscillators & momentum
Updated yesterday · None stated GitHub repository of Antigravity Elite
4 stars

This strategy executes trades on 5-minute index futures using Exponential Moving Averages, RSI, ADX, and volume filters across multiple timeframes. It supports trend pullback and VWAP reversion regimes with entry confirmation on breakout of prior high or low p

Strategy v6 TrendMean reversion
Updated 2 days ago · None stated GitHub repository of Lucid 100K Prop Bot (MES 5m)

DCA Long Nonstop

by Jaden300
4 stars

DCA Long Nonstop runs a perpetual dollar-cost averaging ladder on any ticker. It opens a base order at market entry then adds safety orders when price drops soStep percent below the base price, with each subsequent safety order sized larger by 5 percent. When

Strategy v6 Mean reversion
Updated 5 months ago · None stated GitHub repository of DCA Long Nonstop

VT-Lite

by algoboy-kevin
4 stars

VT-Lite is a Pine Script v5 mean-reversion strategy that draws in a separate pane. It sizes equity-percent entries from a short-term EMA and ATR band distance, with a volatility EMA threshold and a choice of close, low, or ATR-band source. It can add reentries

Strategy v5 Mean reversionVolatility & bands
Updated 2 years ago · None stated GitHub repository of VT-Lite

RSI Mean Reversion

by GifariKemal
3 stars

This strategy plots entry signals, stop loss, take profit levels, and an information panel directly on the price chart. It combines a relative strength index mean reversion model with ATR percentile thresholds to filter trades based on volatility conditions. T

Strategy v5 Oscillators & momentumVolatility & bands
Updated 4 days ago · MIT GitHub repository of RSI Mean Reversion
3 stars

This strategy combines five selectable mean-reversion and swing trading sub-strategies into a unified system. It generates entry signals based on conditions like Internal Bar Strength drops, consecutive lower closes into Tuesday, multi-day channel breakdowns,

Strategy v5 Mean reversionTrend
Updated 2 years ago · MIT GitHub repository of Mean Reversal Portfolio
3 stars

This indicator estimates how many bars typically pass before a custom skew measure falls back below its exponential moving average. It builds the skew from smoothed upside and downside true-range deviations, then applies five fixed EMA lengths from 2 to 110. O

Indicator v5 Mean reversionMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Average Bars Before Reversion

Calculates a long-term Exponential Moving Average as a baseline for fair value alongside a Relative Strength Index. Generates long entry signals when the close price trades at least five percent below the moving average while the RSI is oversold. Exits trades

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · MIT GitHub repository of Buffett-Inspired Value Strategy

Asif Dip v2 Daily

by Asifali549
1 stars

A long-only daily strategy for crypto that buys short-term dips inside an uptrend. It requires the close above a long EMA, a medium EMA above the long one, an optional Bitcoin trend filter, and a very low three-period RSI. Entry is at the next open. The stop i

Strategy v6 Mean reversion
Updated yesterday · None stated GitHub repository of Asif Dip v2 Daily
1 stars

A separate-pane oscillator that plots a z-score, the distance of price from its rolling mean measured in standard deviations, smoothed over a few bars. Dots mark turns that happen outside a chosen zone around zero. An AR(1) half-life readout and optional regim

Indicator v6 Mean reversionOscillators & momentum
Updated yesterday · None stated GitHub repository of Mean Reversion (z-score)
1 stars

A research strategy for the price chart, meant for a five-minute chart with Moscow time. It measures the price move between two time points of the same day, and if the move exceeds a threshold it opens a position at the end of the second slot, either with the

Strategy v6 Sessions & timeMean reversion
Updated yesterday · None stated GitHub repository of Session Triples - 5 Stocks

RSI 30 Turbo Swing

by vriken
1 stars

A long-only strategy that buys stocks after the daily 14-period RSI closes below an oversold level, optionally only above the 200-day average and in a bullish market regime based on an index and VIX. Trades close after a set number of days or earlier when the

Strategy v6 Mean reversionOscillators & momentum Repaints
Updated yesterday · None stated GitHub repository of RSI 30 Turbo Swing

Dip Mafia HODL

by 0xCaretaker
1 stars

A long-only strategy that buys dips and never sells during the test. A buy needs a lower Bollinger Band touch, by default with a close below the midline, plus a MACD or Impulse MACD crossover. Position size is a percent of equity or a fixed cash amount per buy

Strategy v6 Mean reversionOscillators & momentum
Updated 2 days ago · None stated GitHub repository of Dip Mafia HODL

ES1! Short 1D MA200 MA5

by luifertorres
1 stars

A short-only daily strategy for E-mini S&P futures, the mirror of the long version. It enters short when the 200-period SMA is falling, the candle is bullish and the whole bar sits above the 5-period SMA, and it closes the position when price closes below the

Strategy v6 Mean reversionMoving averages
Updated 5 days ago · MIT GitHub repository of ES1! Short 1D MA200 MA5

Adaptive Signals V18

by Matthew-Eucaristo
1 stars

A crypto futures signal indicator in a separate pane, the later version of the V17 script. It scores setups and shows only those passing a validity gate, using a trend pullback engine with limit-style entries and a range engine that fades stretched moves. Filt

Indicator v6 TrendMean reversion
Updated 3 weeks ago · MIT GitHub repository of Adaptive Signals V18
1 stars

A long-only strategy ported from a bot, intended for five-minute crypto charts. It buys dips when a reversal candle appears, a three-day trend gate is satisfied, and one of three paths holds: Z-score with RSI, Z-score with the lower Bollinger Band, or RSI with

Strategy v6 Mean reversionScalping
Updated 6 weeks ago · None stated GitHub repository of Crypto Mean Reversion

CH033 ORB+ Strategy

by sandovalchristian033
1 stars

A Pine v6 backtest strategy for the New York opening range on index futures. It marks the 09:30 to 09:45 range, then looks for a break by wick or close, a return inside the range, and a close across session VWAP in the opposite direction before entering. Stop

Strategy v6 Sessions & timeBreakout
Updated 2 months ago · None stated GitHub repository of CH033 ORB+ Strategy

Alien Wash

by XingHan98
1 stars

Alien Wash is a price-chart indicator that draws the latest green horizontal line at the previous candle high after an up close beyond a USD buffer, and the latest red line at the previous candle low after a down close beyond that buffer. A buy signal fires wh

Indicator v5 Support & resistanceOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Alien Wash
1 stars

Satoshi Clock is an overlay indicator for Bitcoin that uses two coordinates. The clock is the number of days since the latest halving, and the spring is how far price sits from a power law fitted only on past data. It draws a power-law corridor, shades cycle w

Indicator v6 Support & resistanceMean reversion
Updated 3 months ago · Custom licence GitHub repository of Satoshi Clock - Clock and Spring

Macro Dashboard

by tthanhvu002sgu
1 stars

A two-part macro valuation display drawn over the price chart, calculated on weekly data. The PnL Matrix compares price with volume-weighted cost bases over one to four years and ranks the average gap as a percentile over a lookback in weeks. The Valuator fits

Indicator v6 Screeners & dashboardsMean reversion
Updated 3 months ago · None stated GitHub repository of Macro Dashboard

Volumetric Regression Heatmap

by woodstock-tokyo
1 stars

An overlay indicator that fits a regression channel over a base period, optionally resizing the period with volatility, and fills parallel levels above and below it with a colour gradient based on traded volume. Optional mean reversion signals appear when pric

Indicator v6 VolumeMean reversion Repaints
Updated 3 months ago · None stated GitHub repository of Volumetric Regression Heatmap

Sentinel TA Score & Confluence

by FolahanWilliams
1 stars

An oscillator in a separate pane that combines RSI, MACD histogram, 50 and 200 SMA trend, Bollinger position, volume ratio and gap behaviour into a composite score from minus 100 to plus 100. It also plots long and short confluence readings from 0 to 100, an o

Indicator v6 Oscillators & momentumMean reversion
Updated 4 months ago · None stated GitHub repository of Sentinel TA Score & Confluence

BB(10,2) MTF Confirm

by zraesdev-hub
1 stars

This overlay strategy trades a close and open below the lower Bollinger Band, using a period and multiplier set on the chart timeframe. An optional higher-timeframe Bollinger Band can confirm entries before orders are placed. Mode S1 exits at a percentage take

Strategy v5 Volatility & bandsMean reversion
Updated 4 months ago · None stated GitHub repository of BB(10,2) MTF Confirm
1 stars

An oscillator in a separate pane that applies fractional differencing to price and converts it to a rolling Z-score for one-minute Nasdaq futures. It looks for snapback entries after a deep extreme beyond the band, with the price turning back, and can add pric

Indicator v6 Mean reversionOscillators & momentum
Updated 4 months ago · None stated GitHub repository of FracDiff Z NQ 1m Quality Setups

Buy the Dip Futures 1000x

by PETERSAMUELOPS12
1 stars

A long-only dip-buying strategy for leveraged futures. Entries fire when price falls a set share of its recent high, with the depth optionally scaled to the asset's own historical maximum dip, when price sits below an EMA by a set percentage, or after a MACD c

Strategy v6 Mean reversion
Updated 5 months ago · None stated GitHub repository of Buy the Dip Futures 1000x

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