Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 47)

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

Quantum Trend Signal

by rosijay17-cmd
1 stars

An overlay indicator that plots a fast and a slow EMA, defaulting to 21 and 55, and shades the chart background by which one is higher. A BUY triangle appears when the fast EMA crosses above the slow one while RSI is above 55 and ATR exceeds a fraction of its

Indicator v6 TrendMoving averages
Updated 8 days ago · GPL-3.0 GitHub repository of Quantum Trend Signal
1 stars

The 7 Golden MA Detrended Layers indicator calculates seven simple moving averages with period lengths scaled according to powers of the golden ratio (Phi). It subtracts each moving average from the source price to construct seven detrended price oscillator la

Indicator v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of 7 Golden MA Detrended Layers
1 stars

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

This strategy plots volume-weighted moving average volatility bands and standard deviation levels calculated from multi-timeframe price data directly on the price chart. It defines percentage-based stop-loss and take-profit exit targets for both long and short

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of V1.4 ESU2023 - Futures 1M No Repaint

Astor SMA20/60

by hasnocool
106 stars

This strategy plots SMA20 and SMA60 on the price chart for BTCUSDT. It generates long entries on close crossing above SMA20 and short entries on crossing below. Separate signals trigger on SMA60 crossovers. Backtest starts at user-defined year, month, and day

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Astor SMA20/60

FilledValueGap F002

by ruckard
13 stars

FilledValueGap F002 is a trading strategy that enters trades when a recent price gap is filled, operating under the assumption that price action will continue in the direction of the underlying trend. It plots Curie closing moving average lines directly on the

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of FilledValueGap F002

Datsana V.1

by g-moe
3 stars

This indicator plots RSI divergence lines at resistance and support levels based on 14-period RSI crossing above 70 or below 30 within a search window of 141 bars. It displays dual EMA trend fill between periods 199 and 299, VWAP filter, TKPS tick pattern diam

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of Datsana V.1

VWMA 1hr

by avatar-lavventura
2 stars

This strategy overlays a 1-hour 24-period volume-weighted moving average (VWMA) and calculates multi-bar Williams Fractals on the price chart. It is restricted to a customizable backtest date window. The strategy calculates on every tick and allows extensive p

Strategy v4 Moving averagesSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of VWMA 1hr

Best SMA Finder

by regalouisei
2 stars

Best SMA Finder is an overlay indicator that scores simple moving average lengths with a crossover backtest. Long Only mode records a long entry when close crosses above the average and an exit when close crosses below it. Buy and Sell mode flips between long

Indicator v6 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Best SMA Finder

NY

by wynnforthework
2 stars

This strategy combines a fast Hull Moving Average with Bollinger Bands to generate mean-reversion signals. It opens a long position when the calculated Hull Moving Average crosses above the lower Bollinger Band, and opens a short position when it crosses below

Strategy v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of NY
1 stars

This indicator plots CHOCH (Change of Character) and BOS market structure signals on the price chart based on SMC logic. It calculates fast and slow EMAs, RSI, ATR volatility filters, and sweep lookback to detect breakouts and pullbacks. Signals trigger entrie

Indicator v6 SMC / ICT / price actionTrend Repaints
Updated 4 days ago · None stated GitHub repository of CHOCH-Base Indikator (RUNA logic)

Median Crossover

by pineforge-4pass
1 stars

This strategy plots a rolling median and an exponential moving average of close on the price chart and enters when the two cross. A median cross above the EMA opens a long; a cross below opens a short, reversing the prior position with a fixed quantity of one.

Strategy v6 Moving averagesTrend Repaints
Updated 7 days ago · Apache-2.0 GitHub repository of Median Crossover

P_fmt_args_named_positional

by GammaExpansion
1 stars

Plots the basic bar price series (open, high, low, close) alongside a 10-period simple moving average directly on the main price chart. The indicator tests various combinations of positional and named argument formatting across multiple plot function calls and

Indicator v6 Moving averages
Updated 7 days ago · MIT GitHub repository of P_fmt_args_named_positional

SCDTM - Unemployment Edition

by GreyssonEnterprises
1 stars

This overlay indicator tracks a multi-checkpoint setup built from trending exponential moving averages, Bollinger Band percent B, and a stochastic RSI crossover. A three- or five-bar fractal marks an unconfirmed signal, then the script stores breakout prices,

Indicator v4 Oscillators & momentumVolatility & bands Repaints
Updated 3 months ago · MIT GitHub repository of SCDTM - Unemployment Edition

Combination by YZZ

by webcrack4
1 stars

Combination by YZZ is a multi-indicator divergence tool that overlays directly on the price chart. It checks for regular and hidden divergences across up to ten technical indicators, including RSI, MACD, Stochastic, CCI, Momentum, OBV, VWmacd, CMF, MFI, and ex

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

A Pine v4 strategy that plots a 21-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 OMGBTC EMA Cross Strategy
330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]
257 stars

Williams Strategy - Alert is a Pine Script v5 strategy that plots three-bar simple moving averages of high and low prices directly on the price chart. It detects upward and downward trend reversals by comparing the current bar's low and high with those from th

Strategy v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Williams Strategy - Alert
114 stars

This strategy plots a base Jurik moving average and the average of three longer Jurik averages on the price chart. Long and short signals come from crossovers of those lines, or, when pivoting is enabled, from the averaged line stopping a fall or a rise over a

Strategy v4 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of 4 JMA Crossover Strategy

Astor SMA20/60 TW

by hasnocool
106 stars

This strategy calculates 20-period and 60-period simple moving averages (SMAs) plotted directly on the price chart. It executes long entries when the closing price crosses above either SMA, provided the bar is on or after the configured backtest start date. Po

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Astor SMA20/60 TW

Double EMA

by TWODS-CAPITAL
37 stars

This indicator plots a double exponential moving average on the price chart. It first smooths the chosen source with an exponential moving average, then smooths that result again with the same length, and combines the two so the line responds faster than a sin

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Double EMA
13 stars

This overlay indicator is a reusable template for Ruckard indicators meant to work with Zignaly. The implemented logic sections are empty, so it does not plot signals or manage trades. It exposes a higher-timeframe trend filter built from a fast and a slow mov

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of IndicatorTemplate A002

This short-only trading strategy combines the Relative Strength Index (RSI), Slow Stochastic, and MACD to identify bearish setup entries. A short position triggers when the RSI drops below 50, the Slow Stochastic crosses down while overbought, and the MACD lin

Strategy v4 Oscillators & momentumTrend
Updated 3 years ago · Apache-2.0 GitHub repository of RSI + Slow Stochastic + MACD Short Strategy
4 stars

This indicator computes a momentum value via linear regression on the difference between close price and a mid-value average that blends highest-lowest range and high-close average over the Keltner Channel length. It overlays Bollinger Bands and Keltner Channe

Indicator v6 Oscillators & momentumVolatility & bands
Updated 2 months ago · MIT GitHub repository of Squeeze Momentum [trugurpala]

VWMA 1hr + WF

by avatar-lavventura
2 stars

This script calculates a 1-hour 24-period Volume Weighted Moving Average (VWMA) and plots it directly on the price chart with customizable upper and lower percentage offset bands. It combines Williams Fractals for local swing highs and lows with a 14-period Re

Indicator v4 Moving averagesOscillators & momentum
Updated 7 months ago · None stated GitHub repository of VWMA 1hr + WF

Least Squares Moving Average (LSMA)

by mushroom-men-Trading
2 stars

This indicator calculates and plots the Least Squares Moving Average (LSMA) directly on the price chart. It fits a linear regression line over a user-selected lookback period and source series to project the prevailing price trend. By using an optimized circul

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Least Squares Moving Average (LSMA)
1 stars

This indicator calculates regular and hidden divergences across multiple momentum and volume oscillators, including MACD, RSI, Stochastic, CCI, Momentum, OBV, VW-MACD, CMF, and MFI, as well as an optional external input. It scans for pivot highs and lows using

Indicator v4 DivergenceOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Combined Indicators Fixed
1 stars

A Pine v4 strategy that plots a 23-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 REPBTC EMA Cross Strategy
947 stars

Mean Absolute Deviation Bands is a volatility indicator that plots bands around a moving average basis line calculated from a user-selected source. It draws upper and lower bands using a multiplier on the mean absolute deviation, with the background between th

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

AAPP

by capissimo
114 stars

This indicator plots an adaptive moving average or scaled RSI divergence line directly on the price chart. It calculates dual RSI series to measure momentum divergence, scales the values to the chart's price range, and constructs an adaptive average filtered b

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of AAPP
106 stars

Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Athena Momentum Squeeze - Autoview

This indicator evaluates how price relates to one selected moving-average family rather than treating a crossover as a signal. It scores trend quality, historical respect of the average, extension, compression, acceleration, and exhaustion, then plots a relati

Indicator v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Market–Average Relationship Engine [WavesUnchained]
3 stars

DEBUG Lower TF Supertrend calculates a modified trailing Supertrend line and trend direction based on average true range bands applied around the bar mid-price. The custom function supports multiple moving average types, such as HMA, EMA, SMA, WMA, and VWMA, t

Indicator v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of DEBUG Lower TF Supertrend

VWMA_WF

by avatar-lavventura
2 stars

VWMA_WF plots a 24-period volume-weighted moving average of the 60-minute hlc3 price on the chart, plus percentage offset bands. It draws a long label when price is at or below the lower band and a down fractal is confirmed, and it sends a short alert when pri

Indicator v4 Moving averagesVolume Repaints
Updated 7 months ago · None stated GitHub repository of VWMA_WF

Linear Time Moving Average (LTMA)

by mushroom-men-Trading
2 stars

This indicator calculates a linear time-weighted moving average of a chosen price source and plots it on the price chart. Inside the lookback, each bar receives a weight that rises with recency, equal to the period minus its offset, and the result is the weigh

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Linear Time Moving Average (LTMA)
1 stars

This indicator scans multiple technical indicators—including MACD, RSI, Stochastic, CCI, Momentum, OBV, VWMA, CMF, and MFI—to detect regular and hidden divergences against price pivot points. It overlays divergence lines and labels directly on the price chart

Indicator v4 DivergenceOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Divergence for Many Indicators yzz
330 stars

Heikin Ashi Strategy V2 [Alorse] is a trend-following strategy that generates trading signals using multi-timeframe Heikin Ashi moving average crossovers. It calculates a fast and slow exponential moving average from higher-timeframe Heikin Ashi close data and

Strategy v4 TrendMoving averages Repaints
Updated 2 months ago · None stated GitHub repository of Heikin Ashi Strategy V2 [Alorse]

AAPP with Alerts

by capissimo
114 stars

This indicator calculates an adaptive moving average filter and relative strength divergence to identify directional shifts directly on the price chart. It signals long entries when the moving average slope turns upward and short entries when it turns downward

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of AAPP with Alerts

Lastguru KNN A002

by ruckard
13 stars

This strategy applies k-nearest neighbors machine learning to fast and slow moving average crossovers to filter entry signals. It overlays directly on the price chart and incorporates built-in Zignaly alert triggers for automated execution. Traders can configu

Strategy v5 AI / machine learningMoving averages
Updated 1 year ago · None stated GitHub repository of Lastguru KNN A002

This strategy evaluates the dynamic relationship between price and a chosen moving average across six diagnostic dimensions: trend, respect, extension, compression, acceleration, and exhaustion. It plots a normalized relationship oscillator bounded between -10

Strategy v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Market–Average Relationship Engine [WavesUnchained]
4 stars

This strategy executes trades based on Stochastic Oscillator crossovers combined with a trend filter and ATR-based risk management. It calculates smoothed %K and %D lines alongside an Exponential Moving Average (EMA). A long signal triggers when %K crosses abo

Strategy v6 Oscillators & momentumTrend
Updated 2 months ago · MIT GitHub repository of Stoch Strategy [trugurpala]

Super Algo Setup [Aura]

by IAMATOMIC001
3 stars

This overlay indicator combines SuperTrend, RSI, MACD, and an EMA to mark labeled tops and bottoms on the price chart. Optional filters hide repeating signals and keep only relevant exits, and a Krypton fear-and-greed filter can limit bottoms and tops to overs

Indicator v5 Oscillators & momentumMoving averages
Updated 12 months ago · None stated GitHub repository of Super Algo Setup [Aura]

VWMA_WF_cross

by avatar-lavventura
2 stars

Calculates a 24-period Volume-Weighted Moving Average (VWMA) and RSI divergence using 60-minute timeframe data, accompanied by percentage-based envelope bands and Williams Fractal logic. The indicator plots the VWMA line alongside customizable upper and lower

Indicator v4 Moving averagesVolatility & bands Repaints
Updated 7 months ago · None stated GitHub repository of VWMA_WF_cross
1 stars

This long-only strategy identifies trend-following entries using moving average crossovers filtered by higher-timeframe trend alignment. It plots directly on the main price chart. Entries trigger when a fast exponential moving average crosses above a slow movi

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of MTF probe 10 - HTF bracket static

ATSYS Keep It Simple

by vedkanani123
1 stars

A price-chart indicator with Portuguese labels that combines Bollinger Bands, a fast 13 and slow 34 exponential average, and coloured clouds. Bands default to an exponential basis and can use simple, smoothed or weighted types. The average cloud changes colour

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of ATSYS Keep It Simple

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