Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 4)

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

Estimates the mean-reversion half-life of price in bars by fitting an Ornstein-Uhlenbeck model with a rolling regression on log prices. A lookback input sets how many bars feed the regression, and the half-life is capped for display. Optional bands show the me

Indicator v5 Mean reversionVolatility & bands
Updated 6 months ago · None stated GitHub repository of Half-Life Estimator (O-U)
1 stars

This Pine Script strategy detects ICT smart money concepts including order test zones, fair value gaps, and wicks on BTC and XAUUSD price charts. It calculates swings using pivot high and low. Signals enter long or short when the order test zone is hit with su

Strategy v5 SMC / ICT / price actionCandlestick patterns
Updated 6 months ago · None stated GitHub repository of ICT v4-weinkya BTC Improved

Breadth Dip Buying

by AlanGuo
1 stars

A long-only strategy that combines a market breadth index, the percentage of stocks above their 50-day average, with a long moving average of 225 periods. When price is above the average, it buys if breadth drops below 25. In bear mode, which is off by default

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

This strategy identifies the Initial Balance session on the chart and detects confluence with VWAP levels for trade signals. It enters positions when price shows rejection at the confluence zone via a candle with sufficient wick to body ratio. The main setting

Strategy v6 Mean reversionSupport & resistance
Updated 7 months ago · MIT GitHub repository of IB + VWAP Confluence
1 stars

A Pine v5 long-only strategy that buys when RSI falls below an entry level and then trails an exit level behind the highest close using an ATR multiple. The position is closed when the close drops below that trailing level, which is drawn as a red line on the

Strategy v5 Mean reversionVolatility & bands
Updated 8 months ago · None stated GitHub repository of AU RSI + ATR Trailing Stop
1 stars

RI SHORT Manual is an overlay indicator for ES and NQ futures that outlines a discretionary short reversal setup. Levels are measured from the previous session close using a risk interval: an entry level above the anchor, with target and stop levels at fixed f

Indicator v6 Support & resistanceMean reversion
Updated 10 months ago · None stated GitHub repository of RI SHORT Manual REVERSAL_TOUCH

This indicator, drawn in a separate pane, pulls Bitcoin and Ethereum prices from two user-chosen symbols, forms the BTC to ETH price ratio and converts it to a z-score against a rolling average and standard deviation (30 bars by default). Upper and lower thres

Indicator v5 Mean reversionOscillators & momentum
Updated 11 months ago · None stated GitHub repository of BTC/ETH Pairs Trading Z-Score & RSI/MACD

A second variant of a reversal strategy for a 15-minute TRUMP perpetual swap chart. It reacts to candles whose range exceeds a larger percentage threshold than version one, entering with a limit order against the candle direction. Take profit, stop loss, slipp

Strategy v6 Mean reversionVolatility & bands
Updated 1 year ago · None stated GitHub repository of TRUMP 15m Large Range Reversal v2

A price-chart overlay that combines several tools. It draws a Nadaraya-Watson kernel envelope with a repainting smoothing option, a Hull moving average band in three variants that can optionally come from a higher timeframe, and an ATR trailing stop in the sty

Indicator v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of UT Bot, Nadaraya-Watson, Hull Suite and Reversal Combo

BTCDOM Best Position

by theteelek
1 stars

A long-only accumulation strategy that buys near the lower edge of a smoothed channel built from an EMA of the highest high and lowest low over an adjustable range. A buy fires when price touches the lower line while RSI turns up from an oversold reading, limi

Strategy v6 Mean reversion
Updated 1 year ago · None stated GitHub repository of BTCDOM Best Position

Bollinger Bands

by Studentcodee
1 stars

This strategy plots Bollinger Bands directly on the price chart. It computes the middle band as the simple moving average of the close price over the input length and the upper and lower bands by multiplying the standard deviation by the multiplier and adding

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

Measures how far price has moved from its 50-period moving average in multiples of ATR percent, using daily data. A dot is plotted when the distance exceeds a chosen multiple, with ten as the default, and an optional info table shows the readings. Settings cha

Indicator v5 Volatility & bandsMean reversion
Updated 1 year ago · None stated GitHub repository of ATR% Multiple from 50-MA
1 stars

Calculates standard Bollinger Bands alongside the Relative Strength Index (RSI) directly on the main price chart. It plots the upper band, lower band, and simple moving average midline. An upward green arrow signals potential long setups when price crosses bac

Indicator v5 Volatility & bandsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Bollinger Bands & RSI with Arrow

Gravity Points

by yankeexlr
1 stars

An overlay that tracks a multi-step sequence of conditions using RSI and simple moving averages. It flags bearish candles that close while RSI is below 20, remembers the low of the latest such candle, notes when price crosses above the 50-period average, and t

Indicator v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Gravity Points

Ari zScore

by alessioricco
1 stars

Ari zScore calculates a z-score as the difference between a fast and a slow simple moving average of close, divided by the standard deviation of close. It plots numbered triangles above and below price bars when that value enters fixed magnitude bands, optiona

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · Apache-2.0 GitHub repository of Ari zScore

KC Integration

by Sikako
1 stars

KC Integration is a trading strategy that calculates multiple sets of Keltner Channels tailored for both trend-following and counter-trend conditions. It plots upper, middle, and lower channel bands directly on the main price chart to identify potential breako

Strategy v5 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of KC Integration

HWAP

by nvFede
1 stars

A Pine v4 indicator in a separate pane that measures how far the close sits from a 50-bar Hull moving average, scaled by the rolling standard deviation of that distance, which makes it a z-score style oscillator. Dotted lines mark plus and minus one, and zones

Indicator v4 Mean reversionMoving averages
Updated 3 years ago · None stated GitHub repository of HWAP

Tobacco

by 0xfffangel
1 stars

An overlay that builds a Kaufman adaptive moving average of price as a center line and surrounds it with three bands above and below, scaled from an adaptive average of true range. The band length and the three deviation multipliers are adjustable, and the zon

Indicator v5 Volatility & bandsMean reversion
Updated 4 years ago · None stated GitHub repository of Tobacco

This indicator plots a Donchian channel with a long default period of 1440 bars, its midline and a 250-period simple moving average on the price chart. When a high reaches the upper band, or a low reaches the lower band, on volume above a multiple of its movin

Indicator v4 BreakoutMean reversion
Updated 4 years ago · MIT GitHub repository of Greeffer's Donchian Channel Study

2xTP, SL to Entry

by hasnocool
106 stars

This strategy executes mean-reversion trades based on Bollinger Bands and the Stochastic Oscillator. Long orders trigger when price dips below the lower band alongside a bullish Stochastic crossover, with an optional oversold threshold. Short orders execute on

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 2xTP, SL to Entry

FVG RSI Strategy (Translated)

by skywalker0803r
42 stars

This strategy overlays two exponential moving averages on the price chart to trade reversals using custom Fair Value Gaps and the Relative Strength Index. It enters long trades when price closes bullishly below both moving averages with an oversold RSI and a g

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

Greeffer BB Strategy

by SammyEnigma
18 stars

This strategy combines Bollinger Bands, Bollinger Band Width, and the Relative Strength Index (RSI) for mean-reversion trades. It enters long when price crosses below the lower band with oversold RSI, or when band width contracts under low volatility. Short en

Strategy v4 Mean reversionOscillators & momentum
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy
8 stars

This indicator detects contrarian inflection points and potential market reversals by combining sentiment, volume, and price action metrics directly on the price chart. It evaluates overbought and oversold conditions with the RSI and Stochastic oscillators, hi

Indicator v5 Oscillators & momentumVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of GCR Inflection Point Scanner

TR Basis Monitor

by Enesp4rl4k
7 stars

This indicator calculates the cost-of-carry fair value between futures and spot prices, measuring the basis and fair value deviation in basis points. Operating in a separate pane, it computes a rolling Z-score of deviation using moving averages and standard de

Indicator v6 Mean reversionVolatility & bands
Updated 7 days ago · MIT GitHub repository of TR Basis Monitor

RSI mean reversion

by broomva
5 stars

This strategy plots the relative strength index in a separate pane and trades mean reversion. It enters long when RSI crosses above the oversold level and enters short when RSI crosses below the overbought level. Opposite signals reverse the position. Size def

Strategy v5 Oscillators & momentumMean reversion
Updated 2 days ago · MIT GitHub repository of RSI mean reversion
5 stars

Calculates daily classical pivot points from the previous day's high, low, and close to identify intraday reversal setups within a defined trading session. Long signals fire when price comes within a configurable tick proximity to S1 and prints a bullish recla

Indicator v5 Support & resistanceMean reversion
Updated 5 months ago · Custom licence GitHub repository of Path C — Pivot-Point Bounce (Demo)

Antigravity Elite

by eltonaguiar
4 stars

Antigravity Elite is an overlay indicator that screens price with seven selectable components: Mercury Fear, Connors RSI-2, volatility-spike reversal, EMA stack, Supertrend, multi-sigma bands, and an optional funding proxy. Auto-Detect chooses one method, whil

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Antigravity Elite

Bollinger Band Strategy

by might-tree
4 stars

The Bollinger Band Strategy is a mean-reversion trading strategy designed to trade bounces off Bollinger Bands. It enters long positions when the closing price crosses above the lower band and short positions when it crosses below the upper band. Upon entry, t

Strategy v5 Volatility & bandsMean reversion
Updated 3 years ago · None stated GitHub repository of Bollinger Band Strategy
3 stars

This overlay indicator recreates short-setup conditions and audits their later outcomes on the price chart. It scores optional percent-surge, RSI overbought rollover, Bollinger exhaustion, volume spike, and EMA trend filters, then marks BASE or STRONG signals

Indicator v6 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Hedge Short Setup Outcome Auditor

This overlay indicator plots a 20-period Bollinger Band envelope with a two-standard-deviation width on the price chart. It marks a long bounce when price reclaims the lower band, 14-period RSI is between 30 and 70, 14-period ADX is above 25, and Binance BTCUS

Indicator v6 Volatility & bandsOscillators & momentum

fungi Bands [aifungi]

by mushroom-men-Trading
2 stars

This indicator draws three bands on the price chart from the highest and lowest prices over a chosen length, expanded by a long ATR times a deviation setting. It smooths the stored extremes into upper and lower bands and an average midpoint, then changes the m

Indicator v6 Volatility & bandsMean reversion
Updated 9 months ago · None stated GitHub repository of fungi Bands [aifungi]

Mean Reversion

by nxtaiapp
2 stars

This strategy executes mean-reversion trades using Bollinger Bands combined with a fast RSI oscillator and MACD confirmation. It enters long or short positions when price reaches band extremes during oversold or overbought RSI levels, with optional MACD trend

Strategy v5 Mean reversionScalping
Updated 11 months ago · MIT GitHub repository of Mean Reversion
2 stars

This strategy overlays Bollinger Bands and Keltner Channels on the price chart alongside an internal KDJ oscillator. It identifies a volatility squeeze when Bollinger Bands contract inside the Keltner Channels. Long entries trigger after price closes below the

Strategy v5 Volatility & bandsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of BB-Keltner Squeeze with KDJ strategy
2 stars

This strategy implements an automated dollar-cost averaging (DCA) trading system inspired by Market Cipher indicators. It calculates WaveTrend oscillator crossovers and a volume-weighted Money Flow index to trigger initial base orders, supporting both long and

Strategy v4 Oscillators & momentumMean reversion
Updated 5 years ago · None stated GitHub repository of MC Strategy - Aggressive

Oversold

by kat3samsin
2 stars

The oversold strategy identifies oversold conditions using the relative strength index with a 14 period. It applies an arithmetic linear moving average with a 20 period for trend filtering and requires the price to stay within 15 percent of this average. Stoch

Strategy v4 Mean reversionOscillators & momentum
Updated 5 years ago · MIT GitHub repository of Oversold

Calm Kamaz

by Va3elina
1 stars

A one-minute strategy for perpetual crypto contracts that buys sharp drops. Entry needs a low RSI on three-minute candles, a price a set percentage below the hourly high, and a fall over two hours. Up to six larger buys can follow lower down a fixed ladder, an

Strategy v5 Mean reversionScalping Repaints
Updated 2 days ago · None stated GitHub repository of Calm Kamaz
1 stars

A simulation indicator that adds a fixed monthly contribution to a cash pool and compares two ways of investing it on one symbol. The timed approach buys on Bollinger and MACD dip signals, or after idle cash waits a set number of bars. The regular approach inv

Indicator v6 Mean reversionScreeners & dashboards
Updated 3 days ago · None stated GitHub repository of Dip Mafia Timed HODL vs SIP
1 stars

A strategy visualizer, with no real orders, that tracks a 200-bar moving average of lows on the 1-hour timeframe. When price touches the average it arms, then marks long or short entries on a wick rejection seen on 5 or 15 minute candles, or a run of three sam

Indicator v6 Mean reversionSupport & resistance Repaints
Updated 2 weeks ago · None stated GitHub repository of MA200 Wick Rejection

RSI Based Strategy

by jaichaturvedi88
1 stars

A long-only mean reversion strategy for an Indian rupee account. It buys when RSI falls to 30 or below and closes the position when RSI reaches 80 or above. Order size is a fixed rupee amount divided by price, and orders are only placed within a hard-coded one

Strategy v6 Oscillators & momentumMean reversion
Updated 3 months ago · None stated GitHub repository of RSI Based Strategy

The Valuator

by tthanhvu002sgu
1 stars

A long-term valuation oscillator in a separate pane. It fits a log-price regression over a lookback, takes the deviation of price from that fair-value line, and converts it to a Z-score using EMA-based mean and deviation. Zones labelled gift, cheap, fair, expe

Indicator v6 Mean reversionScreeners & dashboards
Updated 3 months ago · None stated GitHub repository of The Valuator
1 stars

This strategy plots an anchored volume-weighted average price and two standard-deviation bands on the price chart. It buys dips below the inner band when a short RSI is oversold and an optional EMA trend filter agrees, and it can sell rallies above the inner b

Strategy v6 Mean reversionMoving averages
Updated 3 months ago · MIT GitHub repository of VWAP Reversion Bands [QuantForge]

BB(10,2) TP20 MTF

by zraesdev-hub
1 stars

A long-only Bollinger Band strategy intended for daily stock charts. It buys when the previous close was below the lower band, the current open is also below it, and no position is open. Mode S1 targets a large percentage gain on the same day and otherwise clo

Strategy v5 Mean reversionVolatility & bands
Updated 4 months ago · None stated GitHub repository of BB(10,2) TP20 MTF

FracDiff Z NQ 5m Filter Lab

by qmqvt44stq-del
1 stars

A fractional differencing Z-score oscillator in a separate pane, set up for testing optional entry filters on five-minute Nasdaq futures charts. Signal modes include the base snapback, a volume-exhaustion mode, a conservative mode and an early mode. Filters co

Indicator v6 Mean reversionOscillators & momentum
Updated 4 months ago · None stated GitHub repository of FracDiff Z NQ 5m Filter Lab
1 stars

A strategy that looks for mean-reversion entries when volume shows exhaustion, using wave comparison, volume rate of change or z-score detection plus several confluence checks, including a higher-timeframe volume ROC. It is designed for Renko charts, with Heik

Strategy v6 Mean reversionVolume Repaints
Updated 5 months ago · None stated GitHub repository of Volume Exhaustion Strategy (VES)

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