Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 28)

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

This long-only trend-following strategy combines Ichimoku Kinko Hyo components with higher timeframe moving average filters. It triggers long entries when price trades above a higher timeframe EMA and a bullish Tenkan-Sen cross above Kijun-Sen occurs under fav

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo Momentum Strategy
7 stars

This strategy trades crossovers between a weekly-anchored Volume Weighted Average Price (VWAP) and a 4-hour 90-period exponential moving average. It plots both indicators directly on the price chart. A long position is opened when weekly VWAP crosses above the

Strategy v5 Moving averagesTrend Repaints
Updated 3 years ago · MIT GitHub repository of 4H Bullish Buy 4H Bearish Sell Weekly

This indicator combines a 200-period Exponential Moving Average (EMA), a Stochastic RSI oscillator, and three distinct Supertrend lines utilizing different ATR periods and multipliers. It overlays the EMA and Supertrend tracking lines directly onto the price c

Indicator v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Stochastic + Triple Supertrend

AG Trend-Pullback

by eltonaguiar
4 stars

This strategy trades trend pullbacks on the price chart. It goes long when the 50-period EMA is above the 200-period EMA, price is above the slower average, RSI of length 2 is below 20, and ADX is above 15. Shorts mirror that in a downtrend with RSI above 80.

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Trend-Pullback

MTF MA bands + RSI

by InNoobWeTrust
4 stars

This indicator plots multi-timeframe moving average bands alongside a Relative Strength Index in a separate pane. It calculates up to four configurable moving averages across different timeframes, offering selectable types such as SMA, EMA, and WMA with colore

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of MTF MA bands + RSI

SMC Quant Engine - QuantAlgo

by thesenegalesehitch
4 stars

SMC Quant Engine is an intraday trading strategy that combines Smart Money Concepts with a quantitative scoring system. It identifies order blocks and fair value gaps aligned with higher-timeframe 240-minute moving averages, ADX trend strength, and volume. Ent

Strategy v6 SMC / ICT / price actionMoving averages
Updated 4 months ago · Custom licence GitHub repository of SMC Quant Engine - QuantAlgo
4 stars

This indicator plots a fast and a slow moving average on the price chart and marks bullish and bearish crossovers. The user can choose SMA, EMA, RMA, or WMA, the price source, and both lengths. Triangle shapes appear below or above the bar at each crossover, a

Indicator v5 TrendMoving averages
Updated 11 months ago · Custom licence GitHub repository of MA Crossover Indicator [Lab]

KARPUZLU-RSI

by Kalumur
4 stars

Calculates a custom-period Relative Strength Index alongside an Exponential Moving Average of the RSI in a separate pane. It identifies pivot highs and lows directly on the RSI plot to highlight trendlines and potential divergence patterns. The area between th

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of KARPUZLU-RSI

MACD Indicator (14,21)

by might-tree
4 stars

This script plots three MACD lines calculated from exponential moving averages on the close price. The first line subtracts the 14-period EMA from the 21-period EMA, the second subtracts the 41-period EMA from the 90-period EMA, and the third subtracts the 90-

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of MACD Indicator (14,21)
4 stars

Snagprofit Buy Sell is an overlay trend-following indicator that calculates smoothed triple exponential moving averages (TMA) based on Heikin-Ashi and standard price inputs. It plots two trend lines directly on the chart and fills the space between them in gre

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snagprofit Buy Sell

Stella's MACD + RSI Combo

by stella-entry
3 stars

Stella's MACD + RSI Combo plots both the Moving Average Convergence Divergence oscillator and the Relative Strength Index in a separate chart pane. It evaluates momentum by comparing the MACD line against its signal line alongside RSI overbought and oversold t

Indicator v5 Oscillators & momentumMoving averages
Updated 8 months ago · MIT GitHub repository of Stella's MACD + RSI Combo
3 stars

This indicator detects bearish M and bullish W chart formations on the price chart based on Steve Mauro's Beat The Market Maker (BTMM) methodology. It emphasizes second-leg entries confirmed by a clean close across the 13 EMA, volume filters, and minimum ATR p

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of BTMM M&W Pattern Detection
3 stars

This strategy plots a 12-line moving average rainbow directly on the price chart using customizable types such as EMA, SMA, RMA, WMA, HMA, or VWMA. It enters positions based on moving average alignment and turnover signals across the ribbon. Exits are managed

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Moving Average Rainbow (Stormer)

This indicator measures a 20-bar rolling correlation between lagged changes in several price factors and the close change over the previous 10 bars. It is configured to draw in a separate pane. The factors include the gap between a 13-period EMA and a 30-perio

Indicator v5 Moving averagesVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Factor Indicator: Correlation with Price Change
2 stars

The GMMA indicator plots two groups of exponential moving averages on the price chart. The short-term group uses EMAs with periods 3, 5, 8, 10, 12 and 15. The long-term group uses EMAs with periods 30, 35, 40, 45, 50 and 60. The two groups are colored blue and

Indicator v6 Moving averagesTrend
Updated 12 days ago · MIT GitHub repository of GMMA = Guppy Multiple Moving Average

Zeguela Demabot

by danielvm-git
2 stars

This strategy calculates and plots up to three Double Exponential Moving Averages directly on the price chart. It signals entries based on DEMA crossovers and crossunders, using an optional third moving average as a directional trend filter. Position sizing al

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Zeguela Demabot

Launch Pad Setup

by major
2 stars

This indicator identifies consolidation by checking if the closing price stays within a user-defined percentage of three moving averages: a 21-period SMA, a 50-period SMA, and a 65-period EMA. When the condition holds, it plots a green X marker below the candl

Indicator v6 Moving averagesBreakout Repaints
Updated 3 months ago · Apache-2.0 GitHub repository of Launch Pad Setup

MACD

by avatar-lavventura
2 stars

This strategy calculates and plots the traditional Moving Average Convergence Divergence (MACD) line, signal line, and histogram in a separate pane. It enters a long position when the MACD histogram is above zero and closes the long position when the histogram

Strategy v4 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of MACD

Neural Network

by iceberg211
2 stars

Calculates composite scoring across multiple technical indicators including EMAs, SuperTrend, Parabolic SAR, Hull Moving Average, RSI, MACD, WaveTrend, Stochastic, Bollinger Bands, and ATR. Trading entries trigger on the price chart when cumulative weighted sc

Strategy v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Neural Network

MA Based Trend BarColor

by ryangaraygay
2 stars

MA Based Trend BarColor plots three configurable moving averages directly on the price chart. Users can customize the calculation type (SMA, EMA, or VWMA), source price, and lookback length for fast, medium, and slow periods. The script evaluates the stacked a

Indicator v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of MA Based Trend BarColor

Trend Signal (Honest)

by nvolpe2007-cell
1 stars

A simple trend indicator that compares the close with a long moving average, 100 bars by default, and a hysteresis band of two percent to reduce whipsaws. A buy appears when price closes above the band and a sell to cash when it closes below. The moving averag

Indicator v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Trend Signal (Honest)

EMA Trend Strategy

by jayadevrana
1 stars

Calculates a 9-period fast EMA, 21-period slow EMA, and 200-period trend EMA overlaid on the price chart. It enters long positions when the fast EMA crosses above the slow EMA while price is above the 200 EMA, and short positions when the fast EMA crosses belo

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of EMA Trend Strategy

Close Cross SMA 152

by pineforge-4pass
1 stars

A minimal strategy that trades the close crossing a 152-period simple moving average. It enters long when the close crosses above the average and short when it crosses below, reversing the position each time. The length is fixed with no adjustable inputs, and

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Close Cross SMA 152

CROSV

by kasutu
1 stars

A multi-layer chart overlay built around three EMAs of 20, 50 and 200 bars, with line colours that change by their relative order and a wide coloured zone around the 50 EMA. It adds automatic trend lines drawn from pivot points, with adjustable pivot period an

Indicator v5 Moving averagesTrend
Updated 2 weeks ago · None stated GitHub repository of CROSV

XAU Scalp v2

by mrme000m
1 stars

XAU Scalp v2 is an indicator that calculates a composite trading score using multiple components for XAUUSD gold. It stacks four EMAs to determine trend direction and strength, overlays SuperTrend signals derived from ATR(10), adds RSI(14) momentum, detects Bo

Indicator v5 ScalpingMoving averages
Updated 7 weeks ago · None stated GitHub repository of XAU Scalp v2
1 stars

Multi Variable Declaration is a strategy designed to demonstrate multiple variable declaration syntax within a trading model. It calculates a 12-period price channel midpoint alongside an exponential moving average spread (EMA 9 minus EMA 21) to establish tren

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Multi Variable Declaration

This overlay indicator combines a rolling volume profile, anchored VWAP, and trend filters for crypto chart analysis. It builds a value area from recent bars and can draw right-side profile boxes, with an Auto performance mode that reduces lookback, row count,

Indicator v6 VolumeSupport & resistance
Updated 5 months ago · MIT GitHub repository of Crypto AMT Toolkit v6.2 - Info Auto Performance
1 stars

This indicator draws a four-line exponential moving average ribbon on the price chart with 8, 21, 48 and 200 period lines by default. Shaded clouds between the fast and slow pairs change colour with direction, and the 21 EMA acts as the pivot. Optional feature

Indicator v5 Moving averagesTrend Repaints
Updated 6 months ago · None stated GitHub repository of Saty Pivot Ribbon Pro

CROSS

by AlanGuo
1 stars

A long-only moving average strategy that can read its signals from another symbol. It enters when the signal symbol closes more than one percent above a 120-period SMA, EMA or RMA, and exits when it closes one percent below, or optionally when its high stretch

Strategy v6 TrendMoving averages Repaints
Updated 7 months ago · None stated GitHub repository of CROSS
1 stars

An indicator that sets trend direction from a fast and slow EMA on four-hour data, then looks for a crossover of the same EMAs on the chart timeframe, intended as fifteen minutes, in that direction. An optional volume-above-average check and a cooldown filter

Indicator v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of V14 4H EMA Trend with 15M Entries
1 stars

A price-chart overlay that measures how fast an exponential moving average is turning. It takes the bar-to-bar change of a 20-bar EMA as its slope and the change in that slope as acceleration. When both exceed adjustable thresholds in the same direction, it ti

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trend Slope Acceleration
1 stars

This strategy goes long when a 13-period EMA crosses above a 34-period EMA and short on the opposite cross, closing each side on the reverse cross. A percentage trailing stop, set separately for longs and shorts, ratchets behind the close and is plotted as cir

Strategy v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of Verge EMA Crossover + Trailing Stop

TEMA Smoothing

by nvFede
1 stars

A Pine v4 overlay that plots three triple exponential moving averages of the close, with lengths of 10, 20 and 50 by default, drawn in red, blue and green. Each average is passed through a simple moving average controlled by a smoothing factor, which defaults

Indicator v4 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of TEMA Smoothing

Simple Moving Average

by juliencrn
1 stars

Simple Moving Average is a minimal overlay indicator that plots two simple moving averages of the close on the price chart: a 20-period line in orange and a 50-period line in blue. The lengths are fixed in the code and there are no inputs, signals, fills or al

Indicator v5 Moving averagesTrend Archived
Updated 4 years ago · None stated GitHub repository of Simple Moving Average
1 stars

A Pine v4 strategy that plots a 10-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 CRVBTC EMA Cross Strategy

Omar Edited WF

by Alorse
330 stars

Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Omar Edited WF
318 stars

This indicator calculates and plots two moving averages, which can be configured as either exponential or simple, along with a shaded fill between them to highlight trend direction. It also derives and plots upper and lower deviation levels using a customizabl

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of TVT Short Term (1h)

STRG-BBForce

by harryguiacorn
220 stars

STRG-BBForce is a Bollinger Bands trend-following strategy. It calculates standard Bollinger Bands and tracks directional alignment across the upper, lower, and basis lines. When all three lines slope upward, it opens a long position and closes short positions

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of STRG-BBForce
99 stars

Calculates Vitali Apirine's Slow Relative Strength Index (SRSI), which measures price changes relative to an Exponential Moving Average rather than the previous bar close. It computes the distance between the source price and its EMA, then applies Wilder's smo

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Apirine Slow RSI (SRSI)
57 stars

Implements an automated testing framework designed to validate an EMA Ribbon and MACD hybrid strategy. It verifies indicator calculations, trend context filters, signal generation, suppression rules, and cooldown mechanics using custom assertions. Test results

Strategy v6 Moving averagesOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Test Suite v1.5
47 stars

Calculates a finite impulse response moving average using Blackman window weighting. The Blackman window applies specific cosine constants to minimize spectral leakage, yielding a smooth trend-following curve. The calculation adapts dynamically during initial

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Blackman Moving Average (BLMA)
43 stars

This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.

Strategy v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m Strategy Candle Bar
24 stars

This overlay strategy combines a Cipher B WaveTrend oscillator with two optional moving averages on the price chart. It exposes WaveTrend channel and average lengths, overbought and oversold levels, buy, sell and gold dots, and regular or hidden divergence mar

Strategy v5 Oscillators & momentumMoving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B + EMAs 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