Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 33)

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

2 stars

Volume Historical Patterns indicator plots volume analysis in a separate pane. It computes an SMA of volume using optional time filtering for NYC hours and identifies the highest volume bar ever seen. Bars receive custom colors based on volume relative to this

Indicator v6 VolumeMoving averages
Updated 3 months ago · Apache-2.0 GitHub repository of Volume Historical Patterns
2 stars

This strategy plots a custom SuperTrend Polyfactor Oscillator in a separate pane using ATR, adjustable factors, and normalization options on the chosen indicator source. It generates long, short, or both direction signals based on the oscillator values with mu

Strategy v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Multi-Step FlexiSuperTrend - Strategy
2 stars

Plots timeframe-adaptive moving averages and technical overlays directly on the price chart. It displays standard daily moving averages, weekly trends, or intraday averages depending on the active timeframe. The 200-period simple moving average dynamically shi

Indicator v5 Moving averagesVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Key Moving Averages

MACD Cross Strategy

by Web3Degenerate
2 stars

This strategy generates buy and sell signals on the price chart using MACD crossovers. It applies an EMA 200 filter requiring price to trade above or below the EMA. Only the first MACD crossover is used after the filter condition is met. Stop loss is calculate

Strategy v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of MACD Cross Strategy

Kalman vs EMA

by jayadevrana
1 stars

This indicator overlays two smoothed price lines on the chart for comparison. A one-dimensional Kalman filter estimates the current price state and velocity, adjusting based on process noise Q, measurement noise R, and velocity noise qvIn. An EMA of user-defin

Indicator v6 Moving averagesTrend
Updated 4 days ago · MPL-2.0 GitHub repository of Kalman vs EMA
1 stars

A long-only strategy built on a fast and a slow EMA crossover, defaulting to 12 and 26. It buys a fixed cash amount when the fast EMA crosses above the slow EMA and closes when it crosses below, holding at most one position. A start date input limits when trad

Strategy v5 Moving averagesTrend
Updated 8 days ago · None stated GitHub repository of CDC Backtest MACD Fix Amount
1 stars

This strategy calculates a rolling price-change momentum score using a custom iterative loop function combined with exponential moving averages. It measures net price movement across six bars alongside a 9-period and 21-period EMA crossover. Long positions are

Strategy v5 Oscillators & momentumMoving averages
Updated 4 months ago · MIT GitHub repository of Block Function Loop Score

MTF Trend Alignment Strategy

by shubhamtaywade82
1 stars

A strategy that goes long when price is above a moving average on all four timeframes and short when it is below on all four. The defaults are 15 minutes, 1 hour, 4 hours and 1 day, using an SMA, EMA or WMA. An option closes the position as soon as the alignme

Strategy v6 TrendMoving averages Archived
Updated 5 months ago · None stated GitHub repository of MTF Trend Alignment Strategy

Talons Tiered Exit (Memecoin)

by muammeryldrm42
1 stars

This strategy identifies long entry opportunities using a fast and slow EMA crossover, primarily designed for high-volatility tokens. It manages trades using a tiered scaling-out system that closes specified percentages of the position at three configurable pr

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Talons Tiered Exit (Memecoin)

Trend Surfer

by gabriel-klettur
1 stars

Trend Surfer is a multi-timeframe trend-following indicator overlay. It calculates short and long Exponential Moving Averages from a configurable higher timeframe to determine the main market trend direction. The indicator highlights current-interval RSI overb

Indicator v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Trend Surfer
1 stars

Strong Trending - Momentum Rider is a trend-following strategy designed for intraday and swing trading. It evaluates market strength using a composite momentum score based on exponential moving averages, the Directional Movement Index (DMI/ADX), candle body ra

Strategy v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Strong Trending - Momentum Rider

TeeLek KAMA

by theteelek
1 stars

An overlay indicator that computes Kaufman's Adaptive Moving Average using a ten-bar efficiency ratio, then requests it from daily, 12-hour, 6-hour, 4-hour, 2-hour and 1-hour data and smooths each with a short EMA. The lines are coloured by direction in green

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of TeeLek KAMA
1 stars

A price chart overlay by Loxx that applies an N-pole Gaussian filter to a chosen price source, with an optional standard deviation filter that ignores small moves. Sources include regular prices and several Heiken Ashi variants, and Heiken Ashi smoothing can u

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of STD-Filtered N-Pole Gaussian Filter
1 stars

A Pine v4 strategy that plots a 9-period 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 each position when the opposite signal appear

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

RSI + EMA [Alorse]

by Alorse
330 stars

The RSI + EMA strategy combines Relative Strength Index momentum with dual moving average trend filtering to identify trade entries and exits. It plots two configurable moving averages (SMA or EMA) on the main price chart. A long trade opens when the fast movi

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

Donald SPX - Options Trading is an overlay indicator designed for intraday SPX analysis. It plots a 200-period Weighted Moving Average (WMA) on the price chart while evaluating multi-timeframe market structure across Daily, 15-minute, 5-minute, and 2-minute ba

Indicator v5 Moving averagesTrend Repaints
Updated 7 weeks ago · None stated GitHub repository of Donald SPX - Options Trading

Bollinger Bands Force

by harryguiacorn
220 stars

This indicator modifies standard Bollinger Bands to measure directional trend force based on line alignment. It calculates a simple moving average basis along with upper and lower volatility bands. When all three lines move upward or downward simultaneously, i

Indicator v5 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Force

教學範例-回測

by TaichiS
219 stars

This Pine Script strategy demonstrates a basic moving average crossover backtest overlay on the main price chart. It plots a 20-period simple moving average and a 60-period simple moving average. The script enters a long position of 1,000 units when the faster

Strategy v4 Moving averagesTrend
Updated 5 years ago · None stated GitHub repository of 教學範例-回測

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

5 Minute Scalp

by hasnocool
106 stars

This strategy overlays three exponential moving averages on the price chart, with periods of 9, 50, and 200. It calculates a MACD histogram from a 1-minute timeframe, applies Bollinger Bands to the histogram, and tracks two RSI oscillators of different lengths

Strategy v5 ScalpingMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5 Minute Scalp

ATR Bands (ATRBANDS)

by mihakralj
99 stars

This indicator calculates volatility envelope bands around a moving average center line on the price chart. It computes the middle line using a rolling moving average of the input source, while band width is derived from an Average True Range calculated via RM

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of ATR Bands (ATRBANDS)

This strategy identifies breakout entries on low-timeframe cryptocurrency charts by combining rolling pivot support and resistance levels with a smoothed trend filter and a 3-period exponential moving average. Long and short entries trigger when price momentum

Strategy v5 TrendBreakout Repaints
Updated 2 years ago · None stated GitHub repository of V1 Binancash - Futures Strategy Futures 1M Candles

Trend Compass Daily

by chris-c-thomas
14 stars

Trend Compass Daily is a chart overlay indicator designed to evaluate market trend structure, momentum, and volatility. It calculates a multi-EMA ribbon with an anchor level, higher-timeframe reference lines, RSI and MACD divergences, OBV volume context, and A

Indicator v6 TrendMoving averages
Updated 6 months ago · MIT GitHub repository of Trend Compass Daily

Divergenced C002

by ruckard
13 stars

Divergenced C002 is a trading strategy that identifies entry points using price divergences against the Squeeze Momentum Indicator. It compares price moves across Squeeze Momentum color changes to trigger long or short positions. Exits are generated by Curie c

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

This strategy scaffold calculates a standard Volume Weighted Average Price (VWAP) alongside upper and lower volatility bands set 1.5 ATRs away. It generates long entry signals when a confirmed bar closes below the lower band and short entry signals when a conf

Strategy v5 Mean reversionMoving averages
Updated 2 weeks ago · Custom licence GitHub repository of Nexural VWAP Reversion Scaffold

Double MACD

by PipC
8 stars

This indicator plots a customized Moving Average Convergence Divergence oscillator in a separate pane. It calculates MACD, signal line, and histogram values from exponential moving averages, alongside a secondary Hull Moving Average calculation. The script plo

Indicator v4 Oscillators & momentumMoving averages
Updated 4 years ago · None stated GitHub repository of Double MACD
7 stars

This indicator calculates the Relative Strength Index, the Money Flow Index, and a smoothed moving average of the RSI line. It plots these oscillators in a separate pane alongside upper and lower threshold bands. The script identifies momentum shifts by detect

Indicator v6 Oscillators & momentumVolume
Updated 5 months ago · None stated GitHub repository of RSI + MFI + TMA + Divergencias
7 stars

This strategy combines the Moving Average Convergence Divergence oscillator with an Exponential Moving Average trend filter. It enters long positions when the MACD histogram crosses above zero while price stays above the long-term EMA filter. Long trades close

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of MACD EMA Filter Strategy
5 stars

This indicator calculates and plots a customizable weighted moving average directly on the price chart. Users can configure the anchor period across fixed lengths, daily sessions, cumulative bars, or custom session intervals. Weighting options allow adjustment

Indicator v6 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Universal Moving Average

Triangular Moving Average

by SiegerTerpstra
5 stars

The Triangular Moving Average (TMA) indicator calculates a double-smoothed moving average by applying a simple moving average to an existing simple moving average. It plots the resulting line directly on the price chart with dynamic coloring to indicate whethe

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Triangular Moving Average

This strategy seeks long entries by combining moving average trend filters with VMC Cipher momentum and money flow indicators. It identifies bullish trend alignment when price trades above the 200 EMA and records recent pullbacks to the 50 EMA, confirmed by po

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA + VMC Cipher Long Strategy

Signal Engine ANTIGRAVITY

by eltonaguiar
4 stars

This indicator generates buy and sell signals on the price chart by combining RSI, MACD, Bollinger Bands, EMA crossovers, Stochastic, ADX, VWAP, volume confirmation and momentum oscillators. A non-repainting mode option is available along with ATR-based TP and

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Signal Engine ANTIGRAVITY
4 stars

Relative Structure Strength Index is an oscillator indicator that plots in a separate pane. It calculates the Relative Strength Index (RSI) using bar structure power derived from an external library, then smooths the resulting values with a customizable moving

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Relative Structure Strength Index

EMA Cross [trugurpala]

by trugurpala
4 stars

This indicator calculates fast and slow exponential moving averages (EMAs) and plots them directly on the price chart. It detects bullish crossovers and bearish crossunders, marking them with colored triangles above or below price bars. The background dynamica

Indicator v6 Moving averagesTrend Repaints
Updated 2 months ago · MIT GitHub repository of EMA Cross [trugurpala]

My Indicator Name [Lab]

by mitchell-917
4 stars

This indicator is a starter template that plots a simple moving average of a user-selected source over a chosen length. It draws the average as a single line on the price chart. The length input sets the lookback, and the source input selects which price serie

Indicator v5 Moving averages
Updated 11 months ago · Custom licence GitHub repository of My Indicator Name [Lab]

SOKE OVASI

by Kalumur
4 stars

SOKE OVASI is an overlay indicator that combines an Arnaud Legoux Moving Average (ALMA), a Kaufman Adaptive Moving Average (KAMA), and a suite of multiple exponential moving averages (EMAs). It calculates moving averages across higher timeframes, defaulting to

Indicator v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of SOKE OVASI

jash GGMA Granville

by jash-git
3 stars

This indicator overlays five Fibonacci Exponential Moving Averages (EMA 3, 13, 34, 55, and 144) on the price chart, combining Guppy Multiple Moving Average concepts with Granville's rules. Fast EMAs track short-term momentum, slow EMAs reflect medium-term tren

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of jash GGMA Granville
3 stars

This indicator plots three normalized rate-of-change lines of a volume-weighted price deviation in a separate pane. It measures the close against the typical price, multiplies that difference by volume, and smooths the result with a simple moving average of le

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Mid Term Alpha Indicator

This indicator calculates the Moving Average Convergence Divergence (MACD) line, signal line, and histogram in a separate pane. It allows users to select from five moving average types (SMA, EMA, WMA, VWMA, or RMA) for the fast, slow, and signal calculations.

Indicator v6 Oscillators & momentumMoving averages
Updated 12 days ago · MIT GitHub repository of MACD = Moving Average Convergence Divergence

RSI

by TamTH-Dev
2 stars

This indicator calculates a Percentage Price Oscillator using fast and slow exponential moving averages to evaluate price momentum in a separate pane. It identifies dynamic pivot highs and lows along the oscillator line and constructs a zigzag array to determi

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

My First Indicator

by wynnforthework
2 stars

This strategy plots EMA 25 in yellow and EMA 100 in green on the price chart. It generates buy signals on EMA 25 crossing above EMA 100 when ATR length 14 rises over two prior bars and volume exceeds prior bar. It opens a long position of 1 unit on signal. It

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of My First Indicator

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