Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 46)

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

The Infinite Impulse Response (IIR) Filter calculates a smooth moving average curve designed to reduce lag by incorporating momentum changes over a calculated lag period. It plots directly on the price chart and can dynamically change color based on whether th

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Infinite Impulse Response (IIR) Filter
330 stars

Strat base [Alorse] is a template strategy script designed as a foundational framework for constructing custom trading logic in Pine Script. It plots a single Exponential Moving Average (EMA) on the main price chart and includes configurable inputs for enablin

Strategy v5 Moving averages
Updated 2 months ago · None stated GitHub repository of Strat base [Alorse]

Time Series Decomposition and Forecasting is an experimental indicator that decomposes close prices into trend and seasonality components. It evaluates a specified lookback window of price history to calculate centered moving averages, deseasonalized data, and

Indicator v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Time Series Decomposition and Forecasting

Altered OBV On MACD

by hasnocool
106 stars

This strategy calculates and plots 9, 21, 50, 90, and 200-period Simple Moving Averages on the main price chart. It constructs a modified On-Balance Volume (OBV) metric and calculates a MACD oscillator based on this custom volume series rather than price. Long

Strategy v5 Moving averagesVolume
Updated 2 years ago · GPL-3.0 GitHub repository of Altered OBV On MACD
47 stars

Henderson Moving Average plots a finite impulse response smoother of the selected source on the price chart. It derives closed-form Henderson weights once, normalizes them to sum to one, and convolves them with a rolling window. The filter is designed to pass

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Henderson Moving Average (HEND)

FilledValueGap B002

by ruckard
13 stars

FilledValueGap B002 is a strategy designed to execute trades when price moves to fill recently created gaps, operating under the assumption that price action will continue along the main trend direction. It uses Curie moving average closing lines for additiona

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of FilledValueGap B002

RSI + MACD + BB

by krosenfeld7
5 stars

This indicator combines the Relative Strength Index, Moving Average Convergence Divergence, and Bollinger Bands to identify setup signals during market consolidation. A long signal requires an RSI pullback under 50 following overbought conditions, a MACD histo

Indicator v4 Oscillators & momentumVolatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of RSI + MACD + BB
4 stars

This strategy enters long when RSI is above a minimum threshold and price is above a trend EMA, and short when RSI is below a maximum threshold and price is below that EMA. It opens a trade only while flat. Exits place an ATR multiple as the stop and a larger

Strategy v6 Oscillators & momentumMoving averages
Updated 2 months ago · MIT GitHub repository of RSI + ATR Strategy [trugurpala]
3 stars

This strategy plots directly on the price chart, drawing a multi-line stepped channel calculated from a simple moving average of OHLC4 expanded by Average True Range multipliers. It identifies potential mean-reversion setups, executing buy, sell, trim, and exi

Strategy v5 Volatility & bandsMoving averages
Updated 5 months ago · None stated GitHub repository of Current Backtester

RR Dangov

by IAMATOMIC001
3 stars

RR Dangov is a price-chart strategy that combines optional confluence modules for entries. The trader selects a primary and a secondary source from Guppy moving averages, VWAP, an opening-range breakout, Supertrend, or CPR, and can add WaveTrend, stochastic, a

Strategy v5 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of RR Dangov

UABMACD

by avatar-lavventura
2 stars

This strategy combines the WaveTrend oscillator with the Squeeze Momentum indicator. It calculates WT1 and WT2 lines along with their cross signals and color-coded entries on a separate pane. Bollinger Bands and Keltner Channels detect squeeze periods for addi

Strategy v4 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of UABMACD

Multi-Order Breakout Strategy

by wynnforthework
2 stars

This breakout strategy enters long positions when the price moves above the upper Bollinger Band, Parabolic SAR, and a 100-period exponential moving average, provided ATR confirms elevated volatility. It allows opening multiple scaled entries up to a user-defi

Strategy v5 BreakoutVolatility & bands
Updated 1 year ago · None stated GitHub repository of Multi-Order Breakout Strategy

Combination by yzz

by webcrack4
1 stars

This indicator scans price action and multiple technical oscillators to detect regular and hidden divergences, displaying them directly on the price chart. It checks up to ten indicators including RSI, MACD, Stochastic, CCI, Momentum, OBV, VWmacd, Chaikin Mone

Indicator v4 DivergenceOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Combination by yzz

Snag - VWAP

by dearvn
257 stars

This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc

Indicator v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of Snag - VWAP
99 stars

Chebyshev Type I Filter (CHEBY1) calculates a second-order Chebyshev Type I lowpass digital filter directly on the price chart. It provides noise reduction and trend smoothing with steep roll-off characteristics governed by controlled ripple in the passband. T

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Chebyshev Type I Filter (CHEBY1)
47 stars

This indicator calculates a 2-pole Infinite Impulse Response highpass filter to isolate higher-frequency components or remove trends from a given price source. It computes an internal highpass value based on a configurable length parameter and plots the result

Indicator v6 Volatility & bandsMoving averages
Updated 8 months ago · MIT GitHub repository of Highpass Filter (2-Pole)

Uabmacd

by avatar-lavventura
2 stars

The script plots a WaveTrend oscillator in a separate pane, calculating TCI as an EMA of a normalized price deviation and its 4-bar SMA. It displays overbought and oversold levels with colored circles for WT1-WT2 crossovers and bar coloring on crossover bars.

Indicator v4 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Uabmacd

Jurik Moving Average (JMA)

by mushroom-men-Trading
2 stars

This indicator calculates and plots the Jurik Moving Average directly on the main price chart. It uses an adaptive smoothing algorithm that dynamically adjusts to market volatility to reduce lag while minimizing overshoot. The script does not generate buy or s

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Jurik Moving Average (JMA)

Map Regime Tracker

by pineforge-4pass
1 stars

The Map Regime Tracker strategy evaluates market structure using a 20-period exponential moving average and a 50-period simple moving average. It stores regime thresholds inside a map object initialized on the first bar. When the fast EMA is above the slow SMA

Strategy v6 TrendOscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of Map Regime Tracker

P_err_wrong_arg_type

by GammaExpansion
1 stars

This indicator is a Pine Script v6 fixture that calls the built-in simple moving average with a length of ten and plots the result in a separate pane. The first argument is the string close rather than a price series, so the call does not match the expected ar

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

Combination by Yzz

by webcrack4
1 stars

This overlay indicator identifies regular and hidden divergences across multiple momentum and volume oscillators, including RSI, MACD, Stochastic, CCI, Momentum, OBV, VWmacd, CMF, and MFI. Divergence signals are determined using customizable pivot point period

Indicator v4 DivergenceOscillators & momentum Repaints
Updated 9 months ago · None stated GitHub repository of Combination by Yzz
947 stars

The Kaufman Adaptive Moving Average (KAMA) calculates a moving average that adjusts its sensitivity based on market volatility and noise. It computes an Efficiency Ratio by comparing price directional change over a specified period to overall market volatility

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Kaufman Adaptive Moving Average
257 stars

This indicator analyzes short-term price action on index futures and options charts by applying Rational Quadratic kernel smoothing to detect sideways consolidation ranges and potential breakouts. It processes pivot highs and lows over customizable loopback pe

Indicator v5 Support & resistanceTrend Repaints
Updated 7 weeks ago · None stated GitHub repository of SPX 30M - Trading Chart

Andean Scalping

by hasnocool
106 stars

Andean Scalping is a Pine Script v5 strategy template designed for backtesting trading signals. It features session and date-range filtering, directional trade toggles for long and short entries, and optional trend filtering tools including higher-timeframe EM

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Andean Scalping
46 stars

This multi-timeframe indicator calculates an adaptive trailing stop line based on Bollinger Bands evaluated on a user-selected resolution. It calculates standard deviation and simple moving average bands from the higher timeframe data, tracking trend shifts wh

Indicator v5 TrendVolatility & bands
Updated 8 weeks ago · None stated GitHub repository of MTF Bollinger Bands Trend Stop

FilledValueGap D003

by ruckard
13 stars

This price-chart strategy opens a position opposite the direction of a newly filled gap, on the idea that price continues the prevailing trend after the gap is filled. Stop loss can be sized from the gap distance and is on by default; take profit, trailing tak

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of FilledValueGap D003

Bull/Bear Volume Diagram

by eddiebelaval
7 stars

The Bull/Bear Volume Diagram indicator calculates and displays directional volume in a separate pane below the price chart. It categorizes volume based on candle direction, plotting positive histogram columns for bullish bars and negative histogram columns for

Indicator v6 VolumeMoving averages
Updated 3 months ago · None stated GitHub repository of Bull/Bear Volume Diagram

Custom MACD

by g-moe
3 stars

This indicator plots a MACD line, a signal line, and a histogram in a separate pane. It calculates the oscillator as the difference between a fast and a slow moving average of a chosen source, then smooths that result for the signal. Each average can be an SMA

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

SAIYAN OCC Strategy R5.41

by IAMATOMIC001
3 stars

SAIYAN OCC Strategy is a price-chart strategy that builds a short moving average of open and close prices using TEMA, Hull, or ALMA and colours bars by trend. It can take long, short, or both directions, optionally from Heikin Ashi closes or a multiplied alter

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of SAIYAN OCC Strategy R5.41

Matrix Eigen PCA

by pineforge-4pass
1 stars

This strategy computes a 2x2 covariance matrix from short-term differences in close-open and high-low ranges. It extracts the largest eigenvalue of the matrix as a volatility measure and compares it to its own simple moving average. When the largest eigenvalue

Strategy v6 Volatility & bandsOscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of Matrix Eigen PCA

P_err_wrong_arity

by GammaExpansion
1 stars

P_err_wrong_arity is a minimal Pine Script v6 indicator written as a test fixture for compiler parsing and arity validation. It attempts to call the built-in simple moving average function using only the close price without providing the required length argume

Indicator v6 Moving averages
Updated 7 days ago · MIT GitHub repository of P_err_wrong_arity
1 stars

A swing strategy that goes long when the SuperTrend (period 10, multiplier 5) is bullish, price is above a rising 200-period EMA, and the long side is enabled. Shorts follow the mirror rules but are switched off by default. An optional partial exit closes a se

Strategy v6 TrendMoving averages
Updated 8 days ago · GPL-3.0 GitHub repository of Pro-Swing System: 200 EMA and SuperTrend

Polish

by GreyssonEnterprises
1 stars

This indicator overlays multiple smoothed moving averages, candlestick reversal patterns, and trading session highlights directly onto the price chart. It calculates 21, 50, optional 100, and 200-period smoothed moving averages alongside a short-term moving av

Indicator v4 Moving averagesCandlestick patterns
Updated 3 months ago · MIT GitHub repository of Polish

combination by yzz

by webcrack4
1 stars

This overlay indicator scans price pivots for regular and hidden divergences against several oscillators at once, including MACD, MACD histogram, RSI, stochastic, CCI, momentum, OBV, volume-weighted MACD, Chaikin money flow, money flow index, and an optional e

Indicator v4 DivergenceOscillators & momentum Repaints
Updated 9 months ago · None stated GitHub repository of combination by yzz

MACD Test VWAP

by tseitz
1 stars

This strategy combines standard Moving Average Convergence Divergence (MACD) crossovers with Volume Weighted Average Price (VWAP) level interactions. It enters long positions when the MACD line sits above its signal line and short positions when below. Positio

Strategy v4 TrendOscillators & momentum Repaints
Updated 4 years ago · None stated GitHub repository of MACD Test VWAP

Laguerre Filter

by everget
947 stars

The Laguerre Filter is a technical indicator designed to reduce lag while smoothing price data using John Ehlers' time-warping Laguerre polynomials. It processes a selected price source across four recursive filter components governed by a user-defined damping

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Laguerre Filter
257 stars

This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of SPY Options Trading - Alert

FilledValueGap E002

by ruckard
13 stars

FilledValueGap E002 is a trading strategy that enters positions opposite to the direction of a filled value gap, operating on the premise that the prevailing trend will resume after gap completion. It utilizes Curie closing moving averages as trend filters to

Strategy v5 SMC / ICT / price actionTrend
Updated 1 year ago · None stated GitHub repository of FilledValueGap E002
7 stars

The Capital Rotational Event (CRE) indicator tracks capital flows and rotational momentum between two selectable assets, defaulting to SPY and GLD. It calculates a relative strength ratio between the target assets, smoothed by a moving average, along with a mo

Indicator v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of Capital Rotational Event (CRE)
5 stars

This indicator calculates and displays the Relative Strength Index, Slow Stochastic, and a normalized MACD line together in a separate pane. It plots the oscillators alongside customizable overbought, middle, and oversold threshold levels with shaded backgroun

Indicator v4 Oscillators & momentumMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of RSI + Slow Stochastic + MACD

VWMA

by avatar-lavventura
2 stars

This script calculates a Volume Weighted Moving Average with length 24 using high low close and volume data then plots it directly on the price chart. The VWMA line appears in blue. It also draws an upper band in red and a lower band in green whose distances f

Strategy v4 Moving averages Repaints
Updated 7 months ago · None stated GitHub repository of VWMA

NASDAQ 100 Peak Hours Strategy

by wynnforthework
2 stars

This Pine Script strategy trades the NASDAQ 100 index during peak hours using EMA crossovers, RSI, and VWAP filters. Long entries occur when close exceeds the 9-period EMA which is above the 21-period EMA, with RSI above 50, price above VWAP, EMAs aligned, and

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of NASDAQ 100 Peak Hours Strategy

CHOCH + BOS Strategy

by skipp-dev
1 stars

This strategy identifies market structure shifts, specifically Change of Character (ChoCH) and Break of Structure (BOS), on the main price chart. It triggers entries based on swing pivot breakouts with an optional volume filter and moving average confirmation.

Strategy v6 SMC / ICT / price actionTrend
Updated 4 days ago · None stated GitHub repository of CHOCH + BOS 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