Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 26)

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

EMA Cloud

by rubbermetal
1 stars

EMA Cloud draws a ribbon of eighteen exponential moving averages from 5 to 200 periods, with fills between neighbouring lines colored by which average sits higher. It adds a 120-period RMA line, markers where the fastest EMA crosses the 200 EMA, golden and dea

Indicator v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of EMA Cloud
1 stars

This strategy identifies liquidity sweep scalp entries on lower timeframes by analyzing 15-minute higher-timeframe candles. It verifies a valid range candle using an EMA trend filter, average body size comparison, and wick balance thresholds. In an uptrend, it

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of M15 Liquidity Sweep Scalp
1 stars

A trend indicator for the price chart that draws a moving-average trend line, 45 periods by default and selectable as SMA, EMA, WMA, HMA or VWMA, offset by an ATR multiple. It detects buying and selling pressure with an adjustable threshold, and can colour can

Indicator v6 TrendMoving averages
Updated 6 months ago · None stated GitHub repository of M45 Indicator - Aurolo
1 stars

This long-only strategy automates staged entries and exits based on Bitcoin all-time high drawdowns and percentage gains. It scales into positions across five configured percentage drop levels from the highest recorded price. Profit taking occurs in five parti

Strategy v6 Support & resistanceTrend
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle [Infinity]
1 stars

This strategy trades moving-average crossovers only when the higher timeframe agrees. It requests the higher-timeframe close and a trend moving average, then goes long when that trend is bullish and the fast average crosses above the slow average, and short wh

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of MTF - Multi-Time Frame Strategy

ML Price Predictor (KNN)

by haydarkadioglu
1 stars

This overlay indicator compares the current bar with historical patterns using a k-nearest neighbors search. It measures RSI, RSI slope, volume relative to a 20-bar average, EMA trend strength, and price position within a range, each scaled by a user weight. F

Indicator v5 AI / machine learningOscillators & momentum
Updated 8 months ago · None stated GitHub repository of ML Price Predictor (KNN)

The Basic Crossover

by propuchon
1 stars

A course example strategy that trades a simple moving average crossover. It goes long when a 14-period SMA crosses above a 28-period SMA and goes short when it crosses below, which reverses any open position. Both averages are plotted on the price chart. The l

Strategy v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of The Basic Crossover

MTF Trend Dashboard

by surajmateti
1 stars

This indicator tracks and compares trend direction across the current chart timeframe and a customizable higher timeframe. It calculates fast and slow exponential moving averages on both timeframes, classifying conditions as bullish, bearish, or flat based on

Indicator v5 TrendMoving averages
Updated 11 months ago · None stated GitHub repository of MTF Trend Dashboard

TOTAL MTPI STRAT M_K

by Mikelkulla
1 stars

TOTAL MTPI STRAT M_K is a trend-following crypto market direction strategy that overlays multiple technical indicators on the price chart. It combines custom weighted moving averages, dynamic EMA ribbons, RMTA, and Kijun Sen baselines to evaluate overall marke

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TOTAL MTPI STRAT M_K

Multiple Alerts

by RobACurtis
1 stars

A learning example that sends alerts for three user-selected symbols from one script, avoiding a separate alert per symbol. Each symbol is checked with a 50 and 200 period moving average cross function through request.security, and an alert fires once per bar

Indicator v4 Moving averagesScreeners & dashboards
Updated 2 years ago · None stated GitHub repository of Multiple Alerts

Moving Average Extension

by krosenfeld7
1 stars

This indicator calculates a multi-timeframe moving average using Simple, Exponential, Hull, Volume Weighted, or Weighted moving average types. It computes the logarithmic distance between the asset price and the selected moving average to determine extension.

Indicator v4 Moving averagesTrend Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Moving Average Extension
1 stars

The High Low MA Band Indicator calculates moving averages separately on high and low prices to create a dynamic price channel overlaid directly on the chart. Users can select between Exponential, Weighted, Volume-Weighted, or Hull Moving Average calculation ty

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of High Low MA Band Indicator

MTF RSI

by Alorse
330 stars

This strategy enters long when price is above a long moving average and the RSI falls below an oversold level. It closes the long position when the RSI rises above an overbought level or price drops below the moving average. The RSI length, oversold and overbo

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of MTF RSI
318 stars

This indicator plots three moving averages on the price chart alongside colored fills between the lines to visualize trend structure. Internally, it calculates a Stochastic RSI oscillator to detect oversold reversals. When the Stochastic %K line rises above 10

Indicator v5 Moving averagesOscillators & momentum
Updated 2 months ago · MIT GitHub repository of TVT 3X Scale In Out

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V

Take Profits & Stop Losses

by PythonForForex
64 stars

This educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro

Strategy v5 Moving averagesOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Take Profits & Stop Losses

EMA Ribbon MACD v1

by iamrichardD
57 stars

This strategy combines an exponential moving average ribbon with MACD momentum indicators to identify trend-following entry and reversal signals. It draws in a separate pane, tracking MACD signal crossovers, zero-line crosses, and EMA structural alignments. En

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD v1

The AFIRMA indicator calculates a weighted moving average via FIR filter coefficients from Hanning, Hamming, Blackman or Blackman-Harris windows. It optionally applies least-squares cubic polynomial fitting for autoregressive prediction. The script plots the A

Indicator v6 Moving averages
Updated 8 months ago · MIT GitHub repository of Autoregressive FIR Moving Average (AFIRMA)
43 stars

This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility

This indicator plots a relative strength index in a separate pane. It calculates RSI from the average of the previous ten opens rather than the current bar, so that source does not change during the live candle. A moving average of the RSI is plotted and can b

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of No Repaint - Relative Strength Index

Arnaud Legoux Moving Average

by TWODS-CAPITAL
37 stars

This indicator plots the Arnaud Legoux Moving Average of the closing price on the price chart. It uses TradingView's built-in ALMA calculation with a user-set window size, offset, and sigma. Those three inputs change how much history the average includes and h

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Arnaud Legoux Moving Average

Engulfing Candles - VWMA

by tistaharahap
25 stars

This overlay indicator marks bullish and bearish engulfing candles with teal and orange arrows on the price chart. An optional volume-weighted moving average can filter those marks: a bullish signal requires the close at or below the primary VWMA, and a bearis

Indicator v4 Candlestick patternsMoving averages
Updated 6 years ago · None stated GitHub repository of Engulfing Candles - VWMA
24 stars

This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa

Indicator v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Bollinger Band Swing

Crossing EMAs D

by ruckard
13 stars

Crossing EMAs D is a moving average crossover strategy designed to automate trade execution through Zignaly webhook and email integration. It detects simple moving average crossovers (14-period and 28-period) and formats detailed payload alert messages for cry

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Crossing EMAs D

My Strategy

by hirawatt
11 stars

This strategy plots five exponential moving averages of typical price on the price chart and treats a fully ordered stack as a trend signal. It enters long when the averages rise in order or when the 14-period RSI crosses above 60.5, and short on the opposite

Strategy v4 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of My Strategy

Portfolio Backtester

by f-cksociety
11 stars

The script is a Pine Script v5 indicator that emulates strategy backtesting directly on the price chart. It evaluates modular entry strategies, trade directions, entry stop-loss types such as ATR multiples or fixed percentages, and a wide variety of trade filt

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Portfolio Backtester

This indicator overlays Bollinger Bands with two exponential moving averages directly on the price chart. It calculates standard Bollinger Bands using a selectable basis moving average type, length, and standard deviation multiplier. Alongside the bands, it co

Indicator v6 Moving averagesVolatility & bands
Updated 5 months ago · None stated GitHub repository of EMA 9, EMA 21 & Bollinger Bands

EMA 9/26/52/200

by SynergOps
7 stars

EMA 9/26/52/200 calculates four exponential moving averages based on bar closing prices using fixed periods of 9, 26, 52, and 200. It plots all four lines directly on the main price chart in distinct yellow, purple, blue, and red colors to help identify short-

Indicator v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of EMA 9/26/52/200

This strategy generates trading signals based on crossovers between daily session VWAP and a 4-hour 90-period Exponential Moving Average (EMA). When VWAP crosses above the 4-hour EMA, the strategy closes open short positions and enters a long trade with full e

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 4H Bullish Buy 4H Bearish Sell Session

MACD

by trsdn
6 stars

This indicator implements a standard Moving Average Convergence Divergence oscillator plotted in a separate pane. It calculates fast and slow exponential moving averages of the closing price, derives the MACD line from their difference, and smooths it to creat

Indicator v5 Oscillators & momentumMoving averages
Updated 7 days ago · MIT GitHub repository of MACD

Moving Average

by SiegerTerpstra
5 stars

This indicator calculates a simple moving average as the arithmetic mean of a chosen price source over a set length. A second averaging pass can smooth the result, and an offset shifts the calculation window. An indicator timeframe input selects the data timef

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Moving Average

Linear Regression Channel

by jerryinyang
5 stars

The Linear Regression Channel indicator calculates the middle line via linear regression on a user-selected source over a configurable length. It plots upper and lower channel bands using a deviation multiplier and draws these lines directly on the price chart

Indicator v4 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of Linear Regression Channel

This strategy executes long positions by combining a 200-period EMA trend filter, Stochastic RSI oversold crosses, and Williams Alligator retracements, supplemented by RSI divergence detection. It triggers long entries when the price trades above the 200 EMA w

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Alligator + Stochastic Long Strategy

AG Momentum Breakout

by eltonaguiar
4 stars

AG Momentum Breakout is a strategy that identifies continuation signals after pullbacks in trending markets. It filters for uptrends using EMAs and detects recent pullbacks via RSI conditions before entering on RSI crossovers above 50 with ADX confirmation. Th

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Momentum Breakout

MTF MA Bands

by InNoobWeTrust
4 stars

The indicator calculates and plots up to five multi-timeframe moving average bands directly on the price chart. Each band is constructed from moving averages computed across user-defined timeframes, such as current chart, 5-minute, 30-minute, 4-hour, and daily

Indicator v6 TrendMoving averages Repaints
Updated 2 days ago · None stated GitHub repository of MTF MA Bands
4 stars

This indicator plots multiple custom moving averages on the price chart. It draws EMA lines of periods 9, 14, 34 and 55 using daily resolution alongside WMA lines of periods 9, 15 and 18 using weekly resolution. Users adjust the source (default close), length

Indicator v5 Moving averages
Updated 2 years ago · None stated GitHub repository of Hareketli Ortalamalar

Alert System with Trading Dashboard calculates two exponential moving averages on the chart while tracking fast and slow EMA crossover states across four configurable timeframes. It displays a visual table on the price chart showing the directional bias for ea

Indicator v5 Screeners & dashboardsMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Alert System with Trading Dashboard
3 stars

This indicator demonstrates debugging visualization patterns for Pine Script. It plots value tracking with mean, min, and max reference lines, condition markers using shapes and arrows, historical comparisons with standard deviation bands, multi-series overlay

Indicator v5 Moving averagesVolatility & bands
Updated 7 months ago · None stated GitHub repository of Debugging Visualization Patterns

BTMM HTF Bias System

by jcortes254
3 stars

BTMM HTF Bias System analyzes trend alignment and higher-timeframe directional bias using exponential moving averages across multiple timeframes, such as 1-hour, 4-hour, daily, and weekly charts. Based on Steve Mauro's Beat The Market Maker methodology, it cal

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of BTMM HTF Bias System

Envelopes

by piecioshka
2 stars

Envelopes is an overlay indicator that plots percentage bands around a simple moving average. It calculates a baseline SMA using a configurable length and derives upper and lower envelope boundaries shifted by a user-defined percentage deviation. The script pl

Indicator v6 Moving averagesVolatility & bands
Updated 12 days ago · MIT GitHub repository of Envelopes

SUSHI 2H ZEGUELA DEMABOT

by danielvm-git
2 stars

This overlay strategy plots up to three double exponential moving averages of a chosen source on the price chart. With the default lengths, it treats a crossover of the first and second DEMA as a long signal and a crossunder as a short signal; a third DEMA can

Strategy v4 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of SUSHI 2H ZEGUELA DEMABOT
2 stars

IPO Day Anchored VWAP calculates a Volume Weighted Average Price anchored to the first available bar on a chart, representing an asset's initial public offering or historical debut. It plots the anchored VWAP line on the main price chart alongside an anchor la

Indicator v6 Moving averagesSupport & resistance
Updated 3 months ago · Apache-2.0 GitHub repository of IPO Day Anchored VWAP

FRAMA & CPMA Strategy [CSM]

by wynnforthework
2 stars

The FRAMA & CPMA Strategy overlay script combines a Fractal Adaptive Moving Average (FRAMA) and a custom CPMA indicator imported from an external library. It generates long and short trading signals when price crosses above or below either moving average line.

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of FRAMA & CPMA Strategy [CSM]

My Indicator

by etnt
2 stars

My Indicator overlays timeframe-adaptive moving averages, candlestick pattern detections, and an information table directly on the price chart. Depending on the active chart timeframe, it plots key moving averages including daily SMAs and EMAs, intraday VWMA a

Indicator v6 Moving averagesCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of My Indicator

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