Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 51)

Open-source Pine scripts built on moving averages: EMA and SMA tools, ribbons, Hull and adaptive averages, and crossover strategies.

Pine scripts3,064
Code shown here1,765open licence
Updated in a year1,828
No repaint flag2,707

Moving averages: Indicators, Strategies and Libraries

330 stars

MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra

Strategy v4 Oscillators & momentumDivergence Repaints
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]
13 stars

Ruckard Kayseri B003 is a trend-following strategy designed to generate trade entries based on the interaction between a fast moving average and a main smoothed moving average. It incorporates customizable position management features, including fixed percenta

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Kayseri B003

VWAP and VWMA

by Web3Degenerate
2 stars

This indicator plots either a Volume Weighted Average Price (VWAP) or a Volume Weighted Moving Average (VWMA) directly on the price chart, coloring the line based on whether the close is above or below it. It generates trading signals by combining the trend fi

Indicator v5 Moving averagesCandlestick patterns
Updated 2 years ago · None stated GitHub repository of VWAP and VWMA

P_syn_strategy_full

by GammaExpansion
1 stars

P_syn_strategy_full is a crossover strategy that plots the 20-period simple moving average of close on the price chart. It generates long signals on crossover and short signals on crossunder. Long entries use limit and stop orders with 10 percent equity positi

Strategy v6 TrendMoving averages
Updated 7 days ago · MIT GitHub repository of P_syn_strategy_full
1 stars

This indicator plots detrended candlesticks in a separate pane relative to a chosen baseline to highlight market cycles around a zero line. Users can switch the baseline mode between a moving average and high/low extremes. In moving average mode, it subtracts

Indicator v5 Moving averagesOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of Detrended Candles (Switchable)
1 stars

A Pine v4 strategy based on a Guppy-style ribbon of 22 exponential moving averages: seven fast ones from 3 to 21 and fifteen slow ones from 24 to 66, with an optional 200 EMA. It trades when the ribbon groups line up in order, with an option for earlier signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Super Guppy Strategy
330 stars

This strategy plots a MACD line, signal line, and colored histogram in a separate pane. The fast and slow averages and the signal line can each use SMA or EMA. Optional markers show MACD and signal crosses. Pivot lookbacks scan the oscillator for regular and h

Strategy v4 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]

This strategy evaluates trades using an SMA baseline, Hull Moving Average trend filter, and ATR volatility conditions. It triggers long entries when price exceeds the baseline by an ATR qualifier distance while trading above the HMA trend bias, with an optiona

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias

The Ehlers 3-Pole Butterworth Filter calculates a smoothed low-pass trend line based on John F. Ehlers' 3-pole Infinite Impulse Response (IIR) filter design. It filters out high-frequency noise while minimizing lag compared to standard moving averages. The ind

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers 3-Pole Butterworth Filter (BUTTER3)

Conditional Colors

by be-thomas
65 stars

This script calculates a Simple Moving Average (SMA) of close prices and dynamically changes its plot color based on whether the average is rising or falling. When the SMA is higher than its previous bar value, it plots in the bullish color; otherwise, it uses

Indicator v4 Moving averagesTrend
Updated 6 days ago · GPL-3.0 GitHub repository of Conditional Colors

Hull Moving Average

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the standard Hull Moving Average (HMA) directly on the main price chart. The HMA aims to reduce lag while preserving smoothing by combining weighted moving averages over half-length and full-length periods, followed by a fin

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of Hull Moving Average

Gary - Levels

by g-moe
3 stars

Gary - Levels is a TradingView Pine Script v5 indicator that overlays multiple session-based VWAP calculations and high/low lines directly on the price chart. It plots an RTH VWAP line for the regular trading hours session (default 0930-1600 ET) and a full-ses

Indicator v5 Moving averagesSupport & resistance
Updated 5 months ago · None stated GitHub repository of Gary - Levels

An overlay indicator combining confirmed pivot highs and lows, RSI and two simple moving averages. It draws green and red levels from the latest pivot, and marks long signals when the high crosses above the long moving average with the close above it, and shor

Indicator v4 Support & resistanceOscillators & momentum
1 stars

TRXBTC EMA Cross Strategy is a trend-following cryptocurrency strategy that executes trades based on single Exponential Moving Average price positioning and candle color. It plots a customizable EMA on the main price chart and triggers a long position when a b

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of TRXBTC EMA Cross Strategy

This indicator calculates John F. Ehlers' 3-Pole Super Smoother Filter (SSF3), an advanced infinite impulse response filter designed to remove high-frequency market noise while retaining rapid responsiveness to price changes. It evaluates a selected input sour

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers 3-Pole Super Smoother Filter (SSF3)
13 stars

This strategy draws on the price chart and trades long, short, or both using simple moving averages of an ohlc4 source together with ADX and directional-index key levels. It can display a high and low closing moving-average ribbon and limit activity with optio

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Lunatic A003

Regularized EMA (REMA)

by mushroom-men-Trading
2 stars

The Regularized EMA indicator plots a single smoothed average of a chosen price source on the price chart. It blends an exponential moving average update with a regularization term controlled by lambda, where zero applies maximum smoothing and one matches a st

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Regularized EMA (REMA)

PF IES probe 05 - bb/kc squeeze

by pineforge-4pass
1 stars

This Pine Script strategy detects volatility squeeze releases using parallel Bollinger Bands and Keltner Channels calculated with length 20 and specified multipliers. It plots the bands and channels overlaid on the price chart. The strategy enters a long posit

Strategy v6 Volatility & bandsBreakout
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 05 - bb/kc squeeze
1 stars

This indicator plots three detrended price series and their moving averages in a separate pane. It converts a user-selected start and end time into a bar length, then builds simple moving averages of close at that length and at 1.618 and 0.618 multiples. Each

Indicator v5 Moving averages
Updated 7 weeks ago · None stated GitHub repository of Detrended Price + Detrended MAs

Pin Bar Magic v1

by Alorse
330 stars

This strategy trades price action pin bar patterns aligned with moving average trend alignment on the main price chart. It defines uptrends or downtrends using a fan arrangement of three moving averages (6 EMA, 18 EMA, and 50 SMA). Entry conditions require a b

Strategy v4 Candlestick patternsTrend
Updated 2 months ago · None stated GitHub repository of Pin Bar Magic v1

Malaysian SnR Kai[DoN]

by eddiebelaval
7 stars

Calculates and plots support and resistance levels using pivot high and pivot low structures based on Malaysian SnR concepts. It draws active support and resistance price zones, tracks role reversal lines when levels break, includes a simple moving average fil

Indicator v6 Support & resistanceMoving averages
Updated 3 months ago · None stated GitHub repository of Malaysian SnR Kai[DoN]
1 stars

This strategy plots a Vegas-style exponential moving average tunnel on the price chart, plus a 12-period EMA, a 240-period SMA, and Bollinger Bands. It also computes a MACD difference from 48- and 56-period EMAs. Long entries open on tunnel-average crosses or

Strategy v4 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Vegas Tunnel strategy
1 stars

A Pine v4 strategy that plots a 13-period exponential moving average of the close in orange on the price chart. It goes long when a green candle opens above the average and short when a red candle opens below it, closing each position when the opposite signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of UNIBTC EMA Cross Strategy

Vortex Bands

by everget
947 stars

The Vortex Bands indicator calculates a custom moving average basis from the selected source using a two-stage EMA approximation. It then plots an upper band as the basis plus a scaled deviation and a lower band symmetrically. The script fills the background b

Indicator v4 Volatility & bandsMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Vortex Bands

PivotHighLow

by Alorse
330 stars

This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition

Indicator v4 Support & resistanceOscillators & momentum Repaints
Updated 2 months ago · None stated GitHub repository of PivotHighLow

BB%B Strat

by hasnocool
106 stars

This strategy trades mean-reversion setups using the Bollinger Bands Percent Bandwidth (%B) oscillator plotted in a separate pane. It calculates upper and lower bands using a simple moving average and standard deviation multiplier. Long positions are entered w

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BB%B Strat

Notch Filter (NOTCH)

by mihakralj
47 stars

The Notch Filter is a second-order IIR digital filter designed to attenuate a specific cyclic frequency component from price data while leaving other frequencies intact. It computes a band-stop filter based on a target cycle period and relative bandwidth. The

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Notch Filter (NOTCH)

This overlay classifies the chart into bull, bear, or neutral regimes from moving-average zone position and an adaptive engine driven by the efficiency ratio and ATR entry and exit bands. A volatility percentile rank adds quiet, normal, or volatile context, pl

Indicator v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Regime Detector (MA Zones Overlay) [WavesUnchained]
1 stars

This strategy enters long when a fast EMA crosses above a slow EMA, the position is flat, a cooldown bar count has elapsed, and the day's trade count is below a cap. It closes that long when the fast EMA crosses back under the slow EMA. Inputs set both EMA len

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 07 - cooldown + daily cap

Keltner Channels

by TWODS-CAPITAL
37 stars

This indicator plots Keltner Channels on the price chart. It builds a basis from an exponential or simple moving average of a chosen source, then places upper and lower bands a multiplier away from that basis. Band width uses average true range, true range, or

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · MIT GitHub repository of Keltner Channels
1 stars

Dual MA Detrended Price calculates two detrended price series by subtracting simple moving averages from a chosen price source. It derives the moving average lengths by applying Golden Ratio multipliers of 1.618 and 0.618 to a configurable base length setting.

Indicator v5 Oscillators & momentumMoving averages
Updated 7 weeks ago · None stated GitHub repository of Dual MA Detrended Price
106 stars

BEAM DCA Strategy Monthly calculates long-term risk bands around a moving average baseline to implement a monthly dollar-cost averaging strategy. It normalizes asset risk between 0 and 1, placing buy orders when risk falls below 0.5 on a specific day of the mo

Strategy v5 Moving averagesSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of BEAM DCA Strategy Monthly

Keltner Channels Strategy

by TWODS-CAPITAL
37 stars

This strategy builds Keltner-style bands around an exponential or simple moving average of the chosen source. Band width uses average true range, raw true range, or a smoothed high-low range, scaled by a multiplier. When the source crosses above the upper band

Strategy v5 Volatility & bandsBreakout
Updated 3 years ago · MIT GitHub repository of Keltner Channels Strategy
13 stars

This strategy plots a Noro trend ribbon on the price chart and uses ribbon side changes to choose long or short direction. A corridor built from recent high and low prices filters entries: longs open below the corridor while the bias is long, and shorts open a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon

PSMC - Drawing Variable Values

by Web3Degenerate
2 stars

This indicator calculates the gap between the 100-period and 50-period exponential moving averages and converts that difference into ticks. It draws the result as text in a green label placed below the current bar on the price chart. Each new bar replaces the

Indicator v4 Moving averages
Updated 2 years ago · None stated GitHub repository of PSMC - Drawing Variable Values

PF IES Probe 09 - Integration

by pineforge-4pass
1 stars

PF IES Probe 09 - Integration is a multi-layered quantitative strategy designed to test interaction among market regime, trend bias, momentum, and price pressure. It computes an ADX and ATR volatility regime, a multi-EMA trend bias score, an RSI and MACD momen

Strategy v6 TrendOscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES Probe 09 - Integration
1 stars

A long-only strategy on the price chart built around a short simple moving average, 5 bars by default. It buys when a green candle opens above the average and sells when a red candle crosses below it. After entry, a stop order is placed at a percentage below t

Strategy v4 Moving averages
Updated 4 years ago · None stated GitHub repository of Uniswap SMA Strategy

The Zero Lag Exponential Moving Average indicator calculates and plots a moving average designed to minimize lag relative to price action. It achieves this by subtracting price data from a prior lag period prior to smoothing with an exponential moving average.

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Zero Lag Exponential Moving Average
13 stars

This strategy draws trend ribbons and price corridors directly on the price chart using configurable moving averages of highs, lows, and closes. It identifies trend direction from ribbon state changes and generates long entries when price drops below the corri

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon

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