Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 34)

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

MACD Cross Strategy

by Web3Degenerate
2 stars

This strategy executes trades based on the initial MACD line crossover in the direction of the long-term trend defined by a 200 EMA filter. Position risk is calculated using a lookback swing high or low padded by an ATR multiple. The trade features a dual take

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of MACD Cross Strategy

Mean Deviation Trail

by vedkanani123
1 stars

An overlay indicator that measures how far price sits from a central EMA, smooths that signed deviation with a selectable moving average, and uses a mean absolute deviation measure to scale a trailing band. The multiplier is tight when deviation is strong and

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Mean Deviation Trail
1 stars

This strategy combines trend, volatility, and multi-oscillator filters to generate directional trades. It calculates an Arnaud Legoux Moving Average (ALMA), Keltner Channels, Bollinger Band width, the Chande Momentum Oscillator (CMO), Money Flow Index (MFI), a

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Channel Momentum Suite
1 stars

The HybridAlgo Multi-Indicator Strategy calculates signals from moving average crossovers, RSI, MACD, and Bollinger Bands. Long and short entries trigger when at least three signals align for confluence. It sets stop loss at three times ATR below entry and tak

Indicator v5 TrendOscillators & momentum Repaints
Updated 8 months ago · None stated GitHub repository of HybridAlgo Multi-Indicator Strategy
1 stars

An overlay indicator that builds a zero-lag moving average by adding the gap between price and its EMA back to price and smoothing again, then compares it with a plain EMA. Crossovers give up and down signals and the lines change colour with direction. A box i

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Zero-Lag MA Trend Levels

DMI Improve

by JohnsonHsiao
1 stars

This indicator improves the standard Directional Movement Index by adjusting plus and minus directional movement calculations with a weight factor and SMA adjustments for sensitivity. It calculates and plots improved DI+ and DI- lines in a separate pane. Setti

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of DMI Improve
257 stars

This indicator plots a 200-period weighted moving average (WMA) on the main chart and monitors price deviations across multiple timeframes. It retrieves daily, 15-minute, 5-minute, and 2-minute price data to track distance from the 200 WMA relative to key sess

Indicator v5 Moving averagesSessions & time Repaints
Updated 7 weeks ago · None stated GitHub repository of Donald SPX - Options Trading
114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)

Conditional colors

by be-thomas
65 stars

This script calculates a simple moving average of closing prices over a specified length and dynamically changes its plot color based on the direction of the average. When the moving average value is rising compared to the previous bar, the line displays the s

Indicator v5 TrendMoving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Conditional colors

Divergenced D002

by ruckard
13 stars

Divergenced D002 is a trading strategy designed to identify entries based on price and Squeeze Momentum indicator divergences. It triggers long or short positions when histogram color transitions conflict with price higher highs or lower lows. Position exits a

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced D002

VWAP Reversion (Example)

by JasonTeixeira
9 stars

This indicator overlays a volume-weighted average price and a simple moving average on the price chart. It calculates VWAP from the typical price of high, low, and close and an SMA of close over a user-set length that defaults to 20. It plots the VWAP in orang

Indicator v5 Moving averagesVolume
Updated 2 weeks ago · Custom licence GitHub repository of VWAP Reversion (Example)

SMA Crossover (50/200) - Eterna

by EternaHybridExchange
9 stars

This strategy plots a fast and a slow simple moving average on the price chart and enters long when the fast average crosses above the slow average, or short when it crosses below. Opposite crosses reverse the position. Inputs change the two lengths, leverage,

Strategy v5 TrendMoving averages
Updated 7 months ago · MIT GitHub repository of SMA Crossover (50/200) - Eterna
8 stars

MA+ATR+ADX+PP Strategy is a trend-following system that plots a simple moving average with an ATR-based envelope directly on the main price chart. It changes trend state to bullish when the low exceeds the upper envelope, and bearish when the high breaks below

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of MA+ATR+ADX+PP Strategy

Moving Average Cross

by SynergOps
7 stars

This strategy plots a short and a long exponential moving average on the price chart and compares them. It enters long after the short average stays above the long average for ten bars, and enters short after the opposite holds for ten bars. It tries to close

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Moving Average Cross

Cerebr

by jerryinyang
5 stars

This strategy combines optional Hull moving average, SuperTrend, and MACD conditions in a separate pane. It marks HMA rising or falling over a chosen period and SuperTrend long or short direction, and it treats MACD above or below its signal line as buy or sel

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Cerebr

This strategy executes short trades based on trend confirmation and momentum exhaustion. It calculates a 50-period and 200-period EMA, requiring price to trade below the 200 EMA with a recent upward pullback through the 50 EMA. Short entries are further filter

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA + VMC Cipher Short Strategy
4 stars

This multi-mode trading strategy executes trades on the price chart using selectable technical models, including RSI-2 mean reversion, SuperTrend, MACD crossovers, Triple EMA, Bollinger Bands, or a combined multi-indicator approach. It filters trade entries us

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of Simpleton KIMI – Enhanced
4 stars

This strategy calculates fast and slow exponential moving averages alongside an Average True Range value. It enters a long position when the fast EMA crosses above the slow EMA, and enters a short position on a cross under unless long-only mode is active. Stop

Strategy v6 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of EMA Cross Strategy [trugurpala]

My Strategy Name [Lab]

by mitchell-917
4 stars

This Pine Script v5 strategy calculates a simple moving average of a configurable source over a user-defined length. It generates long entries when close crosses above the moving average and short entries when close crosses below it. The strategy draws on the

Strategy v5 Moving averagesTrend
Updated 11 months ago · Custom licence GitHub repository of My Strategy Name [Lab]
4 stars

This strategy plots a fast, a slow and a derived average moving average on the price chart, each selectable as an EMA or SMA. A long entry requires a recent fast-over-slow cross outside the last four bars, price above the fast and the longer trend average, and

Strategy v4 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of 3 EMA/SMA + Cross Strategy
4 stars

This indicator plots an exponential moving average ribbon consisting of 5, 8, and 13-period EMAs alongside dual Bollinger Bands (narrow and wide bands). It plots buy and sell shapes on the price chart whenever the 5 EMA crosses above or below the 13 EMA. In ad

Indicator v5 Moving averagesVolatility & bands
Updated 2 years ago · None stated GitHub repository of UMURLU 5-8-13 Tarama
4 stars

SnagProfit Trending is a multi-timeframe dashboard indicator that monitors trend direction across multiple resolutions using exponential moving average alignments. It calculates EMA relationships across timeframes starting from lower intervals like the one-min

Indicator v5 TrendScreeners & dashboards Repaints
Updated 4 years ago · None stated GitHub repository of SnagProfit Trending

ODIE AT-DDT

by gocaman
3 stars

ODIE AT-DDT combines an Arnaud Legoux Moving Average (ALMA) and an AlphaTrend indicator into a single price chart overlay. It calculates trend direction using ALMA smoothing alongside an ATR-based AlphaTrend that utilizes MFI or RSI. Visual buy and sell signal

Indicator v5 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of ODIE AT-DDT

jash GGMA Granville

by jash-git
3 stars

This indicator combines modified Guppy Multiple Moving Average (GMMA) concepts with Granville's rules using Fibonacci-based exponential moving averages. It plots five EMAs on the price chart (3, 13, 34, 55, and 144 periods) to track short-term momentum, interm

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of jash GGMA Granville

The BB Keltner Squeeze Oscillator combines Bollinger Bands and Keltner Channels to identify market volatility squeezes alongside dual moving average momentum oscillators. It plots two column histograms and zero-line squeeze dots in a separate pane below the pr

Indicator v5 Volatility & bandsOscillators & momentum
Updated 5 months ago · None stated GitHub repository of BB Keltner Squeeze Oscillator
3 stars

This indicator plots a fast and a slow simple moving average of the close on the price chart. It marks a bullish signal when the fast average crosses above the slow average and a bearish signal when it crosses below, using small triangles at the bar. A faint b

Indicator v5 Moving averagesTrend
Updated 7 months ago · None stated GitHub repository of Simple Moving Average Crossover

Lune Algo Premium

by IAMATOMIC001
3 stars

This multi-component overlay indicator plots algorithmic trading signals, trend clouds, and reversal bands directly on the price chart. Users can choose between multiple signal models tailored for scalping, momentum, or swing trading, adjusted via sensitivity

Indicator v5 TrendOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Lune Algo Premium

Simple Alert Strategy

by augustoerni
3 stars

Simple Alert Strategy is a moving-average crossover system designed for automated webhook alerting. It computes a 3-period simple moving average on closing prices directly on the main chart. The strategy enters a long position when the price crosses above the

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Simple Alert Strategy

NEODCA

by wynnforthework
2 stars

NEODCA is a Dollar Cost Averaging (DCA) strategy that combines MACD oscillators with volume-weighted moving average (VWMA) filters to execute trades. It supports long and short modes, placing base orders followed by up to eight safety orders scaled by multipli

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of NEODCA

Momentum

by Electrified-Trading
2 stars

This Pine Script library calculates various momentum metrics and oscillator values for other scripts to use. It provides functions for standard-deviation-normalized price change, dual-moving-average momentum, Stochastic RSI, and a customizable MACD. Function p

Library v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum

Monthly Performance Table

by Web3Degenerate
2 stars

This strategy combines an example trend pullback trading model with a modular monthly performance table displayed directly on the price chart. It buys when price is above a long-term moving average but below a short-term moving average, and exits when price cl

Strategy v5 Screeners & dashboardsMoving averages
Updated 2 years ago · None stated GitHub repository of Monthly Performance Table

Linda Raschke Setup [JR]

by jayadevrana
1 stars

This strategy implements Linda Raschke's classic trend pullback setup. It measures market trend strength using the ADX indicator and identifies pullbacks to an Exponential Moving Average (EMA). When ADX exceeds a specified threshold and price touches the EMA,

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Linda Raschke Setup [JR]
1 stars

Composite Price Stats is a trend-following overlay strategy that evaluates statistical metrics on price components. It calculates cumulative true range, variance, deviation, and ADX on hlc3 price data, while plotting an averaged price series. Long entries trig

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Composite Price Stats

Multi-Timeframe Trend Alignment

by shubhamtaywade82
1 stars

Compares price with a moving average on four selectable timeframes, defaulting to 15 minutes, 1 hour, 4 hours and 1 day. Each timeframe scores plus one, minus one or zero, and the four are summed into an alignment score from minus four to plus four. It plots i

Indicator v6 TrendMoving averages Archived
Updated 5 months ago · None stated GitHub repository of Multi-Timeframe Trend Alignment
1 stars

A macro strategy that builds a global central bank liquidity series from the Fed balance sheet, Treasury account, reverse repo, ECB, People's Bank of China and Bank of Japan, and a combined M2 money supply series, each convertible to dollars and switchable. It

Strategy v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Liquidity Moving Average Cross

VWAP Bounce & Cross

by Basant1Saini
1 stars

This strategy trades intraday price interactions with the Volume Weighted Average Price (VWAP). It offers bounce and crossover entry modes, filtered by an Exponential Moving Average trend filter and a customizable trading session window. Stop loss levels are c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of VWAP Bounce & Cross

DTX

by JohnsonHsiao
1 stars

Calculates two TRIX (Triple Exponential Average) lines based on logarithmic close prices over different lookback periods. The fast TRIX uses a primary period length, while the slow TRIX adds an offset factor to determine its longer period length. Both TRIX lin

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of DTX
257 stars

This strategy overlays a volume-weighted moving average of open prices and standard-deviation bands on the ES futures chart, aimed at the one-minute timeframe. It requests open and low from several higher timeframes with lookahead enabled. Percentage inputs se

Strategy v5 Volatility & bandsMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of ES - Futures 1M No repaint
106 stars

This strategy plots 50-, 100- and 200-period simple moving averages on the price chart. After a user-chosen start date, it enters a long position when the 50-period average crosses above the 100-period average, using 100 percent of equity. A short order is cod

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 50/100/200 Moving Average Strategy

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