Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 40)

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

3 stars

This indicator calculates and visualizes seasonal performance metrics in a separate pane. It queries higher-timeframe monthly closes to compute the average return of the current calendar month across a user-defined lookback window, alongside the year-to-date a

Indicator v5 Moving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Stocks Seasonality Gauge

XO_macd

by wynnforthework
2 stars

XO_macd is an overlay strategy combining exponential moving average crossovers with MACD calculations. It tracks fast, slow, and consolidated bias EMAs to identify trend changes, coloring price bars and plotting Bull or Bear triangle shapes when conditions tri

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of XO_macd

V12 Swing Sniper Pro

by kevinesk
1 stars

V12 Swing Sniper Pro is a swing trading indicator for Bursa Malaysia stocks. It layers macro and sector filters atop Minervini-style trend quality gates and RSI checks to validate bullish setups. The script fires buy signals when coiling, pullback proximity, b

Indicator v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of V12 Swing Sniper Pro

SMA Rate of Change

by rubbermetal
1 stars

SMA Rate of Change measures the rate of change of a simple moving average, using a fast (20) and an optional slow (200) average, and plots both in a separate pane. Values can be shown as a percent or scaled by price. Optional extras include a histogram, fills,

Indicator v6 Oscillators & momentumMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of SMA Rate of Change
1 stars

This strategy plots on the price chart and enters long when a 10-period exponential moving average crosses above a 30-period one, and short on the opposite cross. Stop distance is the 10-period simple moving average of the high-low range. Each entry places a s

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Exit Stop Limit

Parabolic SAR Trend

by Basant1Saini
1 stars

This trend-following strategy generates buy and sell signals when the Parabolic SAR flips direction relative to price. Entries can be filtered using an Exponential Moving Average to trade in the direction of the dominant trend, as well as an Average Directiona

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Parabolic SAR Trend

TeeLek Lab 05 Assemble

by theteelek
1 stars

An experimental overlay indicator that simulates a daily DCA account and a long account within a date window, using a five-period Hull moving average coloured green when rising and red when falling. The long account buys when the average turns up or price is a

Indicator v5 Moving averages
Updated 1 year ago · None stated GitHub repository of TeeLek Lab 05 Assemble

MA Strategy

by amico1234
1 stars

This Pine Script v4 strategy generates crossover signals using two simple moving averages on the price chart. The fast SMA in red crosses above the slow SMA in blue for long entries and below for short entries. Signals activate only during a defined trading se

Strategy v4 Moving averagesSessions & time
Updated 2 years ago · None stated GitHub repository of MA Strategy

MTB_3

by JohnsonHsiao
1 stars

The MTB_3 indicator computes a base line from a simple moving average of close prices over a user-defined period. It then plots six horizontal lines on the price chart representing bands at one, two, and three standard deviations above and below this base. The

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

The KSMBTC EMA Cross Strategy plots an exponential moving average of the closing price on the price chart. It signals long positions when the open price crosses above the EMA with a green candle and short positions with a red candle. The strategy enters long w

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of KSMBTC EMA Cross Strategy

Butterworth Filter

by everget
947 stars

The Butterworth Filter indicator applies digital signal processing techniques to smooth price data directly on the main price chart. It calculates either a two-pole or three-pole filter based on a customizable length parameter and price source. When optional c

Indicator v4 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Butterworth Filter

This indicator scans NSE-listed stocks for momentum signals using Supertrend, multiple EMAs, MACD, and stochastic oscillator. It supports continuous or flip signal modes and displays matching setups in a customizable table at the bottom left of the chart. The

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

The EMA Moving Away Strategy calculates an Exponential Moving Average (EMA) to identify mean-reversion trade opportunities when price stretches significantly away from the line. A long entry triggers when the close drops below the EMA by a specified percentage

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

This strategy overlays Fibonacci standard deviation bands based on volume-weighted moving averages (VWMA) alongside 10-period open moving averages and pivot high/low levels directly on the price chart. It defines percentage-based stop-loss and take-profit targ

Strategy v5 Volatility & bandsMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of Futures - No Repain ES

@@rp_Indicator

by hasnocool
106 stars

This overlay strategy plots exponential moving averages of length 21, 55, 100, and 200 on the price chart. It is declared as a strategy that sizes orders as a percentage of equity and applies a percent commission and slippage, with pyramiding disabled. The mom

Strategy v5 Moving averages
Updated 2 years ago · GPL-3.0 GitHub repository of @@rp_Indicator

Bull Bear Power

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the combined Bull Bear Power oscillator in a separate pane. It computes Bull Power as the difference between the high and an exponential moving average, and Bear Power as the difference between the low and the EMA. The sum o

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · MIT GitHub repository of Bull Bear Power

Diverlong A002

by ruckard
13 stars

Diverlong A002 is an automated trading strategy designed for cryptocurrency pairs on intraday timeframes. It detects classic bullish and bearish divergences by comparing price changes against transitions in the Squeeze Momentum Indicator. Positions are exited

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

Edge Atlas draws a right-edge price-level atlas on the price chart. Modules produce day, week, and other period highs, lows, opens, and closes, plus pivot points, Fibonacci levels, support and resistance zones, session ranges, round numbers, and VWAP. A shared

Indicator v6 Support & resistanceSessions & time Repaints
Updated 3 days ago · MIT GitHub repository of Edge Atlas [WavesUnchained]
5 stars

This indicator plots a rolling simple moving average and a rolling median of a chosen source, plus upper and lower bands at one through five standard deviations from the mean. An optional log-space setting transforms the source with a logarithm before the calc

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

EMA Breakout

by jerryinyang
5 stars

This indicator calculates and plots the exponential moving average on the chart, along with Keltner Channel bands. It applies optional filters based on Keltner Channel and Money Flow to identify breakout signals. Breakouts occur when price crosses the EMA with

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of EMA Breakout

Ichimoku Cloud STEPFUN

by eltonaguiar
4 stars

This Ichimoku Cloud strategy plots the cloud and price action on the chart for trend analysis. It generates long signals when price is above the cloud with a Tenkan-Kijun bullish crossover and bullish cloud, optionally confirmed by Chikou span. Short signals f

Strategy v5 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Ichimoku Cloud STEPFUN
4 stars

This trend-following strategy generates long and short entries when a fast EMA crosses a slow EMA, overlaying directly on the price chart. To reduce false signals, it applies four configurable fakeout filters: volume moving average threshold, consecutive bar c

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Fakeout-Confirmed Strategy

REG-TREND

by gocaman
3 stars

The REG-TREND indicator plots linear regression trend lines calculated from the selected source over a user-defined length. It determines channel boundaries and deviation to detect trend breaks, marking them with dotted lines in the chosen color. Fibonacci ret

Indicator v5 TrendSupport & resistance
Updated 2 days ago · None stated GitHub repository of REG-TREND

jash_GGMA_Granville

by jash-git
3 stars

This overlay indicator plots five exponential moving averages with Fibonacci lengths of 3, 13, 34, 55 and 144 on the price chart. Fast lines are red and orange, slower lines blue and purple, and the 144-period line is a black filter. It marks reset events when

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

ALGOX

by IAMATOMIC001
3 stars

ALGOX is a multi-indicator trend-following strategy plotted directly on the main chart. It generates trade entries based on configurable setups, moving average trends, and higher-timeframe inputs. Users can apply sideways market filters using customizable RSI

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

TWAP VWAP EMA MACD

by jawauntb
3 stars

The TWAP VWAP EMA MACD indicator calculates two exponential moving averages: one based on the time-weighted average price (TWAP) and another on the volume-weighted average price (VWAP). It subtracts the VWAP EMA from the TWAP EMA to form the MACD line and appl

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of TWAP VWAP EMA MACD

Alpy Spot

by avatar-lavventura
2 stars

Alpy Spot is an oscillator and trend strategy that calculates a WaveTrend indicator alongside a multi-timeframe 60-minute Volume Weighted Moving Average (VWMA) with percentage band offsets. It plots WaveTrend lines, overbought and oversold threshold levels, an

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Spot
2 stars

This strategy detects adaptive market regimes by combining ATR volatility with fast and slow EMA moving averages to determine trend direction. It applies multi-timeframe confirmation using RSI and MACD on a higher timeframe. Signals appear as buy and sell arro

Strategy v6 Volatility & bandsMoving averages Repaints

超级趋势RSI

by wynnforthework
2 stars

This strategy applies a Supertrend calculation directly to Relative Strength Index values rather than raw price, plotting the result in a separate pane. Traders can enable optional RSI smoothing via a Hull Moving Average and overlay a secondary moving average

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of 超级趋势RSI

Risk Managed Strategy

by jayadevrana
1 stars

This strategy executes long trades when the closing price crosses above an Exponential Moving Average (EMA) and displays the EMA trend line directly on the price chart. Position sizing is calculated dynamically to risk a fixed percentage of current equity base

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Risk Managed Strategy

Elder Ray Index

by pineforge-4pass
1 stars

Calculates Elder Ray Bull Power and Bear Power by measuring differences between price extremes and an exponential moving average. It takes long entries during an uptrend when Bear Power is negative but rising, and short entries during a downtrend when Bull Pow

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Elder Ray Index

Smart Trend Dashboard Pro

by vedkanani123
1 stars

A price-chart indicator that plots a 9 and a 21 period EMA and prints a buy label on a bullish crossover when RSI is below the overbought level, and a sell label on a bearish crossover when RSI is above the oversold level. It tints the background and candles b

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of Smart Trend Dashboard Pro

SMA Spread OSC

by rubbermetal
1 stars

SMA Spread OSC plots the percentage distance between a fast SMA (20) and a slow SMA (200) as an oscillator in a separate pane, with optional smoothing. It adds average-distance bands from the spread's own history, an optional histogram and fills, acceleration

Indicator v6 Oscillators & momentumMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of SMA Spread OSC
1 stars

This strategy serves as a test corpus script demonstrating the use of Pine Script map data structures for state management alongside exponential moving averages. It tracks closing prices and EMA gaps in a key-value map during initial bars, then triggers long e

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

Stochastic RSI Crossover

by Basant1Saini
1 stars

This strategy calculates Stochastic RSI crossovers occurring in extreme overbought or oversold zones, filtered by an optional Exponential Moving Average trend filter. Long positions enter when the %K line crosses above %D from below the oversold threshold whil

Strategy v5 Oscillators & momentumTrend
Updated 8 months ago · None stated GitHub repository of Stochastic RSI Crossover
1 stars

High-Frequency Swing Reversal is a Pine Script v5 strategy that computes a reversal score from Bollinger Bands distance, RSI exhaustion, and candlestick rejection patterns such as hammers and stars. It plots VWAP, Bollinger Bands, and EMA20 on the price chart.

Strategy v5 Oscillators & momentumVolatility & bands
Updated 9 months ago · None stated GitHub repository of High-Frequency Swing Reversal
1 stars

An experimental pane indicator that simulates a DCA account and a long account inside a date window, using a five-period Hull moving average to decide entries and exits. The long account buys when the average turns up or price is above the DCA cost, adds when

Indicator v5 Moving averages
Updated 1 year ago · None stated GitHub repository of TeeLek Lab 05 Assemble X
1 stars

Technical Ratings Pro - Pump Wave calculates an aggregated technical rating derived from a suite of moving averages and oscillators. It evaluates indicators including multiple SMAs, EMAs, Hull MA, VWMA, Ichimoku Cloud, RSI, Stochastic, MACD, CCI, and the Ultim

Indicator v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Technical Ratings Pro - Pump Wave

MTM Metric [SMA]

by JohnsonHsiao
1 stars

This indicator calculates momentum metrics by measuring the differences between three simple moving averages of closing prices. It computes a short-term bias by subtracting a medium-period SMA from a fast-period SMA, and a long-term bias by subtracting a long-

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of MTM Metric [SMA]

TMA Overlay

by rajatjpatel
1 stars

A Pine v4 overlay combining several chart aids. It draws smoothed moving averages at 21, 50, 100 and 200 bars, fills between a 2-period EMA and the 200 line in green or red to show trend, and marks bullish and bearish three line strike patterns and large engul

Indicator v4 Moving averagesCandlestick patterns
Updated 4 years ago · None stated GitHub repository of TMA Overlay
330 stars

HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of HA UnivLong&Short Futures
257 stars

This strategy overlay calculates custom pivot high and low levels, averaged price sources, and Ichimoku Cloud components (Tenkan-sen, Kijun-sen, Senkou Span A/B). It also requests lower low price data from a 360-minute timeframe with lookahead enabled, introdu

Strategy v5 TrendSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of Futures - No Repaint ES 1.0

This indicator calculates John Ehlers' two-pole Super Smoother Filter, an infinite impulse response lowpass filter designed to eliminate high-frequency market noise while reducing lag compared to standard moving averages. It plots a smoothed line directly on t

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Ehlers 2-Pole Super Smoother Filter (SSF2)
16 stars

This trend-following strategy generates trades using Donchian channel breakouts combined with higher-timeframe trend filters and chart-timeframe momentum. It confirms breakout entries against a higher-timeframe moving average and rate of change, while optional

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 2: Dual-Timeframe

Diverlong B002

by ruckard
13 stars

This strategy enters when Squeeze Momentum color-section changes diverge from price, comparing the latest change with a prior one and confirming the divergence across two pairs. A smaller squeeze value with a higher price opens a short, while a larger squeeze

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

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