Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 17)

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

Calculates higher timeframe Exponential Moving Averages, Average True Range, and optional RSI momentum filters to determine market regimes. Enters long positions during bullish regimes and allows scaling in through pyramiding as price advances by a user-define

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Bitcoin Regime Pyramid Strategy

Mc War OB + EMA

by tuanmcwar
2 stars

Plots 34-period and 89-period exponential moving averages alongside Smart Money Concept order blocks directly on the price chart. It visualizes bullish and bearish order block zones as customizable boxes, identifies confluence between order blocks and fair val

Indicator v5 SMC / ICT / price actionMoving averages
Updated 2 years ago · None stated GitHub repository of Mc War OB + EMA
2 stars

Weekend Trend Trader Overlay plots a 20-bar highest close as a resistance line and a ratcheting trailing stop on the price chart. It reads a chosen index, by default NASDAQ:NDX, on the chart timeframe and compares that close with a 10-bar simple moving average

Indicator v5 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of Weekend Trend Trader Overlay
2 stars

Combined Candle Counter overlays multiple technical analysis tools directly onto the price chart. It features configurable EMA and SMA moving average presets with automated toggles based on intraday, daily, or weekly timeframes. The indicator draws 52-week hig

Indicator v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · MIT GitHub repository of Combined Candle Counter

Saty Pivot Ribbon

by mikah13
2 stars

Saty Pivot Ribbon plots a three-EMA ribbon on the price chart to show trend direction and dynamic support or resistance. Fast, pivot, and slow exponential moving averages form two colored clouds that switch between bullish and bearish colors. Optional convicti

Indicator v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Saty Pivot Ribbon

The script computes a Nadaraya-Watson kernel regression estimate using a rational quadratic kernel on the input source. It plots the estimate as a line on the price chart. Bullish and bearish color changes occur when the estimate crosses or reverses direction

Indicator v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Nadaraya-Watson: Rational Quadratic Kernel Non-Repainting
2 stars

This indicator calculates and plots multiple pairs of moving averages on the price chart, including 10/30, 5/13, 34/50, 72/89, and 180/200. Each pair fills a colored cloud between the short and long EMAs, with color changing based on which average is above the

Indicator v4 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of 10/30 Ripster EMA Clouds
2 stars

This indicator calculates and plots variations of the Hull Moving Average directly on the price chart. Users can select between standard Hull MA, Exponential Hull MA, and Triple Hull MA. The output can be displayed as a single moving average line or as a two-l

Indicator v4 Moving averagesTrend
Updated 3 years ago · Apache-2.0 GitHub repository of Hull Suite by InSilico

My Strategy

by storm0611
2 stars

The script implements a basic moving average crossover trading strategy directly on the price chart. It calculates a 14-period and a 28-period simple moving average (SMA) and plots them as green and red circles. It enters a long position when the fast SMA cros

Strategy v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of My Strategy

Simple EMA Candle

by minaecer
2 stars

This indicator plots colored candles on the price chart using three Exponential Moving Averages. The 30-period EMA serves as the open, the 15-period EMA as the high, and the 10-period EMA as the low, with the original close value. Bar colors change based on co

Indicator v4 Moving averagesCandlestick patterns
Updated 4 years ago · MPL-2.0 GitHub repository of Simple EMA Candle

Oversold

by kat3samsin
2 stars

The oversold strategy identifies oversold conditions using the relative strength index with a 14 period. It applies an arithmetic linear moving average with a 20 period for trend filtering and requires the price to stay within 15 percent of this average. Stoch

Strategy v4 Mean reversionOscillators & momentum
Updated 5 years ago · MIT GitHub repository of Oversold

Average Pivot Range - JD

by JorisDuyck
2 stars

Calculates the price range between swings determined by Jurik Moving Average turning points as an alternative to Average True Range (ATR). The script computes the magnitude of upward and downward price movements between pivots, displaying values in percentage

Indicator v4 Volatility & bandsMoving averages
Updated 5 years ago · MIT GitHub repository of Average Pivot Range - JD

MA Slope

by xopromo
1 stars

An indicator on the price chart that trades the turning points of a moving average. A long or short idea starts when the average changes direction beyond a minimum slope filter. Exits come from slope slowing, the price to average spread narrowing or the averag

Indicator v6 Moving averagesTrend
Updated 2 days ago · None stated GitHub repository of MA Slope

Bollinger Bands

by mydcc
1 stars

The Bollinger Bands indicator plots a middle band calculated from a moving average of the selected source and upper and lower bands that are a specified number of standard deviations away from the middle band. Users can adjust the length of the moving average,

Indicator v6 Moving averagesVolatility & bands
Updated 2 days ago · Custom licence GitHub repository of Bollinger Bands

Intraday Regime Follower

by nvolpe2007-cell
1 stars

A long and short trend strategy that compares a 50-bar and 200-bar EMA with price position and EMA slope. It goes long in an uptrend, short in a downtrend and flat otherwise. A hysteresis band must be broken before the state flips, and an ATR-versus-cost gate

Strategy v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Intraday Regime Follower

EMA-Volume

by engtuncay
1 stars

EMA-Volume plots two exponential moving averages on the price chart and marks when the faster average crosses the slower one. It also calculates a simple moving average of volume and treats volume as high or low relative to that average. Ordinary crosses get s

Indicator v6 TrendMoving averages
Updated 7 days ago · None stated GitHub repository of EMA-Volume

MA + R:R Strategy (tuned)

by MuhammadMuhamid
1 stars

A long-only crypto spot strategy variant that makes a multi-timeframe moving average trend the primary entry trigger, with 300-period averages on one-minute and five-minute charts and a rising-slope requirement. Other trend, volume and structure filters are av

Strategy v6 TrendMoving averages
Updated 13 days ago · None stated GitHub repository of MA + R:R Strategy (tuned)

EMA 20/50 Cross

by quantxaashish
1 stars

This indicator calculates 20-period and 50-period exponential moving averages (EMAs) to identify trend direction and crossover signals. It plots both EMA lines directly on the chart and displays visual shape markers below or above price bars whenever a bullish

Indicator v5 Moving averagesTrend
Updated 2 weeks ago · MIT GitHub repository of EMA 20/50 Cross
1 stars

A strategy visualizer, with no real orders, that tracks a 200-bar moving average of lows on the 1-hour timeframe. When price touches the average it arms, then marks long or short entries on a wick rejection seen on 5 or 15 minute candles, or a run of three sam

Indicator v6 Mean reversionSupport & resistance Repaints
Updated 2 weeks ago · None stated GitHub repository of MA200 Wick Rejection

Hull Moving Average

by AkashSasikumar47
1 stars

A Pine v6 indicator that plots the Hull Moving Average on the price chart. It is built from weighted moving averages: twice a half-length average minus a full-length average, then smoothed over the square root of the length. This keeps lag low while staying sm

Indicator v6 Moving averagesTrend
Updated 2 weeks ago · MIT GitHub repository of Hull Moving Average

Ichimoku Cloud

by AkashSasikumar47
1 stars

The Ichimoku Cloud indicator plots five lines: Conversion Line, Base Line, Lagging Span, Leading Span A, and Leading Span B, forming a cloud on the price chart. It shows trend and momentum by position relative to the cloud: above green is bullish, below red is

Indicator v6 TrendMoving averages
Updated 2 weeks ago · MIT GitHub repository of Ichimoku Cloud
1 stars

This overlay strategy combines a fast and slow EMA, MACD, and RSI smoothed by an EMA. It opens a long when any one of those three crosses bullish while the other two stay aligned upward, and it opens a short on the matching bearish combination. Trades are limi

Strategy v5 TrendOscillators & momentum
Updated 3 weeks ago · None stated GitHub repository of EMA + MACD + RSI Strategy
1 stars

A test strategy used to check how a converter handles broker emulation. It goes long when a 9-period EMA crosses above a 21-period EMA and short on the opposite cross. Open longs get a stop and a limit set from ATR multiples, while shorts get an ATR-based trai

Strategy v6 TrendMoving averages
Updated 3 weeks ago · Apache-2.0 GitHub repository of AlphaResin Conformance 3

MACD

by DEVfancybear
1 stars

This indicator calculates and plots the standard Moving Average Convergence Divergence oscillator in a separate chart pane. It computes a fast exponential moving average and a slow EMA, derives the MACD line from their difference, and calculates a smoothed sig

Indicator v6 Oscillators & momentumMoving averages
Updated 7 weeks ago · MIT GitHub repository of MACD

PowerTrend

by peterdmv
1 stars

PowerTrend is a price-chart overlay that recreates Webby's Power Trend. It plots a configurable EMA and SMA, counts consecutive days the low stays above the EMA and the EMA stays above the SMA, and starts an uptrend when those counts, a rising SMA, and an up c

Indicator v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of PowerTrend

Signal Overlay

by insomniac-asif
1 stars

A chart overlay with three exponential moving averages of 9, 21 and 50 bars, plus manual marker toggles for long, short, entry, stop hit and target hit on the latest bar. The setup type and a conviction score are typed in by the user and shown in the label. It

Indicator v6 Sessions & timeMoving averages
Updated 2 months ago · MIT GitHub repository of Signal Overlay

APM v7 BTC/USD ALL

by rcaldwell67
1 stars

APM v7 BTC/USD ALL is an indicator that plots three exponential moving averages on the price chart for BTC-USD. It calculates EMA Fast, EMA Mid, and EMA Slow using user-defined lengths. Additional momentum oscillators include RSI, MACD, Stochastic, and CCI. Th

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of APM v7 BTC/USD ALL

Ribbon

by FranklyBrandon
1 stars

A very small Pine v4 strategy that plots simple moving averages of 5, 8 and 13 bars, each rounded to two decimals, in a separate pane. When all three rounded values are exactly equal, which will be rare, it sends one buy order and a second order that is also l

Strategy v4 Moving averages
Updated 3 months ago · None stated GitHub repository of Ribbon
1 stars

This strategy plots an anchored volume-weighted average price and two standard-deviation bands on the price chart. It buys dips below the inner band when a short RSI is oversold and an optional EMA trend filter agrees, and it can sell rallies above the inner b

Strategy v6 Mean reversionMoving averages
Updated 3 months ago · MIT GitHub repository of VWAP Reversion Bands [QuantForge]

Unified Trade Strategy

by ashishgkwd
1 stars

Unified Trade Strategy is the strategy version of a combined signal. It goes long when price breaks above a Nadaraya-Watson envelope band, the fast EMA is above the slow EMA, the trend channel slopes up and RSI is in a bullish rising band; shorts mirror this.

Strategy v6 TrendOscillators & momentum
Updated 4 months ago · None stated GitHub repository of Unified Trade Strategy

This strategy trades long only on the price chart. It enters when price pulls back near the EMA20 and closes back above it, while the MACD line and signal stay above zero and the histogram is not falling. A longer trend EMA must sit below price and the EMA20,

Strategy v6 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Doc01 MACD Zero Pullback EMA20 - Project Adapted

Forex EMA Trend with ATR Risk

by PETERSAMUELOPS12
1 stars

A forex strategy that follows a fast and slow EMA crossover, filtered by a 200-period EMA so longs trade only above it and shorts only below. An RSI filter blocks longs when overbought and shorts when oversold, and a session filter limits trading to a chosen w

Strategy v6 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Forex EMA Trend with ATR Risk

Builds several moving averages, including EMA and Hull types, and weights them with an adaptive scheme controlled by a lambda value, a decay percentage and a robustness setting of length sets. The combined result classifies trend as long or short using positiv

Indicator v5 TrendMoving averages
Updated 6 months ago · MIT GitHub repository of Adaptive Trend Classification: Moving Averages

EMA + RSI Strategy

by Sandesh30-cloud
1 stars

This trend-following strategy combines two Exponential Moving Averages with the Relative Strength Index to identify long trade setups. It calculates a 50-period fast EMA, a 200-period slow EMA, and a 14-period RSI. A long position is triggered when the fast EM

Strategy v5 TrendOscillators & momentum
Updated 6 months ago · None stated GitHub repository of EMA + RSI Strategy

BTC ATH Golden Cycle

by ymlee1104
1 stars

This strategy overlays Bitcoin cycle timing, an all-time-high rise and drop model, and optional chart studies on the price chart. It sizes positions as a percentage of equity and allows up to five stacked entries in the same direction. Users can show an EMA ra

Strategy v6 TrendMoving averages Repaints
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle

Ensemble ML Predictor

by haydarkadioglu
1 stars

This indicator overlays a weighted ensemble of three models on the price chart. It compares the current bar with historical bars using RSI, volume ratio, price change and range position, then blends that KNN vote with a linear-regression projection and an EMA-

Indicator v5 AI / machine learningOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Ensemble ML Predictor
1 stars

The Donchian Breakout Strategy is a Turtle-style breakout system that plots Donchian channels on the price chart. It generates long entries when the close price crosses above the upper channel and short entries when crossing below the lower channel. Exits are

Strategy v5 BreakoutTrend
Updated 11 months ago · None stated GitHub repository of Donchian Breakout Strategy

NakInvest Cross EMA

by feliperazeek
1 stars

This strategy trades three-candle reversal patterns, called 123, PFR and engulfing, together with a 9, 40 and 80 EMA trend stack. Entries can occur when price crosses the fast EMA without crossing the slower ones, or when it crosses all of them. Optional volum

Strategy v5 Candlestick patternsMoving averages
Updated 1 year ago · None stated GitHub repository of NakInvest Cross EMA

StrongBuy

by dsjrego
1 stars

A minimal overlay that watches a 20-period EMA and prints a green STRONGBUY label below the bar each time the close crosses above it. It has no inputs, no exit logic and no filters, so every upward cross of the average produces a label, including during sidewa

Indicator v5 Moving averages
Updated 1 year ago · None stated GitHub repository of StrongBuy

Smoothed Heiken Ashi

by turnupdigital
1 stars

An indicator that draws smoothed Heiken Ashi candles on the price chart. Prices are smoothed with a selectable moving average type and length before the Heiken Ashi calculation and again afterwards, using an imported library of average types. Candles are shade

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Smoothed Heiken Ashi
1 stars

This indicator plots envelope bands based on a moving average or exponential moving average of a chosen price source. It computes RSI with user-set length and source. Signals trigger on crossovers: buy when price crosses the lower envelope band while RSI falls

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of ENVELOPE - RSI - Buy Sell Signals

ETHBTC MTPI

by Mikelkulla
1 stars

ETHBTC MTPI is a multi-indicator trend-following strategy designed for crypto pairs to determine relative market strength. It combines up to five toggleable components: Liquidity-Weighted Supertrend, dual exponential moving averages, DEMA Supertrend, DEMA AFR,

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of ETHBTC MTPI
1 stars

The IBKR Safe Forex Strategy is a Pine Script v6 strategy that trades forex pairs using crossovers of 10-period and 50-period EMAs, filtered by a 200-period EMA and restricted to London or New York session overlap. It enters long positions on fast EMA above sl

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of IBKR Safe Forex Strategy
1 stars

This overlay indicator finds pivot highs and lows from high/low or close/open prices and uses them to draw support and resistance channels and trend lines on the price chart. Minimum strength, maximum channel width, and a cap on how many S/R levels appear filt

Indicator v5 Support & resistanceMoving averages
Updated 1 year ago · None stated GitHub repository of AMD-strategy (All Fixes)
1 stars

This strategy plots price and Bollinger Bands on the chart using a 120-bar SMA basis and 2 standard deviation multiplier. It generates signals from band touches and an exit SMA of 110 bars. Risk management limits losses to 6 percent of trade value. Money manag

Strategy v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Strategy
1 stars

HMA-Kahlman Trend & Trendlines plots a smoothed directional trend ribbon directly on the price chart by combining Hull Moving Average calculations with an optional Kalman filter. It evaluates two moving lines alongside their average, changing color to reflect

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of HMA-Kahlman Trend & Trendlines

Fractal Enculfing Caldles

by fiji-solutions
1 stars

This indicator identifies bullish and bearish engulfing candlestick patterns directly on the price chart. To refine signal quality, it provides three optional filters: an ATR filter to cap maximum candle size relative to volatility, a swing high or low filter

Indicator v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Fractal Enculfing Caldles

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