Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 2)

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

NSE Algo Trading System v1

by ArunTelegramBot
1 stars

A strategy for Indian stocks that lets the user choose one of five rule sets: SuperTrend with an EMA, an EMA crossover, RSI with MACD, a Bollinger Band squeeze, or a VWAP pullback. A time window in UTC limits trading to exchange hours. Risk management sizes by

Strategy v5 TrendOscillators & momentum
Updated 10 days ago · None stated GitHub repository of NSE Algo Trading System v1

Multi-Strategy Bot

by edwinlai2058
1 stars

A Pine v5 strategy, with Chinese input labels, that lets the user pick one of four setups: a short after an RSI overbought exhaustion, a long after an oversold reading, a Bollinger Band reversion, or a VWAP breakout with an EMA. Exits use three take-profit sta

Strategy v5 Mean reversionOscillators & momentum
Updated 12 days ago · None stated GitHub repository of Multi-Strategy Bot

Adaptive Signals V17

by Matthew-Eucaristo
1 stars

A crypto futures signal indicator in a separate pane that scores setups and only flags those passing a validity gate. It has a trend pullback engine using limit-order style entries and a range engine that fades stretched moves back toward the mean. Filters inc

Indicator v6 TrendMean reversion
Updated 3 weeks ago · MIT GitHub repository of Adaptive Signals V17

RSI Oversold Reversion

by monounsaturated
1 stars

This strategy calculates the relative strength index of the closing price and enters a long position when the RSI crosses above a user-set oversold level. It exits that long with a fixed absolute stop price and a fixed absolute limit price. The main settings c

Strategy v5 Oscillators & momentumMean reversion
Updated 4 weeks ago · MIT GitHub repository of RSI Oversold Reversion
1 stars

Identifies stop hunt sweeps where price wicks past recent pivot highs, pivot lows, or previous day high and low levels before closing back inside the range. It plots sweep markers, connecting level lines, and previous day levels directly on the price chart, wi

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 4 weeks ago · None stated GitHub repository of Liquidity Sweep Pro

RSI Oversold Recovery

by vamseeachanta
1 stars

Tracks RSI recovery from oversold territory on the price chart. RSI is calculated on the average of open, high, low and close, with a moving average of the RSI. When RSI drops below the oversold level the script shows a watch label, marks an alert after RSI cr

Indicator v5 Oscillators & momentumMean reversion
Updated 5 weeks ago · MIT GitHub repository of RSI Oversold Recovery
1 stars

An indicator that plots Bollinger Bands and labels candles whose wicks pierce the upper or lower band, using a body-to-wick ratio to decide what counts as a wick. It checks 15-minute, 1-hour and 4-hour data and can send alerts for the current timeframe or the

Indicator v6 Volatility & bandsMean reversion
Updated 6 weeks ago · MIT GitHub repository of Bollinger Band Wick Marker MTF
1 stars

An oscillator in a separate pane that estimates the Hurst exponent with rescaled range analysis over three window sizes, with optional bias correction and smoothing. Hysteresis around trend and mean-reversion thresholds classifies the market as trending, mean-

Indicator v5 Oscillators & momentumMean reversion
Updated 7 weeks ago · MPL-2.0 GitHub repository of AHM v2 Adaptive Hurst Regime

OCI Ollie Conviction Index

by ollieLiu1988
1 stars

Combines RSI, Stochastic RSI, MACD histogram and Bollinger Band position into one weighted score from -5 to +5 that gauges whether price looks stretched high or low. An optional MFI vote is off by default. Settings cover indicator lengths, sensitivity presets,

Indicator v6 Oscillators & momentumVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of OCI Ollie Conviction Index
1 stars

A strategy built around a session VWAP and ATR bands during the London window, 08:00 to 12:00 UTC by default. It looks for a pullback to an ATR band followed by a VWAP cross, filtered by an RSI threshold, and evaluates signals on confirmed bars. Stops and targ

Strategy v6 Sessions & timeMean reversion
Updated 7 weeks ago · None stated GitHub repository of EMP Session Momentum v6

MKUMARAN RRMS Strategy

by shadowmarketai
1 stars

A long and short strategy that finds the lowest low and highest high over a swing lookback of 20 bars. It enters long near the low or short near the high when the reward-to-risk ratio meets a minimum, sizing each trade from a capital figure and a risk percenta

Strategy v5 Support & resistanceMean reversion
Updated 2 months ago · None stated GitHub repository of MKUMARAN RRMS Strategy

Contra v6

by jayadevrana
1 stars

This Pine Script strategy fades exhaustion moves into the Pivot Point SuperTrend band. It buys when price stretches down into the band and sells when price stretches up, using touch, reversal or both triggers. Entries support pyramiding with configurable steps

Strategy v6 Mean reversionVolatility & bands
Updated 2 months ago · Custom licence GitHub repository of Contra v6

Research Alpha Subset

by woodstock-tokyo
1 stars

A Pine v6 indicator in a separate pane that plots seven research formulas, each as its own line. They combine drawdown from a recent high with relative volume, inverted short RSI values, a panic-sell reversal term, a five-bar return minus a share of the twenty

Indicator v6 Oscillators & momentumMean reversion
Updated 3 months ago · None stated GitHub repository of Research Alpha Subset

Mean Reversion + Trend Filter

by antonispaterakis
1 stars

A strategy that trades RSI reversals in the direction of a 200 EMA trend. It buys when RSI crosses up through the oversold level above the EMA and sells short when RSI crosses down through the overbought level below it. Each trade has an ATR-multiple stop, siz

Strategy v5 Mean reversionOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Mean Reversion + Trend Filter

Sentinel Intelligence Strategy

by FolahanWilliams
1 stars

A strategy that trades mean reversion using a composite score built from RSI, MACD, 50 and 200 SMA trend, Bollinger bands, Z-score and volume. Longs and shorts trigger when oversold or overbought readings agree with a confidence gate, with filters against buyi

Strategy v6 Mean reversionOscillators & momentum
Updated 4 months ago · None stated GitHub repository of Sentinel Intelligence Strategy

BB(10,2) + TP20 SameDay

by zraesdev-hub
1 stars

This strategy draws Bollinger Bands on the price chart and enters long when both the open and the close are below the lower band. Mode S1 exits the same day at a 20 percent take profit or forces a close if that target is missed. Mode S2 can hold for a set numb

Strategy v5 Volatility & bandsMean reversion
Updated 4 months ago · None stated GitHub repository of BB(10,2) + TP20 SameDay

Trade Signal Indicator

by ashishgkwd
1 stars

Trade Signal Indicator is an overlay script that combines three tools: an EMA crossover (13 and 48 by default), an adaptive trend finder channel and a Nadaraya-Watson envelope. Each can be enabled separately, and colours, deviation multiplier, bandwidth and so

Indicator v6 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Trade Signal Indicator

Pairs Trading Z-Score

by dcrown99
1 stars

An indicator in a separate pane that compares the chart symbol with a second symbol chosen in the settings. It takes the ratio of the two prices, optionally as a log ratio, and converts it into a rolling Z-score over a set window. Horizontal lines mark entry,

Indicator v5 Mean reversion
Updated 4 months ago · None stated GitHub repository of Pairs Trading Z-Score
1 stars

A fractional differencing Z-score oscillator in a separate pane for one-minute Nasdaq futures that adds a regime gate based on a three-vote model of directional efficiency, range expansion and VWAP slope, allowing entries only in a mean-reversion state. Furthe

Indicator v6 Mean reversionOscillators & momentum
Updated 4 months ago · None stated GitHub repository of FracDiff Z NQ 1m + HMM Policy A
1 stars

A strategy for crypto futures that combines a Hurst exponent estimate with a z-score, ADX, RSI and ATR to separate trending from mean-reverting conditions. It plots a 50-bar high and low as resistance and support lines and uses pivot-style levels for entries a

Strategy v5 Mean reversionTrend
Updated 4 months ago · MIT GitHub repository of QuantiFine v6 Pivot R2 S2

BWC Mean Reversion v5

by tonimaxx
1 stars

A long-only strategy for stocks that buys when a very short RSI is below a threshold, the close is under the lower Bollinger Band, price is above a 200-period SMA, the opening gap down is small and average dollar volume clears a floor. It closes the position w

Strategy v5 Mean reversion
Updated 5 months ago · Custom licence GitHub repository of BWC Mean Reversion v5

SMC + VWAP Edge Strategy

by StockPro-AI
1 stars

This strategy combines Smart Money Concepts with Order Blocks and Fair Value Gaps alongside multiple VWAP levels including session, weekly, monthly, and anchored variants. It detects confluence zones to generate long and short entry signals on the price chart.

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · None stated GitHub repository of SMC + VWAP Edge Strategy
1 stars

This indicator screens daily price charts to identify potential parabolic snapback short and washout bounce long setups. It calculates price extension using moving averages, percentage gain lookbacks, and optional Bollinger Bands filters. Long signals require

Indicator v6 Mean reversionVolume
Updated 7 months ago · None stated GitHub repository of Parabolic Snapback & Washout
1 stars

An oscillator pane that plots a Bollinger Band z-score as coloured columns with reference lines at plus and minus two and three. Colour depends on a volatility regime taken from the percentile rank of band width, separating squeeze, normal and expansion. It al

Indicator v5 SMC / ICT / price actionVolatility & bands
Updated 8 months ago · MIT GitHub repository of 15m BB-SMC Confluence Oscillator
1 stars

A Pine v5 strategy that classifies the market as volatile, trending or ranging using ATR against its history and ADX thresholds. In trending conditions it trades a 9 and 20 EMA crossover, and in ranging conditions it fades Bollinger Band extremes. Stops and ta

Strategy v5 TrendMean reversion
Updated 8 months ago · None stated GitHub repository of APSAlgo Adaptive Pattern System

Agentic AI Trading Indicator

by Algorithmic-Token
1 stars

A price-chart indicator that draws two simple moving averages, Bollinger Bands and an RSI-based condition set, then prints buy and sell labels when a trend condition and a pullback condition agree. A signal strength value from zero to one counts confirmed cond

Indicator v5 TrendMean reversion
Updated 8 months ago · Custom licence GitHub repository of Agentic AI Trading Indicator

Mean Reversion Trading Bot

by BenjaminLettner
1 stars

This strategy executes mean-reversion trades by combining RSI momentum, Bollinger Bands volatility, dynamic ATR stops, and Exponential Moving Averages for trend filtering. It seeks entry opportunities when price reaches extreme Bollinger Band boundaries alongs

Strategy v5 Mean reversionOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Mean Reversion Trading Bot
1 stars

A Pine v5 long-only strategy that switches behavior with an ADX trend reading. When ADX is above the threshold it buys on a fast EMA crossing above a slow EMA, and when ADX is below it buys on RSI under 30. It closes the long on the opposite EMA cross in trend

Strategy v5 TrendMean reversion
Updated 8 months ago · None stated GitHub repository of AU Adaptive Regime Switch

Crypto Entry Signal

by caizongxun
1 stars

A Pine v5 indicator that draws Bollinger Bands on the price chart and marks buy and sell triangles. A buy appears when volume is above its 20-bar average by a set multiplier, the band basis is rising, and price touches the lower band or breaks below it and clo

Indicator v5 Volatility & bandsMean reversion
Updated 9 months ago · None stated GitHub repository of Crypto Entry Signal

Dynamic DCA Equities/Gold

by LucasRibeiroCaetano
1 stars

A Pine v5 indicator that works on any chart by reading the S&P 500 to gold ratio on the weekly timeframe. It compares the ratio to its 200-week simple moving average and sets a regime only after 30 consecutive weekly closes on one side. Above the average it ti

Indicator v5 Screeners & dashboardsMean reversion
Updated 9 months ago · None stated GitHub repository of Dynamic DCA Equities/Gold

ES Professional Fade

by knectardev
1 stars

An ES futures fade strategy designed to trade market opening gaps during regular trading hours. It calculates opening gaps using percentage, point, and ATR thresholds while employing a market breadth TICK filter to veto trades on trend days. It features an exe

Strategy v6 Sessions & timeMean reversion
Updated 9 months ago · None stated GitHub repository of ES Professional Fade
1 stars

This mean-reversion strategy identifies deep price drops following a multi-bar low, such as a 52-week low. It calculates a target threshold located a specified percentage below the period low and triggers a buy entry when price plunges to this oversold level.

Strategy v6 Mean reversionSupport & resistance
Updated 9 months ago · MIT GitHub repository of Super Oversold (52 Week Low Version)
1 stars

RI LONG Levels is an overlay indicator for ES and NQ futures that sets out a manual long reversal plan. It anchors on the previous session close, then draws an entry level at a chosen multiple of a risk interval below the anchor, with a target and a stop level

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

TXF Choppy Detector

by amytsengtw
1 stars

The TXF Choppy Detector is an indicator that identifies choppy or sideways markets in Taiwan index futures using the Choppiness Index (CHOP). It plots Bollinger Bands on the price chart with customizable length and multiplier. The script detects washout signal

Indicator v5 Mean reversionVolatility & bands
Updated 10 months ago · None stated GitHub repository of TXF Choppy Detector
1 stars

This overlay strategy requires sequential confluence before it enters. A hybrid detector blends selected oscillators, including RSI, CCI, MFI, Bollinger percent B and Keltner percent K, and treats extreme overbought or oversold readings as the market regime. V

Strategy v6 Oscillators & momentumVolatility & bands
Updated 10 months ago · None stated GitHub repository of Stratégie Confluence Hybride-VMCB
1 stars

This strategy uses a fast and a slow simple moving average with the bar's price range. In its default long-only mode it buys when price sits below the fast average, in the lower part of the bar range, while staying above the slow average, and exits when price

Strategy v6 Mean reversionMoving averages
Updated 10 months ago · None stated GitHub repository of Mean Reversion Pro Strategy

Hybrid Pro Strategy

by bdrnjom007
1 stars

A Pine v5 strategy, with Arabic input labels, that counts bullish signals from several groups: Turtle-style breakouts, RSI and Bollinger Band mean reversion, EMA, MACD and ADX momentum, plus order blocks, fair value gaps and supply and demand zones. It enters

Strategy v5 BreakoutMean reversion
Updated 11 months ago · None stated GitHub repository of Hybrid Pro Strategy

A strategy written for a 15-minute TRUMP perpetual swap chart. When a candle's high-to-low range exceeds a percentage threshold, it places a limit order against the candle's direction, short after a green candle and long after a red one, at a price between the

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

AAPL Best Position

by theteelek
1 stars

A long-only strategy that accumulates a fixed quantity by buying near the lower edge of a smoothed channel. The channel is an EMA of the highest high and lowest low over an adjustable range. A buy fires when price touches the lower line while RSI is rising out

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

Raj Reversion Strategy

by LongVu219
1 stars

Measures how far price sits from an Arnaud Legoux moving average, shown as a percentage in a separate pane. The average length is scaled by the ratio between a chosen higher timeframe, 60 minutes by default, and the chart timeframe so values stay comparable ac

Indicator v6 Mean reversionOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of Raj Reversion Strategy
1 stars

Draws Bollinger Bands from up to three user-chosen timeframes at once on the price chart. For each timeframe it can show the basis line and bands at one, two and three standard deviations, with its own period, offset and colours. The average type can be SMA, E

Indicator v6 Volatility & bandsMean reversion
Updated 1 year ago · None stated GitHub repository of MTF Bollinger Bands TT (3BB)

ArminOscillator Strategy

by ali-derogar
1 stars

ArminOscillator Strategy is a strategy that applies a stochastic calculation to a long RSI, then smooths it into K and D lines. A long entry occurs when K crosses above D below 20 with price above a short SMA, or in a sideways case; a short entry mirrors this

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

Bollinger Bands Signals

by techteam92
1 stars

This indicator calculates custom Bollinger Bands using one of four selectable moving averages, defaulting to VIDYA. It plots the upper band, lower band, and basis line directly on the price chart, with a filled background between the outer bands. Buy and sell

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

BB_signal1

by subhrapratim07
1 stars

This indicator plots standard Bollinger Bands consisting of an upper band, lower band, and a simple moving average directly on the price chart. It calculates the Relative Strength Index to identify overbought conditions. A bearish signal displays as a red down

Indicator v5 Volatility & bandsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of BB_signal1

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