Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 64)

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

PineForge — Terrace Pyramid

by pineforge-4pass
1 stars

This strategy plots the Trend EMA and Deep Terrace levels on the price chart to identify rising trends. It signals long pyramid entries in staged terraces when price crosses above the first, second, or third ATR-based levels during an upward trend, with up to

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Terrace Pyramid

Calculates and plots the Stoller Average Range Channel directly on the price chart. It constructs a middle baseline using a Simple Moving Average and projects upper and lower envelope bands based on the Average True Range scaled by a user-defined multiplier. I

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stoller Average Range Channel (STARCHANNEL)
3 stars

EMA Crossover 8/15 plots fast and slow moving averages directly on the price chart and detects crossover events. Users can switch between seven moving average types, including EMA, SMA, RMA, WMA, VWMA, SWMA, and ALMA, alongside custom period lengths. An option

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of EMA Crossover 8/15

GAIN28

by g-moe
3 stars

This indicator calculates an impulse momentum value by summing candle body differences (close minus open) divided by the minimum tick over a user-defined period. On the most recent bar, it draws forward projection lines into future time coordinates using timef

Indicator v5 Oscillators & momentumMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of GAIN28

MA5X_L

by hasnocool
106 stars

MA5X_L is a long-only trend-following momentum strategy built on weighted and simple moving averages combined with an ATR trailing exit. It calculates four moving averages (short, medium, long, extra-long WMA/SMA) and enters long trades when the short WMA cros

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of MA5X_L

This indicator measures symmetric mean absolute percentage error between a chosen price source and an exponential moving average of that source. Each bar it computes a symmetric percentage error, then averages those errors over the selected lookback with a cir

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Symmetric Mean Absolute %Error (SMAPE)

Prototype

by hasnocool
106 stars

This strategy overlays Supertrend-style ATR trailing stop levels on the price chart alongside multi-period moving averages, volume metrics, and Bollinger Bands. It flags trend direction changes using an ATR offset channel, plotting buy and sell signals directl

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Prototype

Rapid Fire

by hasnocool
106 stars

This strategy draws on the price chart and enters long when the open crosses above the Parabolic SAR and is above a 50-period simple moving average of close. It enters short on the opposite cross below that average. Offset prices of 0.5 percent and 1.5 percent

Strategy v4 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Rapid Fire

This indicator renders Ichimoku cloud components consisting of conversion line, base line, leading span A and leading span B. It tracks Tenkan-Kijun crosses and assigns a numeric score to each based on whether the cross occurs below, inside or above the Kumo c

Indicator v5 Moving averagesSupport & resistance
Updated 5 months ago · None stated GitHub repository of Ichimoku Cloud Weight Original

Simple MA 200 Cross

by hasnocool
106 stars

This strategy calculates a simple moving average of closing prices and executes a basic trend-following system on the main chart. It enters a long position when the closing price crosses above the moving average and exits the position when the price crosses be

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Simple MA 200 Cross

This strategy overlays buy and sell signals on the price chart by combining selectable RSI conditions, ADX trend rules, and EMA pullback filters. Users can configure the RSI mode, toggle global EMA trend filtering, enforce EMA pullback requirements, and limit

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of SirPoggy Simple and Effective RSI Strategy
99 stars

This indicator calculates the Triple Exponential Average oscillator as the percentage rate of change of a triple exponential moving average of the chosen source. It plots the resulting series as a single line in a separate pane. The period input sets the smoot

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Triple Exponential Average (TRIX)
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

Spread Entry Strategy

by hasnocool
106 stars

This strategy overlays bull and bear setup filters on the price chart. It compares a reference symbol, QQQ by default, on the daily timeframe with hot and cool percent-change levels, then combines RSI, DMI, three simple moving averages, Bollinger Bands, and Ke

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Spread Entry Strategy
106 stars

This strategy evaluates trade entries by combining Stochastic RSI crossovers with MACD momentum and three exponential moving averages (8, 15, and 50 EMAs). Positions are filtered by directional alignment across indicators and date ranges. Exits are managed via

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Stoch RSI Crossover Strat + EMA

Stochastic

by hasnocool
106 stars

This strategy combines a smoothed stochastic oscillator with three exponential moving averages. It opens a long position of 1000 units when the stochastic K line crosses above D and the 5-period and 15-period EMAs both cross above the 50-period EMA. It closes

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Stochastic

TTM Trend

by mihakralj
99 stars

TTM Trend plots an exponential moving average of a chosen source on the price chart and colors the line by the direction of its one-bar change. A positive change is green, a negative change is red, and an unchanged value is gray. Optional bands scale with the

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of TTM Trend

Session islastbar flatten

by pineforge-4pass
1 stars

This strategy enters long positions when a 9-period Simple Moving Average (SMA) crosses above a 21-period SMA during active market session hours. To avoid holding positions overnight, it automatically exits all open trades on the final bar of the session using

Strategy v6 Moving averagesSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of Session islastbar flatten

Session Ismarket NYSE RTH Gate

by pineforge-4pass
1 stars

A test strategy from a reference corpus that only trades during regular market hours as reported by the session variable. Within those hours it buys one unit when a 9-period simple moving average crosses above a 21-period one and closes the long on the opposit

Strategy v6 Moving averagesSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of Session Ismarket NYSE RTH Gate

Triple EMA Scalper

by hasnocool
106 stars

This strategy plots three moving averages on the price chart, although the calculations use simple moving averages despite the EMA title. It enters long when the fastest average crosses above the other two and short when it crosses below them, limited to the L

Strategy v4 Moving averagesScalping
Updated 2 years ago · GPL-3.0 GitHub repository of Triple EMA Scalper
3 stars

This indicator plots classic On Balance Volume in a separate pane. It accumulates volume according to the sign of each close change, then overlays a smoothing moving average. Users choose the average method among SMA, EMA, RMA, WMA, and VWMA, set its length, a

Indicator v5 VolumeOscillators & momentum
Updated 5 months ago · None stated GitHub repository of On Balance Volume

XAG strategy 1h

by hasnocool
106 stars

This overlay strategy is aimed at silver and combines a length-based simple moving average with a MACD-style histogram. Inside a user-set date window it looks for bullish or bearish candles aligned with the average and a rising or falling histogram. One mode a

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of XAG strategy 1h
3 stars

This overlay indicator plots ATR-based trigger, target and Fibonacci levels around a prior close taken from a higher timeframe chosen by the trading type. Day, multiday, swing, position and long-term modes map to daily through yearly data. Optional CALL and PU

Indicator v5 Volatility & bandsSupport & resistance Repaints
Updated 5 months ago · None stated GitHub repository of Saty ATR Levels + CALL/PUT

TArec_p02_UNT

by pineforge-4pass
1 stars

The strategy tests untested TA classes including ALMA, SAR and rolling correlation under bar magnifier. It enters long only when ALMA crosses above close, SAR flips below price and 20-period correlation of close and volume is positive. It exits long when SAR f

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of TArec_p02_UNT

SHORT eMACD

by g-moe
3 stars

SHORT eMACD is a short-only strategy that evaluates bearish momentum using MACD crossunders, exponential moving averages (EMA), and consecutive candle filters. It offers five configurable entry modes combining MACD signals and custom EMA candle logic. Users ca

Strategy v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of SHORT eMACD
3 stars

This indicator plots smoothed Heiken Ashi candles on the price chart using two stages of exponential moving averages. It computes smoothed open, high, low, and close values with adjustable lengths of 10. Bullish candles appear green and bearish candles appear

Indicator v5 Candlestick patternsTrend Repaints
Updated 5 months ago · None stated GitHub repository of Smoothed Heiken Ashi Candles
1 stars

This Pine Script strategy executes a dual moving average crossover system designed as a validation test for intraday order capping across exchange session rollovers. It calculates a 9-period fast SMA and a 21-period slow SMA, entering long on bullish crossover

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of US-equity Intraday Cap (Scaffold)

Wiener Filter (WIENER)

by mihakralj
99 stars

This indicator plots a Wiener filter of a chosen price source on the price chart. It estimates noise from squared differences over a lookback window, estimates signal power from a smoothed mean of squared deviations, and blends the source toward that mean with

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Wiener Filter (WIENER)

Chilllax Moving Averages with Qullamaggie Colors calculates and displays two configurable moving averages directly on the price chart. It evaluates the alignment and directional slope of both averages compared to their values a set number of bars ago. Based on

Indicator v4 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Chilllax Moving Averages with Qullamaggie Colors

Williams Alligator

by mihakralj
99 stars

Calculates and plots the classic Williams Alligator indicator using smoothed moving averages (SMMA / Wilder's RMA) with exponential warmup compensation. It computes three distinct smoothed lines: the Jaw, Teeth, and Lips, which are plotted directly on the main

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Williams Alligator
99 stars

This indicator plots the Williams Gator Oscillator in a separate pane. It builds three smoothed moving averages (jaw, teeth, and lips) from a chosen source, shifts each by its offset, and plots two histograms: the absolute gap between jaw and teeth above zero,

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Williams Gator Oscillator (GATOR)

SimpleBot

by g-moe
3 stars

SimpleBot is a Pine Script v4 overlay indicator that stores recent prior-bar opens and closes in rolling arrays and averages each series. It draws two horizontal lines on the price chart, one for the average open and one for the average close, both extended to

Indicator v4 Moving averagesSupport & resistance
Updated 5 months ago · None stated GitHub repository of SimpleBot
3 stars

The Directional Movement Index plots the Average Directional Index (ADX) along with the Positive Directional Indicator (+DI) and Negative Directional Indicator (-DI) in a separate pane. It calculates trend strength and direction from price changes using true r

Indicator v4 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Directional Movement Index

Elder Impulse System

by mihakralj
99 stars

Elder Impulse System plots a column series in a separate pane. It compares a 13-period exponential moving average with its previous value and a MACD histogram with its previous value. A rising EMA and rising histogram print 1, a falling EMA and falling histogr

Indicator v5 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Elder Impulse System
3 stars

The Divergence Scanner is an indicator that detects divergences using the Hull Moving Average. It calculates the high-low average price as the source and applies a Hull Moving Average with length 21 and a lookback of 2. Users can enable the display of Hull sup

Indicator v4 DivergenceMoving averages
Updated 5 months ago · None stated GitHub repository of Divergence Scanner

VWMA vs SMA Divergence

by pineforge-4pass
1 stars

This strategy tracks the difference between a Volume-Weighted Moving Average (VWMA) and a Simple Moving Average (SMA) of identical lengths. It enters a long position when the VWMA crosses above the SMA, and enters a short position when the VWMA crosses below t

Strategy v6 Moving averagesVolume
Updated 6 days ago · Apache-2.0 GitHub repository of VWMA vs SMA Divergence
3 stars

The OBV MACD Indicator calculates a volume-based momentum oscillator by combining On-Balance Volume with price standard deviation spread. It creates a synthetic price-volume shadow series, smooths it using an Exponential Moving Average, and applies a Moving Av

Indicator v4 VolumeOscillators & momentum
Updated 5 months ago · None stated GitHub repository of OBV MACD Indicator

Volume-Weighted MACD

by mihakralj
99 stars

This indicator plots a volume-weighted MACD in a separate pane. It subtracts a slow volume-weighted moving average of close from a faster one, then smooths that line with an exponential moving average to form the signal. A column histogram shows the gap betwee

Indicator v5 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Volume-Weighted MACD

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