Pine Library · 657 open-source scripts

Free Mean Reversion Pine Scripts (page 14)

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

BB-strategy

by hasnocool
106 stars

This strategy executes trades based on Bollinger Bands with optional filter conditions from RSI and MACD oscillators. It overlays on the price chart and plots MACD lines directly across the bars. Entries trigger according to band interactions combined with mom

Strategy v4 Volatility & bandsOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of BB-strategy

Big Bar Strategy

by hasnocool
106 stars

Big Bar Strategy identifies unusually large candles relative to a moving average of recent bar body sizes. It executes contrarian trades by opening long positions following a large bearish bar and short positions after a large bullish bar, with an optional con

Strategy v4 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Big Bar Strategy
1 stars

Time Machine is an overlay indicator that calculates historical price reflections using Fibonacci levels, SMA variants, Bollinger Bands, VWAP, and spiral spine methods. It plots symmetric price lines around dashed levels and dynamic indicator lines, plus area

Indicator v5 Support & resistanceMean reversion
Updated 7 weeks ago · None stated GitHub repository of Time Machine{Morindok}

Bolinger strategy

by hasnocool
106 stars

This long-only strategy combines a five-bar RSI with Bollinger percent B and bandwidth on the current close and the close three bars earlier. It opens a long when a local low around that earlier bar falls inside a bar-count window and current percent B stays i

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bolinger strategy

PF UDT probe 04 - default param

by pineforge-4pass
1 stars

This Pine Script strategy implements a custom long-only EMA crossover on the price chart. It defines a UDT struct Cfg with a threshold method that accepts default parameter values. The strategy computes RSI and ATR indicators then uses three call styles to the

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT probe 04 - default param

This strategy combines Volume Weighted Moving Average (VWMA) Bollinger Bands with 200-period and 50-period Exponential Moving Averages (EMAs). It identifies long trade opportunities when the 50 EMA is above the 200 EMA and price falls to or below the lower Fib

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with Fib Golden Ratio (0.618)
106 stars

This strategy plots RSI in a separate pane and combines it with Bollinger Bands calculated on the selected source. It opens a long when RSI is below 30 and price is below the lower band, then closes that long when RSI rises above 70. Percentage take-profit and

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with RSI
106 stars

This strategy combines Stochastic RSI and a normalized Bollinger Bands calculation into a composite oscillator named MIX, plotted in a separate pane. Long positions are entered when the MIX line crosses above the oversold threshold of 20. The strategy utilizes

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands and RSI Mix with DCA

PineForge - Relay Enum Regime

by pineforge-4pass
1 stars

This strategy executes trades based on one of two selectable regimes: trend-following or mean reversion. In trend mode, it enters long positions on a bullish EMA crossover and exits on a bearish crossover. In reversion mode, it buys when the RSI dips below an

Strategy v6 TrendMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Relay Enum Regime
106 stars

This strategy calculates a simple moving average basis flanked by three upper and three lower volatility bands scaled using Fibonacci ratios of the Average True Range. It enters long when the bar intersects a chosen target band and enters short when price touc

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Fibonacci Ratios

PineForge Atlas Array Rotation

by pineforge-4pass
1 stars

This strategy computes a rolling mean return over the last sampleCount bars and a price percent rank over rankLength bars. It also calculates RSI and ATR values. Long entries trigger when the price rank crosses above the entry rank threshold while the rolling

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Atlas Array Rotation

This strategy plots Bollinger Bands on the price chart using an EMA or SMA basis and a matching standard-deviation calculation. It enters long when price crosses back above the lower band and short when price crosses back below the upper band. An optional Intr

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy with Intraday Intensity Index

This strategy plots Bollinger Bands and an exponential moving average on the price chart. It enters long when price touches the lower band above the EMA and a bearish candle is followed by a bullish candle, and enters short on the mirrored upper-band setup. Ex

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Trending Reverse Strategy

Bollinger DCA v1

by hasnocool
106 stars

This strategy calculates Bollinger Bands and RSI to trigger dollar-cost averaging buy orders. It enters long positions whenever the closing price dips below the lower Bollinger Band while the RSI is below 50. Order units are calculated dynamically based on a f

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger DCA v1

Bottom Catch Strategy

by hasnocool
106 stars

This strategy attempts to capture temporary market dips by identifying high-volume spikes during oversold conditions. It enters a long position when volume exceeds a upper standard deviation channel based on its simple moving average while the RSI remains belo

Strategy v4 Oscillators & momentumVolume
Updated 2 years ago · GPL-3.0 GitHub repository of Bottom Catch Strategy

BT-5M-1H

by hasnocool
106 stars

BT-5M-1H is a mean-reversion strategy designed for 5-minute charts that simulates 1-hour Bollinger Bands to identify overbought and oversold conditions. It takes positions when price crosses standard deviation multiplier levels and exits using configurable log

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BT-5M-1H

Bulle de bollinger

by hasnocool
106 stars

Bulle de bollinger is a price-chart strategy that plots a 20-period simple moving average and two-standard-deviation Bollinger bands, with a fill between the bands. It enters long when the prior bar's open and close are below the lower band, and short when the

Strategy v4 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of Bulle de bollinger
1 stars

PineForge — Constellation Bands is a mean-reversion strategy displayed on the price chart. It calculates standard Bollinger Bands alongside price volatility. A long entry triggers when the close price crosses back above the lower band while remaining below the

Strategy v6 Mean reversionVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Constellation Bands
1 stars

This strategy uses RSI with bull and bear threshold crossovers to trade opposite market pairs. It enters long when RSI crosses above 58 and short when below 42, automatically closing the opposite position first. Entry size is 8 percent of equity with 0.05 perc

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Crosscurrent Market Pair

Buy The Dip

by hasnocool
106 stars

Calculates a historical dip level based on the lowest low over a specified lookback period. It enters a long strategy position when the current bar close falls below the previous dip level. Positions are managed with take profit and stop loss exits placed at f

Strategy v4 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dip
106 stars

Buy The Dips - MA200 Optimised is a mean-reversion strategy that measures short-term percentage price changes alongside a simple moving average trend filter. It opens long positions when price experiences a steep drop exceeding three percent while remaining ab

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dips - MA200 Optimised
106 stars

This trend-following strategy identifies buying opportunities during bullish pullbacks on the price chart. It defines a bull market when the 50-period simple moving average trades above the 200-period moving average. Long entries trigger when the RSI drops bel

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dips in Bull Market

Gap Filling Strategy

by regalouisei
2 stars

This strategy detects daily opening gaps and trades them on the price chart. It marks an up or down gap from the current open and close versus the previous bar, then stores the prior extreme as the fill level. By default it buys down gaps and shorts up gaps, e

Strategy v4 Mean reversionSessions & time Repaints
Updated 8 months ago · None stated GitHub repository of Gap Filling Strategy

PineForge — Ledger History NA

by pineforge-4pass
1 stars

This strategy plots a smoothed historical price anchor on the price chart by averaging historical closing prices. It enters a long position when price crosses under an entry threshold set below the smoothed anchor. The trade closes when price crosses back abov

Strategy v6 Mean reversionMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Ledger History NA
2 stars

This strategy plots in a separate pane and tests a selected oscillator with one of six entry logics: moving average, moving-average crossover, zero cross, extremes, mean reversion, or take profit. Users scale and time-adjust one of three oscillators and can li

Strategy v4 Oscillators & momentumMoving averages
Updated 8 months ago · None stated GitHub repository of Oscillator Evaluator (Analysis tool)
3 stars

This strategy combines two sets of Bollinger Bands with a Laguerre RSI oscillator plotted on the price chart. It generates buy and sell signals when price touches the upper or lower bands or zones. The strategy allows enabling or disabling entries and includes

Strategy v5 Mean reversionVolatility & bands
Updated 5 months ago · None stated GitHub repository of BB + LaRSI Strategy

Highs and lows

by hasnocool
106 stars

Calculates dynamic entry and exit price levels based on rolling lowest and highest bars with optional Average True Range (ATR) offsets. It places limit orders to enter long positions at the lowest price level and exits at the highest price level. An optional t

Strategy v4 Mean reversionSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Highs and lows
3 stars

Kane Bollinger Bands calculates and plots traditional Bollinger Bands alongside a percentage change plot for upper band movement directly on the main price chart. It establishes a Simple Moving Average basis line and generates upper and lower channel boundarie

Indicator v5 Volatility & bandsMoving averages
Updated 5 months ago · None stated GitHub repository of Kane Bollinger Bands

RSI with Bollinger Bands

by pineforge-4pass
1 stars

Calculates the Relative Strength Index (RSI) and wraps Bollinger Bands directly around the RSI series rather than price. It enters long positions when the RSI drops below its lower band and hooks back upward, and enters short positions when the RSI exceeds the

Strategy v6 Oscillators & momentumVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of RSI with Bollinger Bands

Stochastic RSI

by pineforge-4pass
1 stars

This strategy calculates a smoothed Stochastic RSI oscillator and generates trading signals based on overbought and oversold crossovers. It opens a long position when the %K line crosses above %D while below the oversold threshold, and enters short when %K cro

Strategy v6 Oscillators & momentumMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of Stochastic RSI

RSI Strategy

by g-moe
3 stars

The RSI Strategy calculates the Relative Strength Index with a user-defined length. It generates long entries on crossover above the oversold threshold and short entries on crossover below the overbought threshold. The strategy overlays signals directly on the

Strategy v5 Oscillators & momentumMean reversion
Updated 5 months ago · None stated GitHub repository of RSI Strategy

VCP probe 02 fvg zones

by pineforge-4pass
1 stars

This strategy detects Fair Value Gaps on the price chart using 3-bar candle imbalances filtered by ATR. It maintains a capped array of active FVG zones with their tops, bottoms, and bullish flags. Long entries occur when the current bar overlaps an active bull

Strategy v6 SMC / ICT / price actionCandlestick patterns
Updated 6 days ago · Apache-2.0 GitHub repository of VCP probe 02 fvg zones

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