Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 42)

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

Rainbow EMA & SMMA

by ymlee1104
1 stars

This script plots a rainbow ribbon overlay composed of eight Exponential Moving Averages ranging from 10 to 50 periods alongside two Smoothed Moving Averages on the main price chart. It evaluates complete moving average alignment across all calculated lengths

Indicator v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Rainbow EMA & SMMA

V5 Combination by yzz

by webcrack4
1 stars

V5 Combination by yzz is a composite chart indicator that integrates a Volume Profile and Market Profile (TPO) tool with a MACD oscillator overlay. The profile section calculates price distribution across configurable range modes, plotting the Point of Control

Indicator v5 VolumeSupport & resistance
Updated 9 months ago · None stated GitHub repository of V5 Combination by yzz

Voss Predictive Filter

by amico1234
1 stars

The Voss Predictive Filter indicator calculates a custom Voss filter and plots it alongside the Voss line in a separate pane. It processes the selected source to produce filtered output and Voss values based on length, predict, and bandwidth settings. The main

Indicator v4 Moving averagesVolatility & bands
Updated 2 years ago · None stated GitHub repository of Voss Predictive Filter

A Pine v4 overlay that plots simple moving averages of 50, 100 and 200 periods on a chosen source, with progressively thicker lines. Each line is green while it is rising and red while it is falling. An optional background colour is available, and the three le

Indicator v4 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of QS Institutional Moving Averages
1 stars

A Pine v4 strategy that plots a 27-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 LINKWETH EMA Cross Strategy
947 stars

The Derivative Oscillator calculates a double-exponentially smoothed Relative Strength Index (RSI) and subtracts its Simple Moving Average (SMA) to form the main oscillator line. A secondary signal line is plotted using an SMA of the main oscillator values. Th

Indicator v4 Oscillators & momentumMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Derivative Oscillator
330 stars

This strategy combines triple exponential moving averages with a TTM Squeeze oscillator to capture trend-following momentum. It enters long or short positions when price aligns with all three EMAs (125, 680, and 2500 period) and the oscillator turns in the tre

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]
257 stars

This overlay strategy is named for one-minute gold. It requests the daily low and several higher-timeframe opens with lookahead enabled, builds a synthetic source from recent opens, and plots a volume-weighted moving average of a higher-timeframe open with sta

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of GOLD 1M - No repaint
228 stars

This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template

Accumulate

by hasnocool
106 stars

Accumulate identifies potential market accumulation and breakdown phases by combining four Simple Moving Averages (21, 50, 90, and 200 periods) with a Price Volume Trend (PVT) MACD indicator. Green buy arrows plot on the main price chart when price is above a

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Accumulate

Bias (BIAS)

by mihakralj
99 stars

This indicator calculates Bias as the relative deviation of a chosen source from its simple moving average, using (source minus average) divided by the average. It maintains a circular buffer and running sum so the average updates bar by bar, and it refuses a

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Bias (BIAS)

Diverlong D002

by ruckard
13 stars

Diverlong D002 is a trading strategy designed for crypto assets that detects momentum divergences using state changes in the Squeeze Momentum Indicator. It triggers long or short entries when price and momentum diverge across indicator sections. Trade exits ar

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Diverlong D002

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX

Spread by

by gorx1
5 stars

Spread by is a volatility channel overlay indicator that calculates statistical central tendencies and dispersion envelopes around price. It provides multiple central basis options including arithmetic mean, median, trimean, midhinge, midrange, root-mean-squar

Indicator v4 Volatility & bandsMoving averages
Updated 8 months ago · None stated GitHub repository of Spread by

MACD Breakout

by jerryinyang
5 stars

Calculates multi-timeframe Moving Average Convergence Divergence (MACD) alongside a Money Flow filter to identify potential market breakouts. It evaluates higher-timeframe MACD calculations using exponential or simple moving averages combined with Money Flow o

Indicator v4 TrendOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of MACD Breakout

Simpleton GROK

by eltonaguiar
4 stars

This strategy plots on the price chart and combines up to seven optional modules that vote for long or short conditions. The modules use a 20-period simple moving average, a five-period RSI, Bollinger Band squeezes, a simplified prior-bar break, stacked expone

Strategy v5 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Simpleton GROK
4 stars

This strategy evaluates EMA crossovers filtered by a long-term 200-period EMA trend filter designed for Gold futures and XAUUSD. It enters a long position when a fast EMA crosses above a slow EMA while price is above the 200 EMA. If long-only mode is turned of

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Gold GC/XAUUSD Strategy [trugurpala]
3 stars

This indicator calculates 3-period and 13-period exponential moving averages (EMAs) and plots them on the main price chart. It checks whether a single candlestick's real body—the space between its open and close prices—intersects both EMAs on the same bar. Whe

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of K-bar and EMA Crossover

Stops & Targets

by Web3Degenerate
2 stars

This script demonstrates how to calculate and display ATR-based stop loss and take profit levels directly on the price chart. It detects hammer and shooting star candlestick patterns filtered by a 50-period EMA trend. When a setup occurs and no active trade is

Strategy v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Stops & Targets

Session Filter

by jayadevrana
1 stars

Session Filter is an overlay indicator that plots a fast and a slow exponential moving average on the price chart. It marks a buy when the fast average crosses above the slow average only during a user-defined trading session, and it marks crossovers outside t

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Session Filter
1 stars

This indicator plots a dynamic trend level on the main price chart based on an interactively chosen anchor time and price level. It calculates the vertical offset between the selected price level and a moving average at the anchor time, projecting this dynamic

Indicator v6 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Moving Average Trend Line
1 stars

A simple exponential moving average crossover indicator drawn on the price chart. It plots a fast EMA and a slow EMA, 20 and 50 periods by default, and colors the fast line green when it is above the slow one and red when below. BUY and SELL labels mark the cr

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

Swing Trade ATR

by rubbermetal
1 stars

Swing Trade ATR is an indicator that marks Swing L and Swing S labels when a 9-period EMA crosses a 21-period EMA, with a fill between them. After each signal it draws stop loss and take profit lines at ATR multiples from the signal close and clears them when

Indicator v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of Swing Trade ATR
1 stars

This strategy evaluates short-term trend momentum by summing price differences across a user-defined lookback period using a for loop. It combines this calculated average momentum with 9-period and 21-period Exponential Moving Average crossovers. A long trade

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of For Loop Accumulator
1 stars

This indicator computes the Z-Score of a user-selected moving average or smoothed price series. It provides numerous smoothing modes such as SMMA, EMA, JMA, ALMA, and others to customize the base calculation. The Z-Score uses a chosen length and generates sign

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of VQZL Z Score + MA Options

Price Oscillator

by JohnsonHsiao
1 stars

The Price Oscillator calculates the difference between two simple moving averages applied to close prices: a fast SMA using fast_len (default 20) and a slow SMA using fast_len plus slow_len_factor (default 60). It plots this oscillator value as a green line in

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of Price Oscillator
1 stars

A Pine v4 strategy that plots a 36-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 LTCBTC EMA Cross Strategy
330 stars

This strategy generates crossover signals using two exponential moving averages calculated from multi-timeframe Heikin Ashi data. It enters long when the fast EMA crosses above the slow EMA and enters short on a crossunder, reversing the open position. Positio

Strategy v5 Moving averagesTrend Repaints
Updated 2 months ago · None stated GitHub repository of Javo v1 [Repaint] [Alorse]

MACD Strategy

by TradersPost
228 stars

This overlay strategy is built around MACD inputs for a fast average, a slow average, and a signal line. Comments say the script keeps MACD values available and can draw a histogram and zero line in a separate pane, with an optional overlay on price. Settings

Strategy v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of MACD Strategy
106 stars

This script executes long and short trades directly on the price chart by combining signals from multiple indicators, including MACD, RSI, Stochastic RSI, Supertrend, and moving average crosses. It aggregates indicator conditions using weighted scores and ente

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Acrypto - Weighted Strategy
99 stars

The Bilateral Filter indicator calculates an edge-preserving smoothed price line based on bilateral filtering principles. It combines spatial domain distances across past bars with range domain price amplitude differences using dual Gaussian weighting function

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Bilateral Filter (BILATERAL)

Diverlong E002

by ruckard
13 stars

Diverlong E002 is a trading strategy that identifies momentum divergences using state changes in the Squeeze Momentum Indicator. It triggers long and short entries when price action diverges from momentum transition phases. Position exits are determined by Cur

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Diverlong E002
7 stars

This indicator overlays two Bollinger Band sets from two timeframes on the price chart. It centers RSI on zero and classifies the second timeframe as up, sideways, or down. A buy appears when that trend is down or sideways and the first timeframe percent B is

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 months ago · None stated GitHub repository of RSI + BB Signal Alert
5 stars

Fear + Greed Reversal Projection measures market sentiment extremes by comparing price source values against historical highs and lows using standard deviation bands. It calculates fear and greed zones through simple or weighted moving averages. When market co

Indicator v4 Volatility & bandsMean reversion
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Projection

Simpleton Stepfun

by eltonaguiar
4 stars

This indicator plots signals on the price chart for crypto trading. It computes RSI-2, MACD crossover, Bollinger Band squeeze, volume spikes, Triple EMA alignment and Ichimoku Cloud to produce confluence signals. Each indicator can be toggled with adjustable w

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 days ago · None stated GitHub repository of Simpleton Stepfun
4 stars

This strategy tracks gold price trends using three exponential moving averages with lengths of 8, 21 and 55. It calculates ADX for trend strength filter and ATR for dynamic risk levels. The script enters long positions when the EMAs align bullishly with suffic

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Gold Triple EMA [trugurpala]

CSW Indicators

by g-moe
3 stars

CSW Indicators combines eight technical analysis tools into a single overlay plotted directly on the main price chart. It features automated power support and resistance levels derived from pivot points, distance perimeter bands, a linear regression channel, R

Indicator v5 TrendSupport & resistance Repaints
Updated 5 months ago · None stated GitHub repository of CSW Indicators

Estimations-10min

by IAMATOMIC001
3 stars

This overlay strategy estimates trend with a selectable TEMA, Hull, or ALMA basis and optional higher-timeframe or Heikin Ashi sources. It plots a regression estimator with ATR near and far boundaries, can color bars by trend, and can show order blocks. Entrie

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of Estimations-10min

Calculates a Zero Lag Exponential Moving Average (ZLEMA) combined with Average True Range volatility bands to determine market trends. It plots the ZLEMA basis line, volatility bands, trend reversal labels, and entry signals directly on the price chart. Additi

Indicator v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Zero Lag Trend Signals (MTF) [AlgoAlpha]

Exponential Moving Average (EMA)

by mushroom-men-Trading
2 stars

This indicator plots an exponential moving average of a chosen price source on the price chart. It calculates the average with exponential smoothing and applies a warmup compensator so a value is available from the first bar instead of waiting through a long s

Indicator v6 Moving averages
Updated 9 months ago · None stated GitHub repository of Exponential Moving Average (EMA)
1 stars

This strategy compares a 9-period EMA with a 21-period EMA of the close and uses their difference as a spread. It opens a long when the spread crosses above zero and a short when it crosses below zero, reversing the position through opposite entries. The EMA l

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Generic Type Annotation Tuple
330 stars

This strategy plots MACD line, signal line, Bollinger Bands, and RSI on the price chart. It signals long entries on MACD crossover above signal with RSI below 50 and price below BB basis, plus optional DMI filter. Short entries are available but disabled by de

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of MACD + BB + RSI [Alorse]

Diverlong F002

by ruckard
13 stars

Diverlong F002 is a price-chart strategy that enters on Squeeze Momentum divergences and exits on Curie closing moving-average lines. A short is taken when a light-green to dark-green squeeze section is smaller while price is higher; a long is taken on the opp

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Diverlong F002
7 stars

ACCVOL 1j (SMA5 + SMA10) - AD/B is a price chart overlay indicator designed to identify volume accumulation and bullish swing trading setups. It evaluates current bar price gains, volume expansion, and volume relative to a moving average against historical pri

Indicator v6 VolumeMoving averages
Updated 3 months ago · None stated GitHub repository of ACCVOL 1j (SMA5 + SMA10) - AD/B

MACD Breakout

by jerryinyang
5 stars

MACD Breakout builds a higher-timeframe MACD from preset fast and slow lengths using SMA or EMA, and marks support and resistance zones from histogram sensitivity. Optional filters require zero-line agreement, higher-timeframe direction, and linear-regression

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of MACD Breakout
5 stars

This strategy identifies shorting opportunities by calculating Fear and Greed zones based on price extremums relative to moving averages and standard deviation bands. It measures price deviation from recent highs or lows to detect extreme market conditions and

Strategy v4 Volatility & bandsMean reversion
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Short Strategy
4 stars

The Simpleton STEPFUN Strategy combines signals from multiple technical indicators including RSI-2, MACD crossover, Bollinger Band squeeze, volume spikes, triple EMA, and Ichimoku cloud. It generates buy signals when the weighted ensemble meets or exceeds the

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 days ago · None stated GitHub repository of Simpleton STEPFUN 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