Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 35)

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

Calculates and plots an Autoregressive Finite Impulse Response (AFIRMA) moving average directly on the price chart. It weights historical price data using selectable windowing functions, including Hanning, Hamming, Blackman, and Blackman-Harris filters. An opt

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Autoregressive FIR Moving Average (AFIRMA)

Strategy Template

by iamrichardD
57 stars

This strategy template implements an EMA trend filter paired with MACD momentum confirmations. Long positions trigger when the fast EMA is above the slow EMA alongside a bullish MACD crossover and positive histogram, while short positions require the reverse.

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of Strategy Template

KC15

by benso87
24 stars

KC15 is a price-chart strategy that configures two moving averages, a Bollinger Band Width Percentile filter, and PMARP entry and exit thresholds for long and short trades. Users can switch each average between SMA and EMA, set lengths and colors, and toggle l

Strategy v5 Moving averagesVolatility & bands
Updated 4 years ago · MPL-2.0 GitHub repository of KC15

Divergenced E005

by ruckard
13 stars

Strategy identifying market entries based on Squeeze Momentum Indicator divergence patterns and exiting via Curie Closing Lines moving averages. It evaluates color transitions in the squeeze momentum histogram against price movements to detect divergence condi

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Divergenced E005
8 stars

MA+ATR+ADX+PP Strategy combines configurable moving averages with an ADX-modulated ATR volatility band to generate trading signals directly on the price chart. It allows traders to select between eight moving average types, including SMA, EMA, Hull, and Tilson

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

Pulse Mean Accelerator

by eddiebelaval
7 stars

This indicator overlays a dynamic moving average on the price chart by adjusting a baseline mean with a pulse acceleration factor. It measures rate of change differences between price and the moving average, scaling the displacement by volatility via standard

Indicator v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of Pulse Mean Accelerator
7 stars

This long-only strategy identifies pullback opportunities within a broader trend. It enters a long position when the closing price trades above a long-term exponential moving average while falling below a short-term exponential moving average. Once in a trade,

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Pullback Strategy for Stocks

Cerebr

by jerryinyang
5 stars

Cerebr is a multi-timeframe trend-following strategy that combines Hull Moving Average (HMA), SuperTrend, and MACD indicators to generate trading signals. Users can individually toggle each component and adjust parameters such as the higher timeframe HMA perio

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

This strategy plots a short and a long exponential moving average on the price chart and opens long trades only. A long entry needs a recent close cross above the short average, a bullish candle still above it, and the short average above the long average. It

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA Long Strategy (H)

Simpleton Signals KIMI

by eltonaguiar
4 stars

This price-chart indicator is described as producing buy and sell signals with strength levels from 1 to 4. It calculates RSI, MACD, SuperTrend, and fast, medium, and slow EMAs. Labels, background color, and an information table can be shown or hidden, and a m

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Simpleton Signals KIMI

RSI fixed timeframe

by InNoobWeTrust
4 stars

This indicator calculates the Relative Strength Index and a smoothed moving average across a selectable fixed timeframe, plotting the values in a separate pane. Users can customize the timeframe, RSI length, calculation source, moving average smoothing type, a

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of RSI fixed timeframe

EMA Ribbon [trugurpala]

by trugurpala
4 stars

This indicator calculates eight Exponential Moving Averages with Fibonacci lengths ranging from 8 to 233. It plots all eight EMAs on the price chart and dynamically colors them green during bullish alignment (when the fastest EMAs are stacked sequentially abov

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

UMURLU-5-8-13-X

by Kalumur
4 stars

UMURLU-5-8-13-X overlays three exponential moving averages (5, 8, and 13 EMAs) alongside dual Bollinger Bands with narrow and wide standard deviation multipliers directly on the price chart. It generates visual signal labels on the chart when the 5-period EMA

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

The SnagProfit Trending 1H indicator calculates EMA crossovers using periods 5, 10 and 20 on the close price to identify bullish and bearish trend conditions. It draws a table panel on the chart that labels long trend status as OK CALL or NO CALL. The indicato

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of SnagProfit Trending 1H

Jash Test

by jash-git
3 stars

This indicator plots five exponential moving averages of Fibonacci lengths on the price chart: 3 and 13 as fast lines, 34 and 55 as slow lines, and 144 as a filter. They are drawn in red, orange, blue, purple, and black. The visible code also counts how many o

Indicator v5 TrendMoving averages
Updated 4 weeks ago · None stated GitHub repository of Jash Test

This indicator is a debugging example that overlays a scaled close-to-SMA ratio on the price chart. It divides close by a simple moving average, takes the natural log, and multiplies by 100. A triangle appears below the bar when that scaled value exceeds the t

Indicator v5 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Simple Test Indicator for Debugging
3 stars

Identifies continuation trade setups based on Beat the Market Maker (BTMM) second-leg patterns directly on the price chart. It defines trading session phases across Asian, London, and New York sessions, filters impulse legs using fast and slow exponential movi

Indicator v5 SMC / ICT / price actionSessions & time
Updated 1 year ago · None stated GitHub repository of BTMM Second Leg Confirmation
3 stars

This strategy is written for NVIDIA stock and overlays the price chart. It opens a long when price crosses above an exponential moving average, the rate of change is positive, and the average true range exceeds the previous daily ATR. It closes that long when

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of NVDA Buy/Sell Strategy

This strategy overlays XAUUSD and combines stochastic, RSI, and three EMAs with an ATR-based risk model. Confirm entries can require an M15 overbought or oversold trigger plus a rejection wick, and they stay near Fibonacci or EMA zones without chasing far from

Strategy v5 Oscillators & momentumMoving averages
2 stars

EMD Trend calculates trend direction by combining moving averages with an exponential moving deviation filter. Rendered as an overlay on the main price chart, it generates visual long and short trend signals and offers optional bar coloring. It includes an on-

Indicator v6 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of EMD Trend [InvestorUnknown]

Previous Candle Theory

by wynnforthework
2 stars

This strategy enters trades based on consecutive candle directions relative to a chosen moving average filter. It triggers a long entry when both the current and previous candles close bullish above the moving average, and a short entry when both candles close

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Previous Candle Theory

Quick Stats

by etnt
2 stars

Quick Stats displays key trading metrics directly on the price chart overlay. It calculates Mark Minervini's Trend Template rules by scoring moving average alignments (50, 150, and 200 SMAs), 200 SMA slope, and 52-week high/low proximities. Additionally, it co

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Quick Stats

Moving Average Color Filter

by Web3Degenerate
2 stars

This indicator calculates an Exponential Moving Average (EMA) and plots it directly on the main price chart. It dynamically changes the color of the EMA line based on the relationship between the current closing price and the moving average value. The line tur

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Moving Average Color Filter

Drawing Chartpoint Trendline

by pineforge-4pass
1 stars

Drawing Chartpoint Trendline is a strategy that calculates a 20-period simple moving average to dynamically construct a trendline using chart points between past SMA values. It extracts the projected line price at the previous bar as a reference level on the p

Strategy v6 Moving averagesSupport & resistance
Updated 7 days ago · Apache-2.0 GitHub repository of Drawing Chartpoint Trendline

This trading strategy generates scalping entries by combining exponential moving averages with momentum and trend filters. It triggers long or short trades when the short EMA crosses the long EMA, provided RSI, MACD, ADX trend strength, and Stochastic levels c

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · Custom licence GitHub repository of Ultimate Scalping PRO Legend Pro
1 stars

Corpus Array Basic State is a strategy designed to demonstrate state tracking using Pine Script arrays. It calculates a 20-period exponential moving average (EMA) and populates an array with closing prices during the initial bars. The strategy enters a long po

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Array Basic State

Keltner Hull Suite

by ymlee1104
1 stars

This overlay indicator draws a volume-weighted trend line and ATR bands on the price chart. It marks a bullish or bearish state when close moves outside those bands and keeps the previous state while price stays between them. Users can show a filled cloud or o

Indicator v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Keltner Hull Suite

Chandelier Exit

by Basant1Saini
1 stars

This strategy calculates ATR-based Chandelier Exit bands anchored to highest and lowest price extremes, plotting trailing stop levels directly on the price chart. It enters long or short positions when price crosses opposite bands, subject to an optional 200-p

Strategy v5 TrendVolatility & bands
Updated 8 months ago · None stated GitHub repository of Chandelier Exit

Matrix Scalper Algo

by Tradehook-org
1 stars

A Pine v5 indicator that combines a higher-timeframe trend with a short-term entry on the price chart. The trend is a fast EMA above or below a slow EMA on a chosen higher timeframe, shown as a background color. An entry marks when price crosses a 9-period EMA

Indicator v5 ScalpingTrend Repaints
Updated 8 months ago · None stated GitHub repository of Matrix Scalper Algo

ETHUSDT Binance 5m

by tseitz
1 stars

The script calculates multiple offset VWAP lines alongside Doji candle filters to generate trading signals on a five-minute cryptocurrency chart. It identifies bullish entry conditions when non-Doji green candles break above upper VWAP thresholds, and bearish

Strategy v4 Moving averagesCandlestick patterns
Updated 4 years ago · None stated GitHub repository of ETHUSDT Binance 5m
947 stars

The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec

Indicator v4 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
330 stars

This strategy plots a Supertrend line from ATR length and factor, plus a single EMA, on the price chart. It enters long when Supertrend turns bullish or while the trend is bullish and price crosses back above the EMA below the last entry price. Short entries m

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Supertrend + EMA rebound [Alorse]
257 stars

This strategy is designed for 1-minute S&P 500 futures trading using multi-timeframe data and Fibonacci-weighted standard deviation bands around volume-weighted moving averages. It requests data from multiple higher timeframes without lookahead to prevent repa

Strategy v5 Volatility & bandsMoving averages
Updated 7 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint Fixed

STRG-Kijun

by harryguiacorn
220 stars

STRG-Kijun is an Ichimoku-based trend-following strategy that generates trading signals when the Kijun-sen (base line) changes slope direction. It plots the standard Ichimoku cloud, baseline, lagging span, and directional signal arrows directly on the price ch

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of STRG-Kijun

5212 EMA Strategy

by hasnocool
106 stars

This strategy combines a triple exponential moving average system with a Stochastic RSI oscillator to identify trend-following entry opportunities directly on the price chart. It plots 50, 100, and 200-period EMAs while computing smoothed Stochastic RSI values

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5212 EMA Strategy
56 stars

An overlay indicator that plots dynamic trendlines and support/resistance channels on the price chart. It detects pivot high and low points across a configurable lookback period to draw S/R zones and calculate trendline slopes using ATR, standard deviation, or

Indicator v5 Support & resistanceTrend Repaints
Updated 2 months ago · None stated GitHub repository of Trendline Support Resistance 2024

SMA

by dcaoyuan
55 stars

This indicator plots three simple moving averages of the closing price on the price chart. The lengths default to 9, 21, and 36 and are labeled Fast MA, Slow MA, and Slowest MA. Each length can be changed independently through the inputs. It only draws the thr

Indicator v6 Moving averages
Updated 6 months ago · Apache-2.0 GitHub repository of SMA
47 stars

The Convolution Moving Average (CONV) indicator calculates a smoothed price series via FIR convolution with a custom kernel. It plots the CONV value as an overlay line directly on the price chart. The main input allows selecting any source series while the ker

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Convolution Moving Average (CONV)
16 stars

Seykota Alt 22 is a trend-following strategy combining 55-bar Donchian channel breakouts for entries with a Parabolic SAR trailing stop for exits. Position sizing and initial stop-loss levels are determined using Average True Range (ATR). The strategy supports

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 22: Parabolic SAR
8 stars

This strategy combines moving averages, ATR volatility bands and ADX trend strength on the price chart. It calculates ADX from price data and adjusts the ATR multiplier dynamically based on whether ADX is rising or falling. Long and short entries are controlle

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

EMA Cloud

by lunarticktrading
7 stars

This indicator plots a fast and a slow exponential moving average on the price chart and fills the space between them as an EMA cloud. The fill is green when the fast average is at or above the slow average and red when it is below. Arrows mark bullish crossov

Indicator v6 Moving averagesTrend
Updated 2 weeks ago · None stated GitHub repository of EMA Cloud

This indicator builds a channel from a Hull moving average of the source and an ATR scaled by a band multiplier, then normalizes price inside that channel into a 0 to 100 oscillator. It smooths the result with a weighted moving average and plots the line in a

Indicator v6 Mean reversionVolatility & bands
Updated 3 months ago · None stated GitHub repository of Radiant Mean Reversion Channels [Pineify]

Bollinger Bands

by suyons
7 stars

This indicator calculates and plots multi-timeframe Bollinger Bands directly on the price chart. Users can select from various moving average types for the basis line, such as SMA, EMA, WMA, HMA, RMA, VWMA, or ALMA, alongside customizable basis length, standar

Indicator v5 Volatility & bandsMoving averages
Updated 4 months ago · None stated GitHub repository of Bollinger Bands

RSI Trend Strategy

by SynergOps
7 stars

The RSI Trend Strategy combines a short-period Relative Strength Index with 30-period and 100-period Simple Moving Averages to identify trading opportunities on the main price chart. Long positions trigger when a 5-period RSI drops below 30 while price sits ab

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of RSI Trend 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