Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 27)

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

Market Width

by iceberg211
2 stars

This indicator plots the percentage of stocks in a selected index trading above their 20, 50, 100, 200, and selected other day moving averages. It automatically detects the main chart symbol and switches to the corresponding index ticker such as S&P or NDX, or

Indicator v4 Moving averagesSupport & resistance
Updated 1 year ago · None stated GitHub repository of Market Width

MA Based Trend

by ryangaraygay
2 stars

The script calculates three moving averages with configurable types, lengths, and price sources. It evaluates trend alignment by comparing the relative order of fast, medium, and slow averages across four market states. In a separate pane, it plots color-coded

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

This indicator plots several moving averages on the price chart to help identify trends and support or resistance. It displays an exponential moving average with a period of 21 and simple moving averages with periods of 30, 40, and 50. The lines are colored gr

Indicator v5 Moving averages
Updated 2 years ago · MIT GitHub repository of Weekly MA's [JR-Academy]

Custom Ichimoku Alerts [UT]

by theupslidedown
2 stars

This custom Ichimoku indicator plots Tenkan-Sen, Kijun-Sen, Chikou-Span, Senkou-Span A, Senkou-Span B and the cloud fill on the price chart. It generates bullish signals when Tenkan crosses Kijun upward, Chikou is positive, price is above the cloud, and option

Indicator v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Custom Ichimoku Alerts [UT]
1 stars

GitHub CSV Seed (Daily) imports external seed data from a designated public GitHub repository using the request.seed function. It calculates and plots the imported close price alongside a Simple Moving Average (SMA) derived from the seeded dataset directly on

Indicator v6 Moving averages
Updated 2 days ago · None stated GitHub repository of GitHub CSV Seed (Daily)

Swing 4h Majors

by nvolpe2007-cell
1 stars

A long-only strategy for large crypto pairs on 4-hour bars, forced to 4-hour data by default. An entry needs price above a 50-bar EMA with the 20-bar EMA above it, rate of change above a minimum, RSI crossing up through 50 but below an overbought limit, and an

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of Swing 4h Majors

EMA Trend Signals

by jayadevrana
1 stars

This indicator calculates fast (9-period), slow (21-period), and trend (200-period) Exponential Moving Averages (EMAs) directly on the price chart. It plots all three EMAs along with a color-coded fill between the fast and slow moving averages. BUY signals tri

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

SMC Confluence Hub

by skipp-dev
1 stars

SMC Confluence Hub aggregates Smart Money Concept zone states linked from external scripts with internal technical analysis. It combines EMA trend, RSI, MACD momentum, and Bollinger Bands mean-reversion metrics to generate a unified confluence score specifical

Indicator v6 SMC / ICT / price actionOscillators & momentum
Updated 4 days ago · None stated GitHub repository of SMC Confluence Hub
1 stars

This indicator calculates dual Exponential Moving Averages alongside their slopes, normalized distance, and momentum to detect trend shifts on the price chart. It plots standard EMA crossovers while also assessing early warning conditions when EMAs approach ea

Indicator v6 TrendMoving averages
Updated 7 days ago · None stated GitHub repository of Gelişmiş EMA Trend Analizi
1 stars

A trend-continuation indicator that draws every historical trade on the price chart. Direction comes from a 50 and 200 EMA pair, optionally confirmed by the same EMAs on a higher timeframe. An entry appears when price closes back across the fast EMA after a pu

Indicator v6 TrendMoving averages Repaints
Updated 2 weeks ago · None stated GitHub repository of Trend Pullback Sniper
1 stars

A strategy that trades a 9 and 21 EMA crossover only in the direction of a higher-timeframe trend. The higher timeframe, daily by default, supplies an EMA and prior close from the previous completed bar, and a long needs the close above that EMA while a short

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MTF Trend Sovereign Strategy
1 stars

This strategy combines VWAP bands with a multi-factor momentum scoring system to trade trend continuations. It enters positions during pullbacks or breakouts around VWAP when momentum criteria—derived from EMAs, ROC, RSI, MACD, and ADX—reach user-defined thres

Strategy v6 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Fusion VWAP Momentum Strategy
1 stars

This indicator assists intraday breakout execution on KLSE stocks. It plots VWAP, EMA 9, EMA 21 on the price chart along with an opening range from the first 30 minutes of the session and a buy zone band above the daily pivot price. Settings control the pivot

Indicator v5 Moving averagesSupport & resistance
Updated 4 months ago · None stated GitHub repository of KLSE Intraday Execution Helper

EMA Crossover

by rubbermetal
1 stars

EMA Crossover plots a fast and a slow exponential moving average, fills the space between them green or red by direction, and marks each cross with a Long or Short label. A background tint appears when the gap between the averages exceeds a multiple of ATR. Op

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

This price-chart indicator builds a right-side volume profile and an anchored VWAP for crypto analysis. Lookback, row count, value-area percent, and acceptance bars shape the profile, while daily, weekly, or monthly anchors and a standard-deviation multiplier

Indicator v6 VolumeVolatility & bands
Updated 5 months ago · MIT GitHub repository of Crypto AMT Toolkit v6 Stable Alert

Simple Moving Average

by Sandesh30-cloud
1 stars

A minimal Pine v5 indicator that plots a 20-period simple moving average of the close as a blue line on the price chart. The period is fixed in the code, so there are no inputs, alerts or signals. It is a basic learning example showing how a moving average is

Indicator v5 Moving averages
Updated 6 months ago · None stated GitHub repository of Simple Moving Average

Tactical

by dtheran1
1 stars

A trend and signal overlay for the price chart. It draws a trend line from a moving average, 45 periods by default and selectable as SMA, EMA, WMA, HMA or VWMA, with colour by direction and an optional fill. Long and short signals are labelled progressively as

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

An indicator that reads trend from a fast and slow EMA on four-hour data and requires a minimum percentage separation between them. Entries also need volume above its moving average by a multiple, an RSI check and on-balance volume above its EMA. A cooldown li

Indicator v5 TrendVolume
Updated 7 months ago · None stated GitHub repository of V13 Trend Momentum Rider
1 stars

Plots five moving averages on the price chart in one script, defaulting to exponential averages of 9, 20, 50, 100 and 200 bars in graded blue shades. Each line has its own type from SMA, EMA, SMMA, WMA or VWMA, plus length, source, offset and an optional highe

Indicator v5 Moving averagesTrend
Updated 9 months ago · MPL-2.0 GitHub repository of Multiple Moving Averages
1 stars

A strategy based on the Open Close Cross idea, where a moving average of the open is compared with one of the close. It offers twelve moving average types, an optional alternate higher-timeframe resolution, a delay offset to limit repainting, and long, short o

Strategy v6 Moving averagesTrend Repaints
Updated 9 months ago · None stated GitHub repository of OCC Strategy Optimized

Lab-Doi-06

by theteelek
1 stars

Lab-Doi-06 is a price-chart strategy that limits activity to a user-set start and end time. The visible code defines a Hull moving average helper, dashed vertical lines at chosen times, and a seven-day long buy interval described as dollar-cost averaging. It t

Strategy v6 Moving averages
Updated 1 year ago · None stated GitHub repository of Lab-Doi-06

Scalping for S50

by lumduan
1 stars

This strategy plots three EMAs (fast length 8, mid 21, slow 55) on the price chart to identify trend direction. It signals long entries in aligned bull trends confirmed by RSI above 50 and bullish MACD during trading hours, entering when price rises above the

Strategy v6 ScalpingTrend
Updated 1 year ago · None stated GitHub repository of Scalping for S50

TOTAL MTPI STRAT M_K

by Mikelkulla
1 stars

This strategy overlays the price chart to determine macro market direction by aggregating signals from an ensemble of up to 26 trend, momentum, and moving-average indicators. It incorporates an Augmented Dickey-Fuller (ADF) market regime filter to detect rangi

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TOTAL MTPI STRAT M_K

Trend Indicator A

by mkdir700
1 stars

A price-chart overlay that draws a selectable moving average of the close, with optional high and low lines and a fill between them, coloured by trend direction. The average type can be ALMA, HMA, SMA, SWMA, VWMA, WMA, ZLEMA or EMA. Optional RSI and volume con

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

An overlay that plots up to three double exponential moving averages with separate lengths, where setting a length to zero disables a line. The crossover logic depends on which lines are active: price against the first line when it is alone, or the first line

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Double Exponential Moving Average

Bband Pinch & Expand

by JohnsonHsiao
1 stars

Bband Pinch & Expand calculates Bollinger Bands width and compares it against its simple moving average to detect periods of volatility expansion and contraction. The script plots a histogram of the difference between the current band width and its moving aver

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · None stated GitHub repository of Bband Pinch & Expand
318 stars

This indicator plots three moving averages on the price chart using lengths of 8, 21 and 50 by default. It colors the first average blue, the second maroon and the third red. A translucent fill between the first and second averages turns lime when the first is

Indicator v5 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TVT 3X Scale In Out

扣抵草稿

by TaichiS
219 stars

This indicator plots a visual reference directly on the main price chart. It checks whether the current bar is the last bar on the chart and displays text below the candle with a twenty-bar negative offset. Designed as an educational draft for moving average d

Indicator v4 Moving averages
Updated 5 years ago · None stated GitHub repository of 扣抵草稿
106 stars

This strategy simulates a dollar-cost averaging (DCA) trading bot that enters positions when a short moving average crosses over or under a long moving average. It manages trades by placing scaled safety orders as price drops, lowering the average position ent

Strategy v5 Moving averagesMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of 3Commas Visible DCA Strategy
104 stars

The ABC and Parabolic SAR Strategy calculates ABC chart patterns using a ZigZag structure alongside Fibonacci retracement levels and a trend cloud formed by six moving averages. It visualizes trend direction and pattern signals directly on the main price chart

Strategy v4 TrendSupport & resistance Repaints
Updated 3 years ago · MIT GitHub repository of ABC and Parabolic SAR Strategy

The AMFM indicator decomposes price movements into amplitude and frequency components using Ehlers' digital signal processing methods. It whitens the derivative as close minus open, then computes AM as the smoothed envelope of the absolute difference over 4 pe

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of AMFM - Ehlers AM Detector / FM Demodulator

EMA Ribbon Overlay

by iamrichardD
57 stars

Calculates exponential moving averages for fast, pivot, and slow lengths along with optional 50, 100, and 200 simple moving average context lines. It visualizes bullish and bearish ribbon fills on the main price chart alongside MACD calculations to generate ea

Indicator v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Overlay

This indicator plots a Bessel-weighted moving average on the price chart. It applies a finite impulse response window whose weights follow a Bessel-style function of a selected order, then normalizes those weights and averages the chosen source over the lookba

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Bessel-Weighted Moving Average (BWMA)
43 stars

This strategy executes trades on short-term cryptocurrency charts using a combination of pivot support and resistance levels and a multi-pole smoothed trend filter. Entries trigger when price crosses the smoothed trend line and confirms above or below a short-

Strategy v5 TrendBreakout Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m - Strategy Candle Bar
29 stars

Zen EMA Pullback Patterns identifies pullback formations relative to an Exponential Moving Average on the price chart. It detects 3-bar pullbacks consisting of three consecutive bearish bars above the EMA or bullish bars below it, as well as 4-bar micro channe

Indicator v6 Moving averagesCandlestick patterns
Updated 2 weeks ago · MIT GitHub repository of Zen EMA Pullback Patterns
29 stars

This library exports one function, custom_ma, which returns a 14-period exponential moving average of a supplied source series. It declares no inputs, so the length stays fixed at 14 and the caller chooses the series. It plots nothing and does not generate ent

Library v5 Moving averages
Updated 11 months ago · Custom licence GitHub repository of Exponential Trend [AlgoAlpha]
26 stars

This feature test indicator calculates and plots a 5-period simple moving average (SMA) using a user-selected price source. It draws the resulting moving average line in a separate window below the main price chart. The primary input setting allows traders to

Indicator v6 Moving averages
Updated 2 months ago · AGPL-3.0 GitHub repository of Feature Matrix - Source Input

Burgle Bounce

by benso87
24 stars

Burgle Bounce is a price-chart strategy that treats a move toward one of up to four simple or exponential moving averages as a test when price comes within a user-set percentage of ATR, then exits toward a target average under a separate error margin. Longs an

Strategy v5 Moving averagesOscillators & momentum Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Burgle Bounce

SPY 0DTE Scalper - 1m

by chris-c-thomas
14 stars

This overlay indicator marks CALLS and PUTS labels on the price chart when a strict boolean gate of price structure, momentum, volatility, breadth, and candle confirmation all pass. It plots an EMA ribbon with cloud fill, session-anchored VWAP and standard-dev

Indicator v6 ScalpingMoving averages
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 1m

DI Engulfing A002

by ruckard
13 stars

This strategy executes trades based on candlestick engulfing patterns aligned with a 200-period exponential moving average trend filter. It enters long positions when a bullish engulfing candle follows three consecutive bearish candles while price trades above

Strategy v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of DI Engulfing A002
11 stars

Simple Long Term Strategy plots five exponential moving averages on the price chart and trades crossovers between selected averages. It enters long when the first selected average crosses above the fifth and enters short on the opposite cross, only inside the

Strategy v4 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of Simple Long Term Strategy

This indicator overlays background and color signals on the price chart based on Relative Strength Index (RSI) and Moving Average Convergence Divergence (MACD) conditions. It calculates RSI alongside a high-based MACD line and defines timeframe-specific overbo

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · None stated GitHub repository of RSI - MACD Background Indicator
10 stars

TPCharts Alert EMAs Standard calculates three multi-timeframe Exponential Moving Averages using a user-selected resolution, defaulting to daily data. It computes a shortest, shorter, and longer EMA configured through custom length inputs. The script plots thes

Indicator v4 Moving averagesTrend Repaints
Updated 5 years ago · GPL-3.0 GitHub repository of TPCharts Alert EMAs Standard
9 stars

This indicator calculates and plots the Relative Strength Index (RSI) alongside an Exponential Moving Average (EMA) of the RSI in a separate pane. It features a reverse RSI calculator that determines the price required to reach specific RSI targets, such as ov

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · None stated GitHub repository of RSI & EMA with Reverse Calculator Panel

LunarTick Levels

by lunarticktrading
7 stars

LunarTick Levels plots key daily reference levels and multi-timeframe simple moving averages directly on the price chart. It highlights key price points including the Opening Print, Previous Day High and Low, and Overnight High and Low. Additionally, it projec

Indicator v6 Support & resistanceMoving averages
Updated 2 weeks ago · None stated GitHub repository of LunarTick Levels

MACD + CMF MTF Signals

by eddiebelaval
7 stars

This indicator calculates Multi-Timeframe Moving Average Convergence Divergence (MACD) and Chaikin Money Flow (CMF) combined in a separate pane. It plots the MACD, signal line, histogram, and an auto-scaled CMF line. Buy markers trigger when a bullish MACD cro

Indicator v6 Oscillators & momentumVolume Repaints
Updated 3 months ago · None stated GitHub repository of MACD + CMF MTF Signals

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