Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 39)

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

1 stars

V10 Swing Sniper (KLSE) is a daily chart overlay indicator designed for swing trading Bursa Malaysia equities based on Mark Minervini's Stage 2 and Volatility Contraction Pattern (VCP) principles. It calculates exponential moving averages, relative strength ag

Indicator v5 TrendBreakout
Updated 4 months ago · None stated GitHub repository of V10 Swing Sniper (KLSE)

Corpus EMA Cross

by Snappni
1 stars

Corpus EMA Cross is a strategy that plots two exponential moving averages on the price chart. The fast EMA uses a length of 12 and the slow EMA uses 26. It generates long entries on the crossover of the fast line above the slow line and short entries on the cr

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus EMA Cross

Stochastic+SQZMOM_LB_v1

by gabriel-klettur
1 stars

This strategy plots exponential moving averages of 10, 55 and 200 on the price chart and shades the background when a smoothed stochastic is oversold or overbought. It opens long positions when the stochastic K line crosses above D below the oversold level, in

Strategy v5 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Stochastic+SQZMOM_LB_v1

Technical Analysis Namespace

by fiji-solutions
1 stars

This indicator calculates common technical analysis variables including RSI, Stochastic Oscillator, EMA moving average, ATR volatility, and MACD with signal and histogram. It plots the MACD line, signal line, and histogram in a separate pane. The script serves

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of Technical Analysis Namespace
1 stars

A moving average drawn on the price chart that uses a beta-shaped weighting function, letting the user trade lag against smoothness. Two parameters, one labeled minus lag and one plus lag, reshape the weights across the window, while the length and source are

Indicator v4 Moving averages
Updated 4 years ago · None stated GitHub repository of BWMA Beta Weighted Moving Average
1 stars

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

ESU2023 Futures 1M

by dearvn
257 stars

This strategy calculates volume-weighted moving averages and standard deviation Fibonacci channels using price data from multiple timeframes. It overlays these volatility bands directly on the main price chart to identify potential trend levels. Automated trad

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of ESU2023 Futures 1M

LAMA-based Strategy

by capissimo
114 stars

This indicator calculates two Log-Normal Moving Averages (LAMA) based on John Ehlers' adaptive process and generates trend-following signals on the price chart. Entry signals trigger when the fast LAMA crosses the slow LAMA, optionally filtered by ATR volatili

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of LAMA-based Strategy

8D Run

by hasnocool
106 stars

8D Run is a Pine Script momentum strategy inspired by Linda Bradford Raschke. It tracks consecutive price closes relative to a 5-period Simple Moving Average (SMA). When price remains above the SMA for 8 or more bars and then dips below it, the strategy enters

Strategy v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8D Run
56 stars

This indicator plots an exponential moving average on the price chart. It calculates the EMA from a user-selected source, defaulting to the close, over a length that defaults to 44. An offset setting shifts the plotted line forward or backward by a chosen numb

Indicator v4 Moving averages
Updated 2 months ago · None stated GitHub repository of Moving Average Exponential
55 stars

This indicator overlays on the price chart and provides trend and momentum analysis. It calculates and plots three exponential moving averages with fixed periods of 20, 50, and 200 using yellow, orange, and blue colors respectively. The script also computes th

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · Apache-2.0 GitHub repository of Trend & Momentum Analysis

Template

by benso87
24 stars

This is a template script for a TradingView Pine Script indicator. It provides empty sections for inputs, functions, calculations, plots, and alerts, plus helper functions for moving average types. Users must add their own code to implement logic. No calculati

Indicator v5 Moving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Template

Divergenced K002

by ruckard
13 stars

This strategy enters on divergences between Squeeze Momentum section changes and price, confirming the pattern across two pairs at once. A smaller squeeze with higher price opens a short; a higher squeeze with lower price opens a long. Curie closing moving ave

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced K002
9 stars

This indicator plots a volume-weighted moving average as a central trend baseline and surrounds it with ATR-based volatility bands. It colors the trend and optional price bars according to whether price is on the bullish or bearish side of those bands. Users c

Indicator v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Volume Weighted Trend [QuantAlgo]

Supertrendx3

by PipC
8 stars

The indicator calculates three distinct Supertrend lines on the main price chart using separate customizable ATR periods and multipliers. Users can switch between standard ATR and SMA-based true range calculations. It can highlight background trend states, dis

Indicator v4 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of Supertrendx3

MA ROC Strategy

by suyons
7 stars

MA ROC Strategy calculates five configurable moving averages (SMA, EMA, or WMA) and plots ATR-based Keltner Channels directly on the price chart. It combines moving average crossovers and Rate of Change (ROC) calculations to generate long and short trading sig

Strategy v5 Moving averagesOscillators & momentum
Updated 4 months ago · None stated GitHub repository of MA ROC Strategy
5 stars

This indicator computes and plots a harmonic moving average alongside optional central tendency measures directly on the price chart. It calculates the harmonic mean, geometric mean, simple arithmetic mean, median, and midrange over a user-defined lookback win

Indicator v4 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Harmonic Moving Average

Charles' RSI Strategy

by jerryinyang
5 stars

This strategy plots on the price chart and looks for a sequence of RSI overbought or oversold crosses before it can enter. It calculates RSI on a selectable timeframe and compares a fast EMA with a slow EMA, optionally requiring the same moving-average conditi

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Charles' RSI Strategy

EMAs + BB Squeeze + Trend Long Strategy is an overlay strategy combining multi-timeframe Exponential Moving Averages with Bollinger Bands squeeze dynamics. It evaluates short, medium, and long EMAs defaulting to daily resolution alongside Bollinger Bands to id

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of EMAs + BB Squeeze + Trend Long Strategy

jash_GGMA_Granville

by jash-git
3 stars

This indicator implements a modified Guppy Multiple Moving Average (GMMA) framework based on Granville's trading rules. It calculates and plots five Fibonacci-based exponential moving averages (3, 13, 34, 55, and 144 EMAs) directly on the price chart. When the

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of jash_GGMA_Granville
2 stars

This indicator calculates the Relative Strength Index from a chosen price source and length and plots it in a separate pane. It draws horizontal bands at 70, 50, and 30 and fills the area between the outer bands. An optional moving average can smooth the RSI u

Indicator v6 Oscillators & momentumMoving averages
Updated 6 weeks ago · None stated GitHub repository of Relative Strength Index

Intrabar Efficiency Ratio

by regalouisei
2 stars

Intrabar Efficiency Ratio calculates an efficiency ratio indicator using lower timeframe intrabar data to measure price efficiency and market noise. It plots in a separate pane using customizable visual modes such as Line, Candles, or Circles based on moving a

Indicator v6 Moving averagesVolatility & bands
Updated 8 months ago · None stated GitHub repository of Intrabar Efficiency Ratio

Trend Catcher Strategy

by wynnforthework
2 stars

This strategy identifies trending breakouts by comparing total candle ranges to the overall high-low channel over a set period alongside a Simple Moving Average. Long trades enter when the range efficiency ratio crosses above a threshold while the SMA rises, w

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trend Catcher Strategy

Dual SMA Cross

by pineforge-4pass
1 stars

A dual simple moving average crossover strategy with adjustable fast and slow lengths. When the fast average crosses above the slow one it closes any short and enters long; when it crosses below it closes any long and enters short. There is no stop loss, take

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

P_err_float_as_int_length

by GammaExpansion
1 stars

This indicator is a minimal Pine Script v6 fixture that calculates a simple moving average of the close and plots the result in a separate pane. It passes the close series, a floating-point value, as the length argument of the moving-average function, which ex

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

Root Mean Deviation Trail

by vedkanani123
1 stars

An overlay indicator that measures how far price sits from a central EMA, smooths the signed deviation with a selectable moving average, and normalizes it with a root mean square deviation to scale a trailing band. The multiplier shrinks when deviation is stro

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Root Mean Deviation Trail
1 stars

Corpus Exit Qty Percent is a Pine Script strategy that executes trades based on exponential moving average crossovers and manages positions with Average True Range levels. It calculates 12-period and 26-period EMAs along with a 14-period ATR. When the fast EMA

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Exit Qty Percent

NR7 Range Breakout

by Basant1Saini
1 stars

NR7 Range Breakout identifies narrowest range bars over a specified lookback period and trades breakouts beyond their high or low price boundaries. It plots an exponential moving average trend filter alongside visual highlights for range compression and breako

Strategy v5 BreakoutVolatility & bands
Updated 8 months ago · None stated GitHub repository of NR7 Range Breakout

v5 Combination

by webcrack4
1 stars

This indicator calculates several variants of the MACD oscillator, including Traditional, Histogram, Leader, and Source methods, and overlays the oscillator directly on the price chart. It plots shape labels for MACD and signal line crossovers, while rendering

Indicator v5 Oscillators & momentumMoving averages
Updated 9 months ago · None stated GitHub repository of v5 Combination

MTB_10

by JohnsonHsiao
1 stars

This indicator calculates multi-layered Bollinger Bands based on a simple moving average baseline and standard deviation offsets. It projects 15 upper bands and 15 lower bands spaced at 0.2 standard deviation increments, spanning from 0.2 up to 3.0 standard de

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · None stated GitHub repository of MTB_10

Cloud MM All MA

by rajatjpatel
1 stars

A two-line moving average cloud drawn on the price chart. Each line can use one of eleven types, including RMA, SMA, EMA, WMA, VWMA, SMMA, TMA, Hull, DEMA, TEMA and VWAP, with their own lengths, 30 and 74 by default. The space between the lines is filled green

Indicator v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Cloud MM All MA

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup
106 stars

This strategy runs on the price chart and enters long when a fast simple moving average crosses above a slow one, and short on the opposite cross, while closing the other side. Entries also need ATR above a filter, a pullback check, a minimum candle-body chang

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 9:22 5 MIN 15 MIN BANKNIFTY

Trend Analysis

by dcaoyuan
55 stars

Trend Analysis plots a 20-period and a 50-period exponential moving average on the price chart. It marks bars whose close is above the faster average with a green square below the bar and marks other bars with a red square above the bar. It also calculates a 1

Indicator v6 TrendMoving averages
Updated 6 months ago · Apache-2.0 GitHub repository of Trend Analysis

Double Weighted Moving Average (DWMA) calculates a double-smoothed moving average by applying two consecutive weighted moving average passes to a chosen price source. Implemented with circular array buffers and running state accumulators, it achieves O(1) time

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Double Weighted Moving Average (DWMA)

Zen MIG Reversal

by Zen-Tim
29 stars

Zen MIG Reversal is a price action overlay indicator that identifies potential reversal setups using three-bar candlestick sequences, gap rules, and moving average filters. It checks for consecutive directional bars combined with either Al Brooks micro gaps or

Indicator v5 Candlestick patternsMoving averages
Updated 2 weeks ago · MIT GitHub repository of Zen MIG Reversal

Volume Average [UkutaLabs]

by eddiebelaval
7 stars

This indicator plots volume columns alongside an exponential moving average line of volume in a separate pane. It compares current bar volume against its 13-period average by default. When volume exceeds the exponential moving average, columns are colored gree

Indicator v6 VolumeMoving averages
Updated 3 months ago · None stated GitHub repository of Volume Average [UkutaLabs]

MACD %

by suyons
7 stars

The MACD % indicator calculates a percentage-normalized Moving Average Convergence Divergence oscillator plotted in a separate pane. Instead of displaying the standard absolute difference between fast and slow moving averages, it computes the spread as a perce

Indicator v5 Oscillators & momentumMoving averages
Updated 4 months ago · None stated GitHub repository of MACD %

Moving Centroid

by gorx1
5 stars

Calculates a density-weighted central price level over a user-defined lookback window and plots it directly on the main chart. For each bar in the lookback period, it computes how frequently historical high-low ranges overlap that bar's price, using this densi

Indicator v4 Moving averagesSupport & resistance
Updated 8 months ago · None stated GitHub repository of Moving Centroid

This short-only trading strategy combines exponential moving averages across daily timeframes with Bollinger Band squeeze logic. It evaluates long-term trend conditions or volatility squeeze setups to trigger short entries. Position management includes customi

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of EMAs + BB Squeeze + Trend Short Strategy
4 stars

This overlay indicator combines up to six optional signals and scores how many of them agree. It checks RSI-2 crosses of 30 and 70, MACD line crosses, Bollinger squeeze breakouts, volume spikes, triple EMA alignment, and price relative to the Ichimoku cloud. E

Indicator v5 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Ensemble Validator STEPFUN
4 stars

The Fakeout Filter indicator calculates a four-layer signal quality score ranging from 0 to 4 to evaluate trade setups. It assesses four conditions: volume expansion above a moving average multiple, alignment with a higher timeframe EMA trend, price move excee

Indicator v6 TrendVolume Repaints
Updated 2 months ago · MIT GitHub repository of Fakeout Filter [trugurpala]

jash_GGMA_Granville

by jash-git
3 stars

jash_GGMA_Granville plots five exponential moving averages on the price chart using Fibonacci lengths 3, 13, 34, 55 and 144. It marks a reset when the shortest average crosses the 55-period average and the close is on the matching side of the short average. Co

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

ALGOX

by IAMATOMIC001
3 stars

ALGOX is a trend-following strategy combining Heikin-Ashi price feeds, ATR-based Supertrend bands, moving average ribbons, and RSI filters. It generates long and short entries when price aligns across multi-timeframe moving averages and RSI thresholds, managin

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of ALGOX

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