Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 45)

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

Major Buy Setup

by dcaoyuan
55 stars

Major Buy Setup plots a 20-period and a 50-period simple moving average on the price chart. It marks a buy when the current bar is both a bullish engulfing candle and a bald bull candle, defined as a green candle whose upper shadow is no more than five percent

Indicator v5 Moving averagesCandlestick patterns Repaints
Updated 6 months ago · Apache-2.0 GitHub repository of Major Buy Setup

FairValueGap D003

by ruckard
13 stars

This strategy measures the distance between the current price and the opposite end of the latest fair value gap, entering trades on the expectation that price will fill the gap. It plots signals and execution levels directly on the price chart. Users can confi

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of FairValueGap D003

Calculates and plots a three-tiered moving average framework consisting of Fast, Base, and Anchor curves directly on the price chart. It evaluates moving average slopes, curvature, separation, and price extension to categorize market conditions into states suc

Indicator v6 Moving averagesTrend
Updated 3 days ago · MIT GitHub repository of MA Cascade Engine [WavesUnchained]
4 stars

This intraday strategy executes trades on the Nikkei 225 index based on exponential moving average crossovers restricted to Tokyo Stock Exchange trading hours (09:00 to 15:30 JST). Long and short positions are taken on fast and slow EMA crossovers during activ

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Nikkei Japan Strategy [trugurpala]

Rolling VWAP

by regalouisei
2 stars

The Rolling VWAP indicator calculates and overlays a rolling volume-weighted average price directly on the price chart. Unlike anchored or daily reset VWAPs, it calculates volume-weighted price over a continuous rolling time window defined by days, hours, and

Indicator v6 Moving averagesVolume
Updated 8 months ago · None stated GitHub repository of Rolling VWAP

HMA sweete

by mushroom-men-Trading
2 stars

The HMA sweete indicator computes multiple variants of the Hull Moving Average including standard HMA THMA EHMA and custom z- versions with added momentum. Users can select the source series MA type length multiplier and history bars for up to three MAs. It pl

Indicator v6 Moving averages
Updated 9 months ago · None stated GitHub repository of HMA sweete
1 stars

This long-only strategy identifies trading opportunities using anchored VWAP reclaims, retests, and breakouts. It calculates VWAP with standard deviation bands alongside zero-lag EMA slope filters to verify market trend alignment. Entries trigger either from a

Strategy v6 TrendMoving averages Repaints
Updated 4 days ago · None stated GitHub repository of VWAP Reclaim (LONG-only)

MA Stack Array

by pineforge-4pass
1 stars

This strategy calculates three simple moving averages with lengths 10, 20 and 50. It identifies a bull stack when the shortest exceeds the middle which exceeds the longest, and a bear stack in the opposite direction. A var-bool latch tracks prior states to sup

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of MA Stack Array

6/20 Cloud Flip

by vedkanani123
1 stars

A small price-chart indicator that plots a fast and a slow exponential moving average, defaulting to 6 and 20 periods, and fills the space between them with a cloud. The cloud is green while the fast average is above the slow one and red otherwise, so a colour

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of 6/20 Cloud Flip

Hampel Filter

by everget
947 stars

The Hampel Filter indicator identifies and filters out price outliers to smooth price data directly on the main chart. It calculates the rolling median and Median Absolute Deviation (MAD) of the chosen source series over a specified length. When a data point e

Indicator v4 Moving averagesVolatility & bands
Updated 12 days ago · GPL-3.0 GitHub repository of Hampel Filter
257 stars

Calculates three weighted moving averages (11-period, 48-period, and 200-period WMAs) to evaluate market trend conditions directly on the price chart. It monitors crossovers between price and WMAs as well as crossovers between the moving averages themselves to

Indicator v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Snag - NEW SWING FAST
228 stars

This indicator computes moving average and RSI bias signals across the current timeframe and four higher timeframes. It sums biases from the MA and RSI to derive an overall bullish or bearish signal. The results appear in a configurable table that displays eac

Indicator v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of Multi-Timeframe Analysis Template

This indicator calculates a Gaussian-weighted moving average of a chosen price source and plots it on the price chart. It builds a finite impulse response window, weights past bars with a normalized Gaussian bell, and returns the weighted mean. Period sets the

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Gaussian-Weighted Moving Average (GWMA)

This indicator classifies market state into bull, bear, or neutral regimes using three moving averages and ATR-based stop bands plotted directly on the price chart. It evaluates alignment across customizable MA types (SMA, EMA, DEMA, TEMA, or JMA) and filters

Indicator v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of MA Regime Bands [WavesUnchained]

VuManChu B Divergences

by jerryinyang
5 stars

The VuManChu B Divergences indicator combines a WaveTrend oscillator with a Money Flow Index calculation to analyze market momentum and volume flow. It plots dual WaveTrend curves alongside overbought and oversold levels in a separate indicator pane, highlight

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of VuManChu B Divergences

MTF EMA + MACD

by krosenfeld7
5 stars

This indicator plots two multi-timeframe exponential moving averages on the price chart and calculates a MACD from the chart source. It marks Long when the shorter-timeframe EMA is above the longer one and a counted sequence of MACD and signal crosses reaches

Indicator v4 TrendMoving averages Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of MTF EMA + MACD
4 stars

This strategy calculates fast and slow exponential moving averages, the Relative Strength Index, and the Average True Range directly on the price chart. It enters long positions when the fast EMA crosses above the slow EMA with RSI above the minimum threshold

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of NQ Nasdaq Strategy [trugurpala]

HMACCI

by mushroom-men-Trading
2 stars

The HMACCI indicator calculates multiple Hull Moving Averages with variants including Hma, Thma, Ehma and Rmahma. It plots colored line signals on the price chart based on source close, lengths, multipliers, offsets and history bars. Users adjust MA types, len

Indicator v6 Moving averages
Updated 9 months ago · None stated GitHub repository of HMACCI

Gucci 1.0

by wynnforthework
2 stars

Gucci 1.0 is a Pine Script strategy that identifies trend reversals using 55 EMA and 200 EMA crossovers combined with custom high and low levels from recent closes. It plots open, close, high/low period values, and both EMAs on the price chart. Long signals fi

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Gucci 1.0
1 stars

This indicator detects long-only trading setups centered on volume-weighted average price (VWAP) reclaim sequences. It calculates VWAP with standard deviation bands, tracking slope and price bias through an exponential moving average. Signals trigger on either

Indicator v6 TrendMoving averages
Updated 4 days ago · None stated GitHub repository of VWAP Reclaim (LONG-only) Indicator

GrimmTurtleTest

by GreyssonEnterprises
1 stars

A Pine v4 indicator that combines several tools on the price chart: smoothed moving averages of 21, 50, 100 and 200 bars, a trend fill between a fast EMA and the 200 line, a three-line strike candle pattern and engulfing candle markers. A configurable trading

Indicator v4 Moving averagesCandlestick patterns
Updated 3 months ago · MIT GitHub repository of GrimmTurtleTest

Moving Average Simple

by ivansoft
1 stars

Plots a simple moving average on the price chart with adjustable length, source and offset. An optional second smoothing line can be added to the result using SMA, EMA, SMMA, WMA or VWMA, or SMA with Bollinger Bands whose width follows a multiplier. The defaul

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Moving Average Simple
1 stars

An overlay indicator that is one component of a weighted scoring system. It draws a 200-bar trend EMA and four shorter EMAs of 9, 21, 55 and 100 bars, with fills between price and each average coloured by slope. It also converts the trend into weighted scores:

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Neural Network Sub 11 Trend EMA

Snag - No Repaint ES 1m Strategy Candle Bar is an overlay strategy designed for short-term futures trading. It calculates custom price aggregations, pivot levels, and averages across multiple higher timeframes including 3-minute, 5-minute, 8-minute, and 10-min

Strategy v5 BreakoutMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of Snag - No Repaint ES 1m Strategy Candle Bar
47 stars

This indicator plots a Hamming-window finite impulse response moving average of a chosen price source on the price chart. It weights recent bars with the Hamming cosine window, renormalizes by the sum of weights, and uses only bars available during warm-up so

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Hamming Moving Average (HAMMA)
5 stars

MTF EMA + MACD Long Strategy is a trend-following long-only strategy that combines higher-timeframe Exponential Moving Averages with MACD crossovers. It calculates two multi-timeframe EMAs to establish overall trend direction and uses MACD crossovers to genera

Strategy v4 TrendOscillators & momentum Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of MTF EMA + MACD Long Strategy

Sniper Algo

by TamTH-Dev
2 stars

Sniper Algo is a multi-indicator technical analysis suite that plots directly on the main price chart. It integrates Ichimoku Kinko Hyo components, automated support and resistance zones, dual exponential moving averages, and optional buy and sell signals. Use

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Sniper Algo

Holt-Winters Moving Average (HWMA)

by mushroom-men-Trading
2 stars

The Holt-Winters Moving Average (HWMA) indicator applies a triple exponential smoothing algorithm to track price trends by filtering noise while maintaining responsiveness. It computes level, velocity, and acceleration components from a chosen price source ove

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Holt-Winters Moving Average (HWMA)
2 stars

Hull + Volatility + Boom Hunter is a strategy overlay that combines Hull Moving Average variations with Boom Hunter oscillator components. Drawn directly on the main price chart, it tracks market trend direction and momentum. Settings allow switching between s

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Hull + Volatility + Boom Hunter

Combination by yzz

by webcrack4
1 stars

Combination by yzz is an overlay indicator that scans for regular and hidden divergences across multiple technical oscillators simultaneously, including RSI, MACD, Stochastic, CCI, OBV, CMF, MFI, Momentum, and VW-MACD. It identifies pivot points on price and i

Indicator v4 DivergenceOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Combination by yzz
947 stars

The Holt Exponential Moving Average (HEMA) indicator calculates a trend-following line using double exponential smoothing. It accounts for both level smoothing via the alpha length and trend adjustment via the gamma length. The indicator overlays directly on t

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Holt Exponential Moving Average

Snag - SPY

by dearvn
257 stars

Snag - SPY is an overlay indicator that tracks market trends using three Weighted Moving Averages (WMA 13, WMA 48, and WMA 200). It plots the three WMAs directly on the main price chart and calculates crossovers between price and the moving averages, as well a

Indicator v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Snag - SPY
228 stars

This indicator calculates and plots trend direction across four customizable timeframes in a separate pane. It evaluates whether the close is above or below a moving average for each timeframe, assigning directional values that sum into an aggregate alignment

Indicator v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of Multi-Timeframe Trend Alignment
47 stars

This indicator plots a Hanning-window finite impulse response moving average of a selected price source on the price chart. It weights the lookback with the classic raised-cosine Hanning coefficients, rebuilds those weights when the effective window grows duri

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Hanning Moving Average (HANMA)
5 stars

This short-only strategy combines multi-timeframe exponential moving averages with MACD crossovers to find bearish trade opportunities. It calculates and plots two higher-timeframe EMAs directly on the price chart while monitoring MACD line crosses and zero-li

Strategy v4 Moving averagesOscillators & momentum Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of MTF EMA + MACD Short Strategy
3 stars

The CSW Ø-Lag Oscillator is a modified MACD indicator designed to reduce lag using zero-lag moving averages and a custom leader calculation. It plots a zero-lag line, a lagging signal line, and a histogram in a separate pane. The oscillator uses three distinct

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of CSW Ø-Lag Oscillator

SSL Algo

by TamTH-Dev
2 stars

SSL Algo calculates and displays multi-moving-average SSL hybrid channels directly on the price chart. It combines a customizable baseline, a continuation channel, an exit indicator, and optional ATR bands alongside support EMAs. Users can toggle baseline line

Indicator v5 TrendMoving averages
Updated 6 weeks ago · None stated GitHub repository of SSL Algo

Momentum Indicator Strategy

by wynnforthework
2 stars

This trend-following strategy generates long signals by combining the Stochastic Momentum Index (SMI) with a Supertrend filter. It enters a long position when the SMI signal line crosses above an oversold threshold while the Supertrend indicates an uptrend. Po

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Momentum Indicator Strategy

Walk-Forward Lab

by jayadevrana
1 stars

Walk-Forward Lab is an educational overlay indicator that simulates trade execution and walk-forward testing directly within Pine Script. It evaluates EMA fast and slow line crossovers using ATR-based stop-loss levels and risk-reward ratio targets. A user-defi

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Walk-Forward Lab

Main Period Adaptive Cross

by pineforge-4pass
1 stars

A simple moving average crossover strategy, 10 against 30, that only trades when the chart timeframe is 15 minutes. On that timeframe it enters long when the fast average crosses above the slow one and short when it crosses below, reversing the position. On an

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Main Period Adaptive Cross

IWBDT Strategy Indicator

by GreyssonEnterprises
1 stars

An indicator version of a multi-timeframe breakout idea that checks 9 and 18 period EMA direction on three higher timeframes, with the chart timeframe optional. Trend agreement is shown through background colours with adjustable transparency. Inputs set a risk

Indicator v4 TrendBreakout Repaints
Updated 3 months ago · MIT GitHub repository of IWBDT Strategy Indicator

Combination by Yzz

by webcrack4
1 stars

Combination by Yzz is an overlay indicator that detects regular and hidden divergences across multiple technical oscillators, including RSI, MACD, Stochastic, CCI, Momentum, OBV, VWmacd, CMF, and MFI. It locates price pivots and plots divergence lines and labe

Indicator v4 DivergenceOscillators & momentum Repaints
Updated 9 months ago · None stated GitHub repository of Combination by Yzz

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