Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 23)

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

92 stars

Calculates fast and slow Simple Moving Averages to display a visual rainbow ribbon on the price chart. The indicator fills multiple gradient bands between the dual moving averages and adds visual effects like glowing SMA halos, animated palette shifts, and reg

Indicator v6 Moving averagesTrend
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Rainbow Wave 20/40

EMA

by dcaoyuan
55 stars

This indicator calculates and plots three Exponential Moving Averages directly on the main price chart. It includes configurable inputs for fast, slow, and slowest moving averages, defaulting to 9, 21, and 36 periods based on bar close values. Traders can adju

Indicator v6 Moving averagesTrend
Updated 6 months ago · Apache-2.0 GitHub repository of EMA

Calculates normalized moving average trend strength, historical volatility, and volatility-adjusted position sizing in a separate pane. It computes the percentage distance between fast and slow EMAs relative to price, evaluates standard deviation of daily retu

Indicator v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Risk-Based Position Size Calculator

MACD

by thanhnguyennguyen
33 stars

This indicator calculates and plots the Moving Average Convergence Divergence (MACD) line, signal line, and a four-color histogram in a separate chart pane. It computes the difference between fast and slow moving averages to determine momentum shifts. Users ca

Indicator v4 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of MACD
16 stars

This Pine Script implements a trend-following strategy inspired by John Seykota's methods. It enters positions on Donchian channel breakouts using a longer lookback period of 55 bars and exits on shorter 10-bar signals. Volatility gating prevents adding to pos

Strategy v6 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of Seykota Alt 13: Vol-Gated Adds

HalfTrend + EMA

by msongkiet
16 stars

This indicator combines the HalfTrend trend-following algorithm with five exponential moving averages overlayed directly on the price chart. HalfTrend determines directional bias by evaluating local high and low price extrema over a selectable amplitude alongs

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of HalfTrend + EMA

Crossing EMAs B

by ruckard
13 stars

Crossing EMAs B is a moving average crossover strategy designed as an example for Zignaly bot signal integration. It monitors a 14-period and a 28-period simple moving average on close prices, entering long when the short average crosses above the long average

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Crossing EMAs B

NFI v7.2.1

by koradiyakaushal
12 stars

This strategy is a Pine Script implementation of the NostalgiaForInfinity crypto strategy. It calculates indicator metrics across multiple timeframes and compares price action against a master pair such as BTC/USDT. Settings allow traders to configure informat

Strategy v4 TrendMoving averages
Updated 5 years ago · MIT GitHub repository of NFI v7.2.1

Dual Moving Average

by hirawatt
11 stars

The Dual Moving Average strategy calculates fast and slow exponential moving averages based on HLC3 prices. It generates long signals when the fast EMA crosses above the slow EMA and short signals when it crosses below. Position sizing can be calculated dynami

Strategy v4 Moving averagesTrend Repaints
Updated 2 years ago · MIT GitHub repository of Dual Moving Average

Bte Strat

by f-cksociety
11 stars

Bte Strat provides a backtesting and trading engine framework implemented as an indicator on the price chart. It evaluates trade signals using selectable entry rules, technical filters like volume and moving averages, and dynamic exit strategies. The script pl

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Bte Strat
10 stars

This indicator calculates custom Traders Dynamic Index (TDI) conditions on the price chart using a 30-period Relative Strength Index (RSI), volatility bands, and fast/slow RSI moving averages. It plots green buy labels below bars and red sell labels above bars

Indicator v4 Oscillators & momentumVolatility & bands
Updated 5 years ago · None stated GitHub repository of My TDI B/S BTC 1D
9 stars

Calculates volume-weighted average price anchored to automatically detected swing pivots, period starts, or a custom manual timestamp. It plots volume-weighted standard deviation bands with configurable multiples and measures price distance from VWAP in standa

Indicator v6 Moving averagesVolatility & bands Repaints
Updated 3 days ago · MIT GitHub repository of Anchored VWAP [WavesUnchained]

Nexural JMA

by JasonTeixeira
9 stars

Nexural JMA plots a Jurik moving average on the price chart. Length, phase, power, and source change the average. It scores momentum from rate of change, volume from a volume percentile, volatility from ATR, and trend strength from price distance to the averag

Indicator v6 Moving averagesOscillators & momentum
Updated 2 weeks ago · Custom licence GitHub repository of Nexural JMA

This strategy plots a fast and a slow moving average on the price chart and enters when their relationship flips, subject to an optional ADX filter. It goes long when the fast average is above the slow average and short when it is below, reversing an existing

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Crossing Moving Averages with ADX Filter
7 stars

This strategy plots a customizable Bollinger Band basis using selectable moving average types such as HMA, SMA, EMA, or others. It draws the basis line, multiple standard deviation levels, and fills the region between L1 and L6 on the price chart. Buy signals

Strategy v5 Volatility & bandsMoving averages
Updated 4 months ago · None stated GitHub repository of Bollinger Bands Strategy

This strategy plots a 90-period exponential moving average from the weekly and daily charts plus a daily session VWAP on the price chart. It enters long when the weekly VWAP is above the weekly average and the daily VWAP crosses above the daily average, and en

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 1W Bullish Buy 1D Bearish Sell Session EMA

Confluence

by trsdn
6 stars

The Confluence indicator combines Bollinger Bands, RSI and MACD to generate signals on the price chart. It plots the upper Bollinger Band in green, lower Bollinger Band in red, the middle basis in blue, the RSI value and the MACD line with signal. A confluence

Indicator v5 TrendOscillators & momentum
Updated 7 days ago · MIT GitHub repository of Confluence
6 stars

Capital41 Confluence Core plots an EMA or SMA on the price chart and combines its direction with RSI, Williams %R, and a liquidity-sweep check into long and short confluence signals. Signal strictness is Strict, Standard, or Loose, which changes how far the os

Indicator v6 Oscillators & momentumMoving averages
Updated 2 months ago · MIT GitHub repository of Capital41 Confluence Core

Cerebr Centauri Strategy

by jerryinyang
5 stars

Cerebr Centauri Strategy is a multi-indicator trading system for Pine Script v4 that combines Moving Averages (SMA, EMA, LSMA, WMA), Stochastic Oscillator, RSI, and MACD across both current and higher timeframes. It evaluates trend conditions and oscillator st

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Cerebr Centauri Strategy

This short-only trading strategy combines 20 and 50 period Exponential Moving Averages with a pivot low breakout filter. A short entry triggers when the 50 EMA is above the 20 EMA, recent candle closes remain below the 50 EMA while reaching above the 20 EMA, a

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 20 EMA + 50 EMA + Breakout Short Strategy (5M)
4 stars

This strategy is a multi-strategy backtesting engine that draws entries and exits on the price chart. The user picks one approach, including Connors RSI-2, z-score mean reversion, EMA and MACD momentum, Bollinger squeeze, VWAP reversion, Supertrend, Ichimoku,

Strategy v6 Oscillators & momentumMean reversion Repaints
Updated 2 days ago · None stated GitHub repository of Simpleton v0.01 CURSOR [Elton Engine]

Moving Average Pair

by InNoobWeTrust
4 stars

Moving Average Pair calculates and plots two customizable moving averages on the price chart. Users can choose separate moving average types, length periods, source prices, and line styling for both the fast and slow lines. The indicator detects bullish crosso

Indicator v6 Moving averagesTrend
Updated 2 days ago · None stated GitHub repository of Moving Average Pair
4 stars

This intraday strategy executes trades using dual EMA crossovers and RSI mean-reversion near VWAP. Designed primarily for 5-minute index futures charts like ES and MES, it offers momentum entries on fast and slow EMA crosses confirmed by VWAP, as well as count

Strategy v6 Moving averagesOscillators & momentum
Updated 3 days ago · None stated GitHub repository of Ultimate Combo v2 (Relaxed)

RSI EMA Breakout

by latentwill
4 stars

This strategy trades momentum breakouts by combining an Exponential Moving Average with the Relative Strength Index. It enters a long position when the closing price is above the EMA and the RSI crosses above the breakout threshold. It enters a short position

Strategy v5 TrendOscillators & momentum
Updated 8 days ago · None stated GitHub repository of RSI EMA Breakout

TF Bias Detector (SMC)

by Sidoine1991
4 stars

This indicator tracks multi-timeframe momentum and trend direction across M1, M15, H1, and H4 horizons. It plots four 14-period RSI curves in a separate pane alongside 30, 50, and 70 reference levels. Directional bias values are calculated by comparing price t

Indicator v6 Oscillators & momentumMoving averages
Updated 2 weeks ago · MIT GitHub repository of TF Bias Detector (SMC)
4 stars

This long-only strategy identifies mean-reversion dip opportunities within established uptrends on daily charts. It opens a position when price is trading above a simple moving average and the Relative Strength Index (RSI) crosses back above a specified overso

Strategy v6 Mean reversionOscillators & momentum
Updated 5 months ago · None stated GitHub repository of RSI Mean Reversion (Long Only)

Japo [Alorse]

by Hugs-4-Bugs
4 stars

This strategy plots a fast EMA and a slow EMA of Heikin Ashi closes requested from two higher timeframes, both drawn on the price chart. It enters long when the fast average crosses above the slow average and enters short on the opposite cross, only inside a u

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Japo [Alorse]

FRAMA Strategy

by ShabbirHasan1
4 stars

Calculates a Fractal Adaptive Moving Average (FRAMA) and signal line using multi-timeframe security data, plotted directly on the price chart. Includes an optional SuperTrend filter with customizable factors and period for signal confirmation and visual entry

Strategy v4 Moving averagesTrend Repaints
Updated 1 year ago · Custom licence GitHub repository of FRAMA Strategy

My Strategy Coding

by fox-buddy
4 stars

This script executes a trend-following strategy based on simple moving averages and exponential moving averages. It enters a long position when the 5-period SMA is above the 10-period SMA and the 10-period SMA is above the 34-period EMA. It enters a short posi

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of My Strategy Coding

EFELER-DDT

by Kalumur
4 stars

EFELER-DDT plots multiple moving average overlays and pivot-based support and resistance levels directly on the price chart. It calculates dual Weighted Moving Averages (9 and 15 WMA), three standard Exponential Moving Averages (20, 50, and 200 EMA), and three

Indicator v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of EFELER-DDT

EMA_SMA

by might-tree
4 stars

This indicator draws a 21-period exponential moving average and a 21-period simple moving average of the closing price directly on the price chart. The exponential average is blue and the simple average is red. Settings for length, source, and offset are decla

Indicator v5 Moving averages
Updated 3 years ago · None stated GitHub repository of EMA_SMA

Bollinger Bands

by bfoura
4 stars

This indicator calculates standard Bollinger Bands using a simple moving average basis line along with upper and lower bands derived from standard deviation. It includes logic to detect when price action comes within a configurable distance of the lower or upp

Indicator v4 Volatility & bandsMoving averages
Updated 4 years ago · None stated GitHub repository of Bollinger Bands

This long-term trend-following indicator plots three Weighted Moving Averages (13, 48, and 200 periods) directly on the main price chart. It evaluates price crossovers against each moving average to detect early trend shifts, alongside crossovers between WMA l

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snag - Swing Trade Long Term V3

RSI-7 Breakout

by aofwittawat
4 stars

This strategy identifies breakout trades using a 7-period RSI combined with price extreme lookbacks. A long entry triggers when the RSI rises above 70 and price reaches a new lookback high, provided price remains above an optional EMA trend filter and passes a

Strategy v5 Oscillators & momentumBreakout
Updated 4 years ago · None stated GitHub repository of RSI-7 Breakout
3 stars

This indicator plots an eight-period and a twenty-period exponential moving average on the price chart and colors candles by their relationship. Candles are green when the faster average is above the slower average and red when it is below. The average lengths

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of 8/20 Cross Colored Candles

Ultimate Trading System

by EngineeredSuccess
3 stars

The Ultimate Trading System is an integrated indicator that combines multiple analysis methodologies—including Pi Cycle Top, SPX/Gold ratio, Elliott Wave, and multi-source market signals—into a composite oscillator scored from 0 to 100. Plotted in a separate p

Indicator v6 Screeners & dashboardsOscillators & momentum
Updated 1 year ago · Custom licence GitHub repository of Ultimate Trading System

DFO 3

by jawauntb
3 stars

DFO 3 plots a directional flow oscillator in a separate pane. It averages five normalized components: a composite RSI momentum index, a cumulative volume delta built from one-minute volume, a price position over a 100-bar range, an EMA-versus-SMA trend spread,

Indicator v5 Oscillators & momentumVolume
Updated 2 years ago · GPL-3.0 GitHub repository of DFO 3

Currency Strength Chart

by itmakesyousick
3 stars

Calculates and plots the relative strength lines for major currencies including EUR, USD, JPY, GBP, CHF, AUD, CAD, and NZD in a separate pane. It evaluates cross-rate movement using data from major Forex brokers like OANDA or FOREXCOM. Users can smooth the str

Indicator v5 Oscillators & momentumMoving averages
Updated 4 years ago · None stated GitHub repository of Currency Strength Chart
2 stars

MasterTrader V1 is an indicator that plots two exponential moving averages (fast length 9, slow length 21) and RSI (length 14) on the close price chart. It generates long entry signals when the fast EMA crosses above the slow EMA, RSI stays between 30 and 70,

Indicator v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of MasterTrader V1 Master Trader
2 stars

This intraday strategy is designed for 5-minute ETF trading, specifically tailored for leveraged assets like TQQQ. It evaluates simple moving average alignment across three lengths and calculates consecutive rising or falling bars over a lookback window to ide

Strategy v6 TrendMoving averages
Updated 9 days ago · None stated GitHub repository of TQQQ MA Accumulation v3-5m
2 stars

The SuperTrend Regime Confluence strategy combines an adaptive SuperTrend indicator with market regime detection to generate trading signals. It computes a composite conviction score using an ADX regime lookback, a trend EMA, and a volume moving average. Trade

Strategy v6 TrendVolatility & bands
Updated 2 weeks ago · MIT GitHub repository of SuperTrend Regime Confluence

Strategy Examples

by danielbodnar
2 stars

Strategy Examples is a Pine Script strategy template demonstrating multiple classic technical trading approaches directly on the price chart. It incorporates a moving average crossover system using SMA or EMA, an RSI mean reversion model operating on overbough

Strategy v6 Moving averagesOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Strategy Examples

BOT SLP 2H ZEGUELA DEMABOT

by danielvm-git
2 stars

This strategy calculates DEMA values using configurable lengths and detects crossovers and crossunders to generate long and short entry signals on the price chart. It plots multiple DEMAs with green, red, and fuchsia colors for visual reference. The main setti

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of BOT SLP 2H ZEGUELA DEMABOT

IBD Power Trend

by major
2 stars

This indicator tracks Investor's Business Daily style Power Trend rules and setup conditions in a separate pane. It evaluates whether price lows hold above an exponential moving average, verifies that the fast EMA remains above a rising simple moving average,

Indicator v6 TrendMoving averages
Updated 3 months ago · Apache-2.0 GitHub repository of IBD Power Trend

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