Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 59)

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

Keltner Channel (KC)

by mihakralj
99 stars

This indicator calculates a Keltner Channel on the price chart. The middle line is an exponential moving average of the chosen source, with a warmup weight so the average builds from the first bars. Upper and lower bands sit a multiple of average true range aw

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Keltner Channel (KC)

Williams Alligator

by TWODS-CAPITAL
37 stars

This indicator plots Bill Williams' Alligator system directly on the price chart. It calculates three smoothed moving averages based on the median price (hl2) representing the Jaw, Teeth, and Lips lines, each projected forward into future bars via plot offsets

Indicator v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Williams Alligator

UnfairValueGap A004

by ruckard
13 stars

UnfairValueGap A004 is a strategy that identifies value gaps on the price chart and trades based on gap filling dynamics. It calculates the distance between the current price and the far side of a recent gap, taking positions in anticipation of trend continuat

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of UnfairValueGap A004
3 stars

Miller Boy Custom Study calculates a 105-period Simple Moving Average (SMA) of close prices, functioning as a trend baseline. It identifies buy signals when a bar open price crosses above the SMA baseline and sell signals when the open price crosses below it.

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Miller Boy Custom Study

Minervini Qualifier

by regalouisei
2 stars

Calculates Mark Minervini Trend Template criteria to identify stocks in strong uptrends. It evaluates key conditions based on 50-day, 150-day, and 200-day Simple Moving Averages, 52-week high and low price ranges, and relative strength against a customizable r

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Minervini Qualifier

This strategy calculates and plots smoothed Heikin-Ashi candles directly onto the main price chart using exponential moving averages of open, high, low, and close prices. It enters a long position after three consecutive bullish smoothed candles with sequentia

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Abdoli's Heikin Ashi Smoothed Buy & Sell Strategy Rev.4

UnfairValueGap B003

by ruckard
13 stars

This strategy calculates the distance between the current price and the opposite end of a recent price gap. It trades against gap completion under the assumption that price will resume the prevailing trend after a partial gap fill. Take profit and stop loss va

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of UnfairValueGap B003
13 stars

This strategy provides a moving average crossover system combined with Zignaly crypto platform alert integration and built-in risk management. It enters long positions when a 14-period simple moving average crosses above a 28-period SMA, and enters short posit

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Zignaly Risk M. A079
1 stars

An overlay indicator that plots a Hull moving average, fast and slow EMAs and a Supertrend, then prints buy or sell labels when all agree. A buy needs price above the Hull average, the fast EMA above the slow one, a bullish Supertrend, RSI above its level and

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Ultimate Buy/Sell Signal Pro
106 stars

This strategy calculates weighted composite scores by evaluating conditions from multiple technical indicators, including EMAs, Supertrend, Parabolic SAR, HMA, RSI, MACD, WaveTrend, Stochastic, Bollinger Bands, and ATR. It plots signals directly on the price c

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Accurate BUY & SELL 5 mins TF by RR
106 stars

This overlay strategy plots Bollinger Bands from a simple moving average and standard deviation, plus a separate moving-average line and a background color when that average sits outside the bands. It opens a long when the source crosses above the lower band a

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced Bollinger Bands Strategy
106 stars

This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average. It enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is b

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced OutSide Forex strategy

This indicator calculates a Normalized Least Mean Squares (LMS) adaptive FIR filter based on the Widrow-Hoff learning algorithm. It predicts the current bar price using weighted past values and dynamically adjusts its coefficients based on the prediction error

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Least Mean Squares Adaptive Filter (LMS)
13 stars

This strategy runs on the main price chart and generates trade signals using moving average crossovers. It opens long positions when the fast simple moving average crosses above the slow simple moving average, and enters short positions on a bearish cross. Exi

Strategy v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Ruckard QuickFingers Luc A002

Moving Averages 3D

by regalouisei
2 stars

This indicator calculates ten sequential moving averages using either simple or exponential moving averages and renders them as a pseudo-three-dimensional grid in a separate pane. It projects recent price trends through an array of dynamically colored line dra

Indicator v5 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Moving Averages 3D
1 stars

This strategy plots the Kaufman Adaptive Moving Average on the price chart as an overlay. It generates buy signals on ta.crossover of close above the KAMA and sell signals on ta.crossunder of close below the KAMA. Long entries occur when flat or short, short e

Strategy v6 Moving averagesTrend Repaints
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Kanuck-Probe-01-Kama-State

ADX + BB %B + AO + EMA

by hasnocool
106 stars

This strategy plots multiple exponential moving averages and a linear regression squeeze channel directly on the price chart. It executes 100-unit long and short trades by combining four EMA trend alignments, Bollinger Bands %B extremes, Awesome Oscillator mom

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX + BB %B + AO + EMA
1 stars

This strategy is a validation probe that forces a 500-bar history buffer. It calculates a long simple moving average of close, an RSI of close shifted by a configurable offset, and a lagged close. Those first two series are plotted but do not gate trades. It e

Strategy v6 Moving averagesOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kanuck-probe-03-max-bars-back-500
13 stars

This strategy demonstrates how to integrate TradingView signals with the Zignaly Crypto Trading Platform. It calculates a crossover between a 14-period and a 28-period simple moving average to generate trade signals directly on the price chart. Entries trigger

Strategy v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Zignaly Tutorial A061
1 stars

This validation strategy tests the simultaneous runtime handling of Kaufman's Adaptive Moving Average (KAMA), intra-bar tick counting, and deep historical buffer retention. It enters trades when the closing price crosses above KAMA, gated by an intra-bar tick

Strategy v6 Moving averagesTrend Repaints
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Kanuck-Probe-Integration

ADX Strategy

by hasnocool
106 stars

An ADX-based trend-following strategy that enters long positions when the positive directional indicator (DI+) crosses above the Average Directional Index (ADX) while ADX remains below a preset threshold and a fast EMA is above a slow EMA. It allows adding to

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX Strategy
1 stars

This strategy draws an exponential moving average of close and an ATR envelope around it on the price chart. It enters one long contract when close crosses above the upper band and one short contract when close crosses below the lower band, reversing only from

Strategy v6 BreakoutMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kkb-probe-02-breakout-trigger
3 stars

This indicator overlays candles from multiple higher timeframes on the main price chart. It fetches OHLC data from timeframes 5, 15, 30, 60, and daily, displaying them clustered with customizable colors for bullish and bearish bodies, borders, and wicks. Selec

Indicator v5 Candlestick patternsMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of MTF Candles + MAs
1 stars

This validation strategy calculates fast and slow simple moving averages of the closing price. It submits a fixed-size long entry when the fast SMA crosses above the slow SMA, and enters short when the fast SMA crosses below the slow SMA, reversing any open po

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kkb-probe-03-margin-100-pct
106 stars

This strategy captures strong bullish momentum by combining a 200-period SMA baseline, a custom Bollinger Band, the True Strength Index (TSI) smoothed with WMAs, and the ADX trend strength indicator. It initiates long positions when price is above the 200 SMA,

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX_TSI_Bol Band Trend Chaser

PF probe kkb-probe-integration

by pineforge-4pass
1 stars

This strategy combines a one-dimensional Kalman filter with an EMA midline and ATR breakout bands. It enters long when the Kalman estimate rises and close crosses above the upper band, and short when the estimate falls and close crosses below the lower band. A

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kkb-probe-integration
106 stars

This strategy calculates and plots aggregated Bitcoin volume collected across multiple exchanges, along with two volume moving averages in a separate pane. It enters long positions when price crosses above a fast EMA while remaining above a slow EMA, and enter

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Aggregate BTC Volume + EMA Strat

Price vs MA

by be-thomas
65 stars

This indicator builds a table of simple moving averages and places it on the price chart. It calculates a user-chosen number of SMAs whose periods start at a base length and increase by a fixed step. On the last bar it lists each period and its SMA value, colo

Indicator v4 Moving averagesScreeners & dashboards
Updated 5 days ago · GPL-3.0 GitHub repository of Price vs MA

This overlay strategy scores alignment of seven moving averages, lengths 5 through 200, of a user-selected type. Full stacks count as up or down, and partial alignment can add a smaller score. A rolling high-low period flags the current extreme, while an optio

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AlignedMA and Cumulative HighLow Strategy
99 stars

The sigmoid indicator applies the logistic function to a source series, transforming any real-valued input into the range between 0 and 1. It calculates the output using the formula S(x) = 1 / (1 + exp(-k * (x - x0))), where k is the steepness factor and x0 is

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Logistic Function (SIGMOID)

This overlay strategy scores whether price and moving averages from 5 through 200 periods are fully or partially aligned, and it marks when the bar is a period high or low. Direction helpers compare a series with earlier bars over two configurable lookbacks. I

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AlignedMA and Cumulative HighLow Strategy V2

MTF EFI

by g-moe
3 stars

This indicator calculates Elder's Force Index (EFI) across multiple configurable timeframes and displays resulting signals directly on the price chart. Users can select the smoothing length, choose the moving average type (EMA, SMA, VWMA, RMA, or HMA), and tog

Indicator v5 VolumeOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of MTF EFI
2 stars

Oscillator Workbench — Chart plots a configurable blend of two built-in oscillators and an optional external oscillator on the price chart. It draws a weighted oscillator line and a reference moving average, coloring both by successive up or down states. Users

Indicator v5 Oscillators & momentumMoving averages
Updated 8 months ago · None stated GitHub repository of Oscillator Workbench — Chart [LucF]
106 stars

This strategy scans the price chart for a large set of classic candlestick patterns and lets the user enable or disable each pattern. It classifies setups as bullish, bearish, or both, and can require price to be above or below an SMA 50, or aligned with both

Strategy v4 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of All Candlestick Patterns Strategy

All in One Strategy

by hasnocool
106 stars

This strategy overlays multiple switchable trading models onto the main price chart, allowing the user to select between standard RSI crossing, Connors RSI, MACD, EMA, or Stochastic signals. Entries execute in long, short, or bidirectional modes when the selec

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of All in One Strategy

MA Envelope (MAE)

by mihakralj
99 stars

The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p

Indicator v6 Moving averagesSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MA Envelope (MAE)
1 stars

TnSovereignSignalForgeV20 is a price-chart strategy that combines seven directional votes from RSI, EMA, MACD, volume, VWAP, Bollinger Bands, and a volume oscillator. A long condition requires the vote total to meet a minimum agreement setting. A thermodynamic

Strategy v6 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of TnSovereignSignalForgeV20
106 stars

This multi-indicator strategy provides selectable trading engines based on crossing RSI, Connors RSI, MACD, EMA crossovers, or Stochastic oscillators. It enters long, short, or bidirectional positions within a specified date window when the selected indicator

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of All in One Strategy no RSI Label
1 stars

This strategy plots on the price chart and combines seven scored models into a weighted composite. It scores RSI extremes, volume spikes against a 20-bar average, price versus VWAP, EMA 9 and 21 alignment, MACD direction, Bollinger band location, and an estima

Strategy v6 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of TnSovereignSignalForgeV6

Mean %Error (MPE)

by mihakralj
99 stars

Mean %Error measures the average percentage difference between an input price series and a predicted target, set by default to its Exponential Moving Average. It calculates individual bar percentage errors and computes a sliding average over a customizable loo

Indicator v6 Moving averagesVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mean %Error (MPE)

RMA in for loop

by be-thomas
65 stars

This indicator sums two running moving averages of the close and plots that total in a separate pane. A for loop from 1 to 2 adds rma of close for each length into a running sum, then plots the result. There are no user inputs, so the lengths stay fixed at 1 a

Indicator v4 Moving averages
Updated 5 days ago · GPL-3.0 GitHub repository of RMA in for loop
106 stars

Calculates the correlation coefficient and covariance between the current crypto asset and a reference market index, such as CRYPTOCAP:TOTAL2, using higher-timeframe data. It tracks percentage price changes in rolling arrays to compute correlation alongside a

Strategy v4 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Altcoin Correlation Meter
99 stars

Calculates the Mean Absolute Percentage Deviation (MAPD) between a chosen price source and its exponential moving average over a specified period. It measures relative dispersion by averaging percentage differences using an internal circular buffer algorithm.

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mean Absolute %Deviation (MAPD)
3 stars

This indicator plots four simple moving averages of periods 5, 10, 20, and 50 on the price chart. It calculates and sends alert conditions for every pairwise crossover and crossunder between the moving averages, including MA5 cross above MA10, MA10 cross above

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Multi MA Crossover Alerts
1 stars

This strategy enters trades based on EMA crossovers and manages exits with tight tick-based bracket orders on the price chart. It calculates fast and slow Exponential Moving Averages, triggering long entries on bullish crossovers and short entries on bearish c

Strategy v6 Moving averagesScalping
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Scalping Tight TP SL Points

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