Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 32)

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

Market Sniper

by kasutu
1 stars

A combined chart overlay that plots EMAs of 20, 50 and 200 bars with a zone around the middle line, an Ichimoku cloud with 9, 26 and 52 bar settings, and order blocks that can show as mitigated. It also marks bullish and bearish break of structure lines, break

Indicator v5 SMC / ICT / price actionTrend
Updated 2 weeks ago · None stated GitHub repository of Market Sniper

STT SR TMA Scale Plan

by majohnst
1 stars

The STT SR TMA Scale Plan is an intraday trading strategy that overlays price charts to execute trades based on Triangular Moving Average (TMA) crossings, VWAP breakouts, and support/resistance levels like daily pivots or Anchored VWAP. Entries are restricted

Strategy v6 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of STT SR TMA Scale Plan
1 stars

This strategy identifies breakout opportunities in Bursa Malaysia stocks using a slow EMA trend filter where price exceeds the 150-period EMA and the slow EMA is above its 150 EMA. It plots fast and slow EMAs on the price chart. Entry occurs on a new 20-day hi

Strategy v5 BreakoutMoving averages
Updated 4 months ago · None stated GitHub repository of KLSE VCP Breakout Backtest
1 stars

This strategy plots a volume-weighted moving average, a Hull moving average, and a linear regression on the price chart. It enters long when the Hull average crosses above the volume-weighted average while stochastic is above 50, on-balance volume is rising, m

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Advanced Indicator Suite
1 stars

This intraday trading strategy combines fast, slow, and trend exponential moving averages with MACD, RSI, and ADX filters to generate trade signals during active trading sessions. It enters long positions when the fast EMA crosses above the slow EMA above the

Strategy v6 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Señales Intradía EMA + MACD v3

Stochastic Final Version

by gabriel-klettur
1 stars

This strategy combines Exponential Moving Averages and a Stochastic Oscillator to generate trading signals directly on the main price chart. Long positions enter when %K crosses above %D below an oversold threshold of 40, exiting on a crossunder above an overb

Strategy v6 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Stochastic Final Version
1 stars

Slow & Steady is a swing trading strategy that identifies trend direction using aligned EMAs of 50, 100, and 200 periods. It generates buy and sell signals when the MACD line crosses its signal line within a confirmed trend, filtered by ADX strength. Entries c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Slow & Steady - Swing Strategy
1 stars

This indicator calculates custom moving average convergence divergence values using selectable calculation methods, fast and slow lengths, source prices, and signal smoothing types. It plots an oscillator on the price chart with customizable vertical placement

Indicator v5 Oscillators & momentumMoving averages Repaints
Updated 9 months ago · None stated GitHub repository of MACD-X Overlay, More Than MACD
1 stars

Marks trend changes on the price chart using price against 20 and 50 period simple moving averages. A bullish trend needs the close above both and a bearish trend below both. A strict alternating rule allows a buy only after a sell and the reverse, so signals

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of RAPF v6.6 [Strict No-Repeat]

Hull Suite by InSilico

by turnupdigital
1 stars

An indicator that plots a Hull moving average on the price chart, with a choice of Hma, Thma or Ehma variants and an adjustable length and multiplier. The current value and the value two bars back form a band that is filled and coloured by trend direction, and

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Hull Suite by InSilico

TeeLek Hedging Ribbon

by theteelek
1 stars

An overlay indicator with no settings that draws coloured Hull moving average lines taken from 2-hour and 30-minute data, smoothed with EMAs. Lines turn grey, green or red depending on slope and on their position against a long-term floor derived from a 600-ba

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TeeLek Hedging Ribbon
1 stars

A strategy that mixes a Stochastic Momentum Index, an EMA pair and MACD histogram conditions. In the visible code it opens long trades when the MACD histogram crosses above zero with price over a 20-period EMA, and closes them on the opposite cross, with stop

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of SMI-MA Short Strategy
1 stars

A separate-pane histogram that shows a fast trend above zero and a slow trend below zero, each as colored bars. The fast trend uses 21, 55 and 89 period simple averages and the slow trend uses 3, 8 and 20 period averages. Green means a bullish stack, yellow a

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Trend Histogram (Fast and Slow)

SAMA

by rajatjpatel
1 stars

A smoothed moving average drawn on the price chart. Before averaging, each price is clamped inside a narrow standard deviation channel built around a short weighted average, which limits the effect of sharp spikes. The clamped price then goes through two weigh

Indicator v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SAMA
1 stars

This Pine v4 strategy trades a crossover of a 10-period and a 30-period simple moving average. It enters long on an upward cross when RSI is above 50 and short on a downward cross when RSI is below 50, with a fixed order quantity. Each entry gets a stop loss a

Strategy v4 TrendMoving averages Archived
Updated 4 years ago · None stated GitHub repository of Take Profits and Stop Losses
1 stars

The EOSBTC EMA Cross Strategy evaluates price action relative to an Exponential Moving Average (EMA) on the main price chart. It enters a long position when a candle opens above the EMA and closes green, and enters a short position when a candle opens below th

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

This indicator calculates a moving average where historical prices are weighted according to a sine function over a user-defined length. It plots directly on the price chart, coloring the line based on whether the slope is rising or falling. Optional settings

Indicator v6 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Sine Weighted Moving Average
330 stars

This strategy plots a multi-timeframe exponential moving average on the price chart while evaluating momentum using the Relative Strength Index. It enters long positions when price exceeds the moving average by at least one percent and RSI crosses above the ov

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of RSI + 1200 Strategy [Alose]
257 stars

Donald SPX - Options Trading is an indicator designed to assist SPX index option traders by tracking session benchmarks and multi-timeframe moving average data. It calculates a 200-period weighted moving average (WMA) and requests multi-timeframe bar data from

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

Acceleration Bands

by capissimo
114 stars

Acceleration Bands is an overlay indicator that plots a volatility envelope around a central simple moving average. It calculates upper and lower boundary bands scaled by the high-to-low bar range relative to the midpoint price, smoothed by an SMA over a user-

Indicator v4 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Acceleration Bands

5 Minute EMA Strategy

by hasnocool
106 stars

5 Minute EMA Strategy is a trend-following system designed for short timeframes that executes trades around moving average crossovers. It plots fast and slow moving averages (supporting EMA, SMA, RMA, or WMA) directly on the price chart. Users can enable an op

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 5 Minute EMA Strategy
92 stars

This indicator plots five moving averages of a chosen source on the price chart, defaulting to EMA lengths 10, 20, 30, 40 and 50. The user can switch the average type to SMA, WMA or HMA and recolor each line. Wide translucent glows sit under the lines, and sof

Indicator v5 TrendMoving averages
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Rainbow MA Ribbon 10-50
55 stars

The script calculates and plots Parabolic SAR with default parameters on the price chart. It also computes Stochastic RSI using a 14-period RSI and 14-period Stoch with 3-period smoothing. Buy signals occur when Stochastic RSI crosses above its signal line fro

Indicator v6 Oscillators & momentumMoving averages
Updated 6 months ago · Apache-2.0 GitHub repository of Parabolic SAR + Stoch RSI

30 min Pivot

by ChartsLector
41 stars

30 min Pivot is an overlay indicator that plots an exponential moving average (EMA) calculated from a specified timeframe (default 30 minutes) and flags specific multi-bar candle setups. It checks the relative distance between price and the higher-timeframe EM

Indicator v5 Moving averagesCandlestick patterns
Updated 4 days ago · None stated GitHub repository of 30 min Pivot

Harness Trivial SMA

by heyphat
26 stars

Harness Trivial SMA is a basic test indicator that calculates and plots a Simple Moving Average (SMA) of the closing price over a user-defined length. Plotted in a separate pane below the chart, it provides a straightforward visual representation of average pr

Indicator v6 Moving averages
Updated 2 months ago · AGPL-3.0 GitHub repository of Harness Trivial SMA

VWMA Band

by tistaharahap
25 stars

The VWMA Band indicator calculates volume-weighted moving averages based on high, low, median (HL2), and close prices over a specified period. It plots an upper band, lower band, median line, and close VWMA directly on the main price chart with a translucent c

Indicator v4 Moving averagesVolatility & bands
Updated 6 years ago · None stated GitHub repository of VWMA Band

HG Strat

by benso87
24 stars

This strategy implements an ADX trend-following system with moving average pullbacks. It identifies strong market momentum when the Average Directional Index exceeds a chosen threshold, then monitors price retests of an exponential or simple moving average. Lo

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of HG Strat

This indicator modifies Perry Kaufman's Adaptive Moving Average by integrating John Ehlers' dominant cycle detection. It filters the selected price source with a high-pass filter and a super smoother, then evaluates Pearson correlation across multiple lags to

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Perry J. Kaufman - Adaptive Moving Average - Modified

Trend Compass 4H

by chris-c-thomas
14 stars

Trend Compass 4H plots a multi-EMA ribbon (10/21/50) along with higher-timeframe reference levels on the price chart. It classifies trend phase into six states and calculates a composite weighted trend score. The script detects RSI and MACD divergences, analyz

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

Divergenced B004

by ruckard
13 stars

Divergenced B004 is a Pine Script strategy that plots on the price chart and looks for divergences in the Squeeze Momentum Indicator. It shorts when a green-section squeeze value falls while price rises, and longs when a red-section squeeze value rises while p

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

WE-Angels

by davro
10 stars

WE-Angels is an overlay indicator that plots optional exponential and simple moving averages, including 111-day and yearly angel averages, on the price chart. It can show Pi Cycle and inverse Pi Cycle crosses with labels, a dollar-cost averaging view, long or

Indicator v4 Moving averagesSupport & resistance
Updated 5 years ago · None stated GitHub repository of WE-Angels

Parabolic SAR - Eterna

by EternaHybridExchange
9 stars

Calculates the Parabolic Stop and Reverse (SAR) indicator paired with an optional Exponential Moving Average (EMA) trend filter. A long position is triggered when price crosses above the SAR while remaining above the trend EMA. A short position is entered when

Strategy v5 TrendMoving averages
Updated 7 months ago · MIT GitHub repository of Parabolic SAR - Eterna

Signals MA

by lunarticktrading
7 stars

The Signals MA indicator calculates a moving average of the close price using either SMA or EMA based on a user-defined length. It plots this average on the price chart. Breakout signals occur when the close crosses above the moving average from below, and bre

Indicator v6 Moving averagesBreakout
Updated 2 weeks ago · None stated GitHub repository of Signals MA
7 stars

This strategy generates trading signals based on a triple confluence of Exponential Moving Averages (EMA), the Relative Strength Index (RSI), and MACD histogram momentum. Long entries require a fast EMA above a slow EMA, price above the fast EMA, RSI between 5

Strategy v5 TrendOscillators & momentum
Updated 3 months ago · MIT GitHub repository of Triple Confluence (EMA+RSI+MACD)

This indicator plots On Balance Volume in a separate pane and can overlay a smoothing average of that series. By default it draws a 20-period SMA of OBV with Bollinger Bands set two standard deviations away, plus a fixed 10-period EMA of OBV. A fill between th

Indicator v6 VolumeVolatility & bands
Updated 5 months ago · None stated GitHub repository of On Balance Volume & Bolliner Bands

This strategy calculates the full Ichimoku Kinko Hyo indicator system, plotting the Tenkan-sen, Kijun-sen, Senkou Spans, Chikou Span, and Kumo Cloud directly on the price chart. It enters long positions when the Tenkan-sen is above the Kijun-sen while price tr

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo: TK Cross Strategy
5 stars

Calculates an adaptive tracking model using a Mechanical Feedback Price Model to measure price innovations. It evaluates positive and negative deviations through peak decay and saturation functions to determine dynamic intensity levels. It applies these intens

Indicator v6 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Universal Adaptive Tracking
5 stars

This indicator plots 50-period and 200-period exponential moving averages on the price chart while calculating money flow index and WaveTrend oscillators in the background. Long signals trigger when price trends above the 200 EMA with a recent 50 EMA pullback,

Indicator v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA + VMC Cipher B
4 stars

This strategy trades exponential moving average crossovers tailored for the German DAX market during Xetra session hours. It enters long positions on bullish EMA crossovers and short positions on bearish crossovers, provided the bar falls within 09:00 to 17:30

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of DAX Germany Strategy [trugurpala]

NYSA-Trend Kanali

by Kalumur
4 stars

NYSA-Trend Kanali combines Parabolic SAR, higher-timeframe exponential moving averages, and weekly MACD signals on the price chart. It calculates Parabolic SAR to highlight trend shifts with visual buy and sell labels, plots weekly 8-period and 13-period EMAs,

Indicator v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of NYSA-Trend Kanali

jash GGMA Granville

by jash-git
3 stars

This indicator implements a modified Guppy Multiple Moving Average system based on Fibonacci periods (3, 13, 34, 55, and 144 EMAs) combined with Granville rules. It detects reset crossover signals when the 3 EMA crosses the 55 EMA with price confirmation, as w

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

The Long Term Alpha Indicator computes a weighted alpha from price change (close minus average of high low close) multiplied by volume and smoothed via simple moving average. It produces EMAs of this weighted alpha at fixed lengths of 110 30 and 8. Each EMA is

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

MA Spread Histogram

by piecioshka
2 stars

MA Spread Histogram calculates the difference between two configurable moving averages and plots the result as a color-coded column histogram in a separate pane. The histogram bars highlight expanding or contracting momentum across the zero line. When the shor

Indicator v6 Oscillators & momentumMoving averages
Updated 12 days ago · MIT GitHub repository of MA Spread Histogram

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