Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 50)

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

Calculated Colors

by be-thomas
65 stars

This script demonstrates how to dynamically alter plot transparency using calculated color values in Pine Script. It computes a 20-period simple moving average of the closing price and determines its relative height over a 100-bar lookback using the percent ra

Indicator v4 TrendMoving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Calculated Colors

Ruckard Curie B004

by ruckard
13 stars

Ruckard Curie B004 is a trend-following strategy designed for cryptocurrency trading. It generates signals by combining fast and slow moving averages calculated from high and low source prices with directional strength filtering using ADX and DI indicators. Th

Strategy v5 Moving averagesOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Curie B004
3 stars

This indicator identifies pullback reversal setups by combining dual exponential moving averages with candlestick patterns. It plots two EMAs with a shaded cloud to define trend direction. When price touches or crosses the slower EMA and closes back in trend a

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · None stated GitHub repository of Engulfing Patterns

This strategy detects EMA crossovers on the price chart using 9 and 21 period EMAs. It sets pending long signals on fast EMA cross above slow EMA and pending exit on cross below. Entries and exits trigger only on confirmed bars via barstate.isconfirmed. Long e

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF barstate-magnifier probe 01a - isconfirmed ON
947 stars

The Spencer 21-Point Moving Average calculates a specialized weighted moving average using Spencer's 21-point smoothing formula. It applies a specific set of symmetric positive and negative weights across 21 consecutive bars to generate a smoothed curve direct

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Spencer 21-Point Moving Average

Calculated colors

by be-thomas
65 stars

This indicator plots a 20-period simple moving average and the close on the price chart. It ranks the moving average with percentrank over 100 bars and converts that rank into plot transparency, capped at 80, so the moving-average line fades as the rank falls.

Indicator v4 Moving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Calculated colors
47 stars

This indicator plots a linear transformation of a chosen price source in a separate pane. It centers the source on an internal simple moving average, scales the deviation by factor a, then adds offset b. The scale and offset inputs change the slope and vertica

Indicator v6 Moving averages
Updated 8 months ago · MIT GitHub repository of Linear Transformation (LINEAR)

Ruckard Eve A011

by ruckard
13 stars

This strategy evaluates trend reversals using fast-paced high and low closing moving averages combined with Directional Movement Index (ADX, DI+, and DI-) strength filters. It executes long, short, or reverse entries when signal criteria and strength threshold

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Eve A011

MTF WaveTrend Opportunity Hunter calculates multi-timeframe momentum and confluence scores using WaveTrend across custom Regime, Setup, Trigger, and Context timeframes. It plots a net confluence score histogram, multi-layer heat ribbons, an RRG-style Rotation

Indicator v6 TrendOscillators & momentum
Updated 3 days ago · MIT GitHub repository of MTF WaveTrend Opportunity Hunter [WavesUnchained]

This strategy plots EMAs on the price chart. It signals long entries when the fast EMA crosses above the slow EMA on a barstate.isconfirmed bar and exits on opposite cross when barstate.isconfirmed. It uses fixed position sizing of 1 with no stop loss. The mai

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF barstate-magnifier probe 01b isconfirmed OFF

A trend-following strategy that marks entries with triangles. Trend needs a fast and slow EMA stack with a minimum slope, an optional ADX filter and an optional higher-timeframe EMA check defaulting to daily. Two entry modes are offered: a pullback continuatio

Strategy v6 TrendBreakout Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Strategy - Triangle Entries
47 stars

This indicator plots a linear transformation of a chosen price source in a separate pane. It computes a streaming simple moving average, then scales the source deviation from that average by factor a and adds offset b, so the result equals a times the deviatio

Indicator v6 Moving averages
Updated 8 months ago · MIT GitHub repository of Linear Transformation (LINEAR)

Hanging Man - Bearish

by TWODS-CAPITAL
37 stars

This overlay indicator marks a bearish hanging man candlestick on the price chart. It looks for a small real body sitting in the upper part of the range, a lower shadow at least twice the body, and no upper shadow, and only while an uptrend filter is active. T

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Hanging Man - Bearish
13 stars

This strategy uses a 100-period RSI to generate long and short signals with 5% pre-entry buffers. Long entries trigger at RSI 45 and shorts at RSI 55. Exits occur at RSI 55 for longs and 47 for shorts, with emergency stops at RSI 10. Higher-timeframe EMA confi

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Fiery RSI A008
3 stars

Farid Makram Custom Levels is a multi-signal indicator for TradingView that combines RSI momentum analysis with MOBO oscillator signals based on the DPO. It generates buy and sell signals when RSI crosses its moving average or when DPO crosses zero, with confi

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of Farid Makram Custom Levels
1 stars

A template for a Pine v4 SMA strategy where the name, SMA length and short-selling switch are unfilled placeholders, so it needs editing before it compiles. It plots the SMA in orange, goes long when a green candle opens above it, and goes short when a red can

Strategy v4 Moving averages
Updated 4 years ago · None stated GitHub repository of SMA Cross Strategy Template
106 stars

This strategy plots multiple indicators on the price chart for Bank Nifty index. It calculates MACD on different timeframes, RSI, ADX, Stochastic oscillator, and Bollinger Bands. The strategy generates buy signals when MACD shows upticks across timeframes, RSI

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bank Nifty Bullish Intraday

Calculates John F. Ehlers' Distance Coefficient Filter as a distance-weighted finite impulse response filter overlaid directly on the price chart. It weights historical price samples based on the sum of squared price differences across the lookback window, red

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of EDCF: Ehlers Distance Coefficient Filter

IFA-VP Context

by eddiebelaval
7 stars

This indicator plots a fixed lookback Volume Profile alongside 20, 50, and 200 Simple Moving Averages directly on the price chart. It highlights trend changes via moving average crosses and marks Point of Control reactions, High Volume Nodes, and Value Area bo

Indicator v6 VolumeSupport & resistance
Updated 3 months ago · None stated GitHub repository of IFA-VP Context
1 stars

This indicator plots a volume-weighted moving average as the central trend baseline on the price chart and surrounds it with ATR volatility bands. Trend conditions change when price breaks beyond those bands. Presets change the VWMA length and ATR multiplier f

Indicator v6 TrendMoving averages
Updated 4 days ago · None stated GitHub repository of Volume Weighted Trend [SkippAlgo]

PF FX 5dp - SMA20/50 cross

by pineforge-4pass
1 stars

This strategy generates crossover signals using SMA20 and SMA50 on the EURUSD forex pair at 5 decimal places. It enters a long position when the fast SMA crosses above the slow SMA and immediately closes any existing short position. It enters a short position

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF FX 5dp - SMA20/50 cross
1 stars

A simple price-chart indicator that plots a fast and a slow exponential moving average, defaulting to 20 and 50 periods, with a fill between them. It prints a buy label when the fast average crosses above the slow one and a sell label when it crosses below, an

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of EMA Crossover Buy/Sell Signals

SMA Strategy

by tseitz
1 stars

A Pine v4 strategy that plots a simple 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 the opposite side. Inputs set the SMA length, long and

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SMA Strategy

T3 Moving Average

by everget
947 stars

The T3 Moving Average indicator calculates Tim Tillson's smoothed moving average overlay. It applies a generalized DEMA calculation iteratively across three passes to reduce lag while minimizing overshoot relative to price action. Users can adjust the period l

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of T3 Moving Average
330 stars

MA Cross + DMI [Alorse] is a trend-following strategy that calculates two moving averages (EMA or SMA) alongside the Directional Movement Index (DMI). It plots the two moving averages directly on the price chart. Long positions are entered when the fast moving

Strategy v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MA Cross + DMI [Alorse]

Ruckard Irene A003

by ruckard
13 stars

Ruckard Irene A003 is an overlay strategy that combines fast moving averages with Directional Movement Index (ADX, DI+, DI-) filters to execute trades. It evaluates price momentum relative to high and low moving averages while checking ADX strength thresholds.

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Irene A003

Fractals with Divergence Scanner is an overlay indicator that combines Exponential Moving Averages, an eight-line EMA ribbon cloud, and WaveTrend divergence analysis. It calculates baseline EMA trends alongside WaveTrend oscillators to detect regular and hidde

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Fractals with Divergence Scanner

EMA Trend Ribbon

by vedkanani123
1 stars

A simple price-chart indicator that plots five exponential moving averages, defaulting to 8, 13, 21, 34 and 55 periods, as a ribbon with a shaded fill between the fastest and slowest. The ribbon is green when the averages are stacked in bullish order, red when

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of EMA Trend Ribbon
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 SNXBTC EMA Cross Strategy

Trimean

by everget
947 stars

The Trimean indicator calculates Tukey's trimean measure of central tendency over a user-defined lookback period. It determines the 25th percentile, median, and 75th percentile of the selected source series to output a robust, outlier-resistant smoothed curve

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Trimean

MACD

by Alorse
330 stars

This indicator calculates and plots the standard Moving Average Convergence Divergence oscillator in a separate pane. It computes the difference between a fast and slow moving average, derives a signal line through smoothing, and plots a histogram representing

Indicator v4 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of MACD
114 stars

This indicator projects a simple-mean forecast on the price chart. It estimates the forecast as the previous price plus the simple moving average of price change over a lookback window. A solid blue line is drawn from the current bar time and close toward a fu

Indicator v4 Moving averages
Updated 1 year ago · None stated GitHub repository of Forecasting Simple Mean Method
106 stars

BankNifty Bearish Intraday is an intraday short strategy designed for the Bank Nifty index. It evaluates multiple momentum and trend indicators across multiple timeframes, including MACD downticks on 5-minute, 15-minute, and 60-minute resolutions, an RSI below

Strategy v5 Oscillators & momentumTrend Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of BankNifty Bearish Intraday

This indicator calculates John Ehlers' 2-Pole Butterworth Filter, an infinite impulse response (IIR) second-order lowpass filter designed to remove high-frequency market noise with minimal phase lag. It processes price data using trigonometric functions and hi

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers 2-Pole Butterworth Filter (BUTTER2)

Colored fill

by be-thomas
65 stars

This indicator plots two simple moving averages of close, one over five bars and one over twenty bars, in a separate pane. It shades the area between the two plots green when the shorter average is above the longer average and red when it is below. There are n

Indicator v4 Moving averagesTrend
Updated 6 days ago · GPL-3.0 GitHub repository of Colored fill
13 stars

Ruckard Kayseri A003 is a trend-following trading strategy based on moving average crossovers using a primary smoothed moving average and a fast moving average. It features built-in date filtering and integrated Zignaly webhook alert message formatting for aut

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Kayseri A003

This strategy calculates trend direction across three user-defined higher timeframes using dual Simple Moving Averages, filtered by On-Balance Volume and Commodity Channel Index conditions alongside fractal pivot swings. Entries trigger when multi-timeframe tr

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Fractals with Pivot Trendlines Strategy

Quadruple EMA (QEMA)

by mushroom-men-Trading
2 stars

The Quadruple Exponential Moving Average (QEMA) indicator calculates a smoothed, low-lag moving average by cascading four exponential moving average stages with dynamic warmup compensation. It plots directly on the price chart as an overlay line. Users can adj

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Quadruple EMA (QEMA)
1 stars

This strategy builds a directional bias from three exponential moving averages drawn on the price chart. It scores bullish and bearish alignment of the fast, slow, and trend averages, plus whether price is above or below that structure, and treats a score at o

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 02 - three-ema bias
1 stars

This overlay strategy builds a weighted score from three factors. Trend is positive when a fast EMA is above a slow EMA and negative otherwise. Momentum is positive when 14-period RSI is above 50. The volatility factor is positive when close is above a 20-peri

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of TN Multi-Factor Sovereign V6

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