Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 14)

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

BTC ATH Golden Cycle

by ymlee1104
1 stars

BTC ATH Golden Cycle is a long-only position trading strategy designed for Bitcoin. It tracks price drawdowns relative to All-Time High (ATH) levels to execute a five-stage dollar-cost averaging entry schedule. As prices decline by configurable percentage tier

Strategy v6 Support & resistanceMoving averages
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle
1 stars

This indicator serves as a validation test suite for the McClellan Oscillator. It fetches NYSE advancing and declining issues data and computes the oscillator using ratio-adjusted net advances. The script cross-checks manual EMA calculations against ta.ema for

Indicator v6 Screeners & dashboardsOscillators & momentum
Updated 7 months ago · None stated GitHub repository of McClellan Oscillator Tests
1 stars

Buy/Sell Signals - Multi-Condition combines the Relative Strength Index (RSI) with fast and slow Exponential Moving Averages (EMA) to identify trend pullback opportunities. It displays buy signals when the RSI drops below an oversold threshold during an establ

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Buy/Sell Signals - Multi-Condition

Lifecycle Example

by propuchon
1 stars

This strategy demonstrates a training, testing, and deployment lifecycle for Pine Script strategies. It calculates a simple moving average (SMA 20) and generates buy signals on crossover. The runMode input selects between Training, Testing, and Deployment. In

Strategy v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Lifecycle Example

EMA Fibonacci Trend

by ktg0413
1 stars

The EMA Fibonacci Trend indicator calculates and plots dynamic Fibonacci retracement and extension levels based on a 200-period Exponential Moving Average (EMA). It measures volatility using a 14-period Average True Range (ATR) relative to price, establishing

Indicator v6 Support & resistanceMoving averages
Updated 1 year ago · None stated GitHub repository of EMA Fibonacci Trend
1 stars

This strategy identifies trend re-entries by combining volatility spikes, short-term pullbacks, and moving average crossovers. It detects strong bar expansions using an ATR multiplier, checks a lookback window for pullbacks, and triggers entries when price cro

Strategy v5 TrendVolatility & bands
Updated 1 year ago · MIT GitHub repository of ATR Retracement EMA Strategy

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. Signal badges mar

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

A price-chart overlay that combines several tools. It draws a Nadaraya-Watson kernel envelope with a repainting smoothing option, a Hull moving average band in three variants that can optionally come from a higher timeframe, and an ATR trailing stop in the sty

Indicator v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of UT Bot, Nadaraya-Watson, Hull Suite and Reversal Combo

Bollinger Bands

by yagyesh-bobde
1 stars

The Bollinger Bands indicator plots a basis moving average line together with two volatility bands on the main price chart. The middle band shows the average price level while the upper and lower bands reflect price deviation from volatility. Traders use the b

Indicator v6 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands
1 stars

This strategy uses Bill Williams indicators including the Alligator (jaw, teeth, lips with RMA smoothing and offsets), Awesome Oscillator, and Accelerator Oscillator. It also plots fractals on the chart. Long entries occur when the Alligator is aligned bullish

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Bill Williams NTD Strategy

Bollinger Bands

by Studentcodee
1 stars

This strategy plots Bollinger Bands directly on the price chart. It computes the middle band as the simple moving average of the close price over the input length and the upper and lower bands by multiplying the standard deviation by the multiplier and adding

Strategy v6 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands

EA_2

by equitymarkets
1 stars

EA_2 is a basic strategy template that generates trade entries based on price crossovers with a Simple Moving Average. It monitors a fast moving average relative to a selected price source, entering a long position when the price crosses above the moving avera

Strategy v6 Moving averagesTrend
Updated 1 year ago · MIT GitHub repository of EA_2

MTF Moving Average

by itsmeterada
1 stars

Plots a simple or exponential moving average calculated on a user-selected timeframe over the current chart. Inputs set the timeframe, average type, length, source, line colour, thickness and transparency. An optional label on the last bar shows the timeframe,

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of MTF Moving Average
1 stars

This strategy executes long trades based on price interaction with a daily simple moving average. It calculates a higher-timeframe daily SMA and its derivative using a three-point backward difference formula. Long entries trigger when the close sits within a s

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Price Crossover Strategy

TrendTwisterV1.5

by Axden27
1 stars

TrendTwisterV1.5 is a Pine Script strategy that uses a 12-period Hull Moving Average and a 5-period EMA shifted forward by 2 bars to identify trend changes. It plots the Hull MA in orange and the shifted EMA in blue on the price chart with buy and sell signal

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TrendTwisterV1.5

TB: Main Indicators

by farias-hecdin
1 stars

This indicator collects overlay tools for the price chart in one script. It draws two configurable vertical time separators, tints the background by day of week, and plots two EMAs of 100 and 50 periods. It also marks support and resistance from pivot highs an

Indicator v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of TB: Main Indicators

Bollinger Bands

by zhuzp98
1 stars

This indicator plots Bollinger Bands volatility bands calculated from the input source price. The middle band uses an EMA of the source over the specified length, with bands formed by adding and subtracting the standard deviation multiplied by the mult. It als

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

Jinni v1

by Hurairahengg
1 stars

Jinni v1 is a Pine Script indicator that plots buy and sell signals on the price chart. It calculates two EMAs, one on close with length 34 and another on input source with length 65, to detect uptrend and downtrend. Additional checks include candle direction,

Indicator v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Jinni v1

Ari zScore

by alessioricco
1 stars

Ari zScore calculates a z-score as the difference between a fast and a slow simple moving average of close, divided by the standard deviation of close. It plots numbered triangles above and below price bars when that value enters fixed magnitude bands, optiona

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · Apache-2.0 GitHub repository of Ari zScore

Surfr 5-Minute Variant

by RobACurtis
1 stars

A strategy that trades when price closes across a 50-period moving average after the previous close was on the other side, with a Stochastic RSI direction check and a cap on the stop distance in points. A confirmation timeframe, 5 minutes by default, supplies

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Surfr 5-Minute Variant

This strategy enters long when a 13-period EMA crosses above a 34-period EMA and short when it crosses below, and closes on the opposite cross. While in a trade, it places a stop loss and a take profit at fixed percentages of the average entry price, set separ

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of EMA Crossover With Percentage Stop and Target
1 stars

This indicator draws several kernel regression lines on the price chart, using a kernel function library. Each of five lines has its own filter mode (No Filter, Smooth or Zero Lag), kernel type (Rational Quadratic, Gaussian, Periodic or Locally Periodic), look

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Kernel Regression Toolkit

200 EMA

by mayurpatil77
1 stars

This indicator plots a 200-period exponential moving average on the price chart. It colors the line green when the current EMA is above its value on the previous bar and red when it is not, so the color tracks whether the average is rising or falling. There ar

Indicator v4 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of 200 EMA

Mavezo

by arrabyte
1 stars

Strategy built on exponential moving averages and an optional volume zone oscillator filter. It plots fast, slow and 200-period trend EMAs on the price chart. Risk settings include an ATR based stop distance, a risk-to-reward ratio for the take profit, optiona

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Mavezo

HWAP

by nvFede
1 stars

A Pine v4 indicator in a separate pane that measures how far the close sits from a 50-bar Hull moving average, scaled by the rolling standard deviation of that distance, which makes it a z-score style oscillator. Dotted lines mark plus and minus one, and zones

Indicator v4 Mean reversionMoving averages
Updated 3 years ago · None stated GitHub repository of HWAP

EMA 50 100 150 200

by juliencrn
1 stars

This overlay indicator plots exponential moving averages of the close at 12, 26, 50, 100, 150 and 200 periods in different colors on the price chart. The 12 and 26 lines are the fast and slow averages used in MACD and are labeled that way in the plot names. Th

Indicator v5 TrendMoving averages Archived
Updated 4 years ago · None stated GitHub repository of EMA 50 100 150 200

Tobacco

by 0xfffangel
1 stars

An overlay that builds a Kaufman adaptive moving average of price as a center line and surrounds it with three bands above and below, scaled from an adaptive average of true range. The band length and the three deviation multipliers are adjustable, and the zon

Indicator v5 Volatility & bandsMean reversion
Updated 4 years ago · None stated GitHub repository of Tobacco

MJ Bull Support 1

by mehdijangjou
1 stars

This indicator plots the 20-period EMA in green and the 20-period SMA in red directly on the price chart. It fills the space between the two moving averages using a color that changes based on which line sits above the other. The script targets crypto assets a

Indicator v5 Moving averagesTrend Archived
Updated 4 years ago · MPL-2.0 GitHub repository of MJ Bull Support 1

Slimdicator

by tseitz
1 stars

Slimdicator is a TradingView indicator for cryptocurrency markets that plots multiple moving averages on the price chart including a fast EMA, a medium SMA, and a slow SMA. It calculates MACD and RSI values to generate buy and sell signals. The indicator alert

Indicator v5 Oscillators & momentumMoving averages
Updated 4 years ago · None stated GitHub repository of Slimdicator

MA+ADX+DI+time Strategy

by fifiteen82726
1 stars

A long-only strategy that enters when a fast simple moving average crosses above a slow one, the positive DI is above the negative DI and ADX is above a key level. It closes the position on the opposite cross with DI and ADX confirming. Trading is limited to a

Strategy v4 TrendMoving averages
Updated 5 years ago · None stated GitHub repository of MA+ADX+DI+time Strategy

EMA Crossover

by rocketbrainsurgeon
1 stars

This indicator plots a fast and a slow exponential moving average of the bar midpoint on the price chart. The slow length is the fast length multiplied by a selectable ratio from three to ten, which keeps the two lines well apart. A triangle marks each upward

Indicator v4 Moving averagesTrend
Updated 5 years ago · GPL-3.0 GitHub repository of EMA Crossover
947 stars

The Fibonacci Weighted Moving Average calculates a trend-following line on the price chart using Fibonacci sequence numbers as weights. Newer data points receive larger Fibonacci weights to increase responsiveness compared to standard simple moving averages. I

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

This indicator plots fast and slow moving averages using either EMA or SMA directly on the main chart to identify trend direction and crossovers. It calculates an ATR-based trailing stop line derived from the highest high minus a multiplied ATR value over a co

Indicator v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TVT MA Crossover with Stop Loss
257 stars

This overlay strategy targets one-minute ES futures and plots volume-weighted moving-average bands from the open, scaled by a standard-deviation multiple, plus a slower band from ten-minute opens. A higher-timeframe exponential moving average can filter trades

Strategy v6 Moving averagesVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint

Deduct 扣抵

by TaichiS
219 stars

Deduct 扣抵 is an educational overlay indicator that visualizes the moving average deduction point on price charts. It places a text label below the candle located a user-specified number of bars back from the current bar, defaulting to 20 periods. As each new b

Indicator v4 Moving averages
Updated 5 years ago · None stated GitHub repository of Deduct 扣抵

JMA Clone

by capissimo
114 stars

This indicator implements an approximation of the Jurik Moving Average algorithm, featuring an adjustable power parameter. It overlays a smoothed curve and a one-bar lagged reference curve directly on the price chart. When the slope turns upward, a green circl

Indicator v5 Moving averagesTrend Repaints
Updated 1 year ago · None stated GitHub repository of JMA Clone
99 stars

This indicator plots Price Headley's Acceleration Bands on the price chart. It builds a middle line as a simple moving average of close, plus upper and lower bands from simple moving averages of highs and lows widened by a factor times the bar's high-low range

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Acceleration Bands (ACCBANDS)
53 stars

This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of Candle Counter + MA + RSI + Mode

EMA

by milocaetano
48 stars

This script calculates and plots an Exponential Moving Average (EMA) directly on the price chart. It uses Pine Script's built-in moving average calculation over a customizable period length and input price source, defaulting to a 9-period close price. The resu

Indicator v5 Moving averagesTrend
Updated 3 days ago · MIT GitHub repository of EMA
47 stars

This indicator calculates and plots Acceleration Bands directly on the main price chart. It computes simple moving averages of high, low, and close prices using circular buffers. The middle line displays the close moving average, while upper and lower envelope

Indicator v6 Volatility & bandsMoving averages
Updated 8 months ago · MIT GitHub repository of Acceleration Bands (ACCBANDS)

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