Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 58)

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

My Script

by be-thomas
65 stars

This indicator calculates and plots a 5-period simple moving average and a 50-period simple moving average based on the closing price directly on the main price chart. It detects crossover points between the fast and slow moving averages, marking each occurren

Indicator v4 Moving averagesTrend
Updated 5 days ago · GPL-3.0 GitHub repository of My Script
3 stars

This strategy combines MACD and Supertrend to generate entries on the price chart. The MACD oscillator uses selected source, fast length 12, slow 26, signal 9 and EMA or SMA. Supertrend on higher timeframe 15 provides trend direction and ATR trailing stop. Sig

Indicator v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of MACD VWMA Strategy
106 stars

This trading strategy combines three Exponential Moving Averages (8, 14, and 50 periods by default) with Stochastic RSI and Average True Range (ATR). It enters a long position when EMA 1 is above EMA 2, EMA 2 is above EMA 3, and the Stochastic RSI %K line cros

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 3 x EMA + Stochastic RSI + ATR

Huber Loss (HUBER)

by mihakralj
99 stars

This indicator calculates Huber loss between a selected source and an exponential moving average of that source. Inside the delta threshold it uses half the squared error; beyond delta it uses a linear absolute-error form. It averages those values over the cho

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Huber Loss (HUBER)

Market Rhythm Adaptive Trading Algo V1 is an overlay indicator that combines Kaufman Adaptive Moving Averages (KAMA), an ADX regime filter, Choppiness Index, Rate of Change, and RSI to identify market rhythm and trend entries. Depending on whether the ADX valu

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Market Rhythm Adaptive Trading Algo V1

Moving Box

by morindok
1 stars

This indicator projects dynamic geometric shapes and envelopes directly onto the price chart based on moving averages and extreme price lookbacks. Users can select shapes such as boxes, rhombuses, ellipses, spirals, or hypercubes. The script calculates base, m

Indicator v5 Moving averagesSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Moving Box
1 stars

The script calculates the yield spread between long-term and short-term US Treasury yields (T10Y2Y or manual US10Y minus US02Y) and plots the spread line on a separate pane. It signals long entries on steepening beyond a user threshold in reversion mode or SMA

Strategy v6 Mean reversionSupport & resistance
Updated 2 months ago · None stated GitHub repository of TN Yield Spread Sovereign v6
106 stars

This long-only trend-following strategy identifies breakout trades by requiring price to breach a 250-bar high while aligned with 50-period, 150-period, and 200-period Simple Moving Averages. It calculates relative strength against a comparative market benchma

Strategy v4 TrendBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of 365 Day High Breakout Strategy

My Script

by be-thomas
65 stars

This Pine Script indicator computes a simple moving average (SMA) of length 10 based on the close prices of the trading instrument. The script uses the study function to define the indicator and plots the SMA line in a separate pane. No signals are generated a

Indicator v4 Moving averages
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Triple EMA

by TWODS-CAPITAL
37 stars

This indicator plots a triple exponential moving average of the closing price on the price chart. It smooths close with an exponential moving average of a chosen length, then applies the same average twice more, and combines the three results as three times th

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Triple EMA

Moving Box

by morindok
1 stars

This indicator draws customizable boxes, rhombuses, or ellipses on the price chart centered on a selected moving average. It computes the box height from the MA's high-low range over a lookback period and applies optional golden ratio midpoints or symmetry. Sh

Indicator v5 Moving averagesSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Moving Box
106 stars

This strategy backtests a long Bollinger Band deal on the price chart for 3Commas-style bots. It plots short and long simple moving averages, offset bands, and the average entry price of the open deal. A long starts when price crosses the lower band inside a c

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 3Commas Bollinger Strategy

TRIX

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the classic Triple Exponential Average (TRIX) momentum oscillator in a separate pane. It applies a triple exponential moving average to the natural logarithm of closing prices and computes the 1-bar rate of change multiplied

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of TRIX

Welles Wilders MAs - MTF

by eddiebelaval
7 stars

Calculates four Welles Wilder Moving Averages (RMA) using a user-specified timeframe and plots them directly on the price chart. The script tracks short, medium, extension, and long trend lines (default periods 34, 72, 89, and 144). Users can configure timefra

Indicator v5 Moving averagesTrend
Updated 3 months ago · None stated GitHub repository of Welles Wilders MAs - MTF

Kernel Regression Toolkit

by regalouisei
2 stars

The Kernel Regression Toolkit calculates and plots non-linear regression estimations directly on the price chart. It provides multiple configurable kernel regression lines using functions such as Rational Quadratic, Gaussian, Periodic, and Locally Periodic ker

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Kernel Regression Toolkit

Moving Box{Morindok}

by morindok
1 stars

This indicator plots geometric structures and moving averages directly on the price chart. It calculates a simple moving average alongside periodic high and low extremes to construct shapes such as boxes, rhombuses, ellipses, or spirals using polylines. Users

Indicator v5 Moving averagesSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Moving Box{Morindok}
1 stars

A price-chart indicator that plots a zero-lag EMA with an ATR band around it. The trend flips long when price closes above the upper band and short when it closes below the lower band, marked with buy and sell labels and a shaded channel. Optional features inc

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Adaptive Zero-Lag Reversal Engine
1 stars

A Pine Script v4 indicator on the price chart that draws a moving average wave, a channel of exponential averages on the high, close and low with a default length of 38, centred on a chosen source. It can also colour candles by whether they close above, below

Indicator v4 Moving averagesTrend
Updated 6 months ago · None stated GitHub repository of ZLEMA Wave and GRaB Candles Alt2
106 stars

3x Supertrend and Stoch RSI is an overlay strategy combining three Supertrend indicators with Stochastic RSI momentum and a 200-period Exponential Moving Average. It uses the 200 EMA to establish the primary trend direction, requiring agreement across fast, me

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 3x Supertrend and Stoch RSI
106 stars

The 3x SuperTrend Strategy combines three SuperTrend indicators, a 200-period Exponential Moving Average trend filter, and a Stochastic RSI oscillator to generate entry signals. Long trades require price to be above the 200 EMA with Stochastic RSI crossing up

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3x SuperTrend Strategy (Mel0nTek)

Calculates and plots a multi-band envelope on the price chart based on mean reversion principles and Keltner Channel concepts. Instead of standard moving averages, it uses advanced filters such as Ehlers SuperSmoother, Butterworth, Gaussian, or traditional ave

Indicator v5 Mean reversionVolatility & bands
Updated 5 months ago · None stated GitHub repository of Mean Reversion Channel - MRI Variant

4 MA Strat

by hasnocool
106 stars

Calculates four selectable moving averages (SMA, EMA, WMA, RMA, HMA, or ALMA) with custom periods to generate crossover trading signals directly on the price chart. Signals are triggered when a selected moving average crosses another, with an optional fourth m

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 4 MA Strat

This strategy calculates a 10-period and a 20-period simple moving average directly on the price chart. It triggers long entries on SMA bullish crossovers and short entries on SMA bearish crossunders, formatting alert payloads into JSON string templates for we

Strategy v5 Moving averagesTrend Repaints
Updated 5 months ago · None stated GitHub repository of Messing with Alerts & Calc Every Tick

The LOWESS indicator applies locally weighted scatterplot smoothing to price data to reduce noise and highlight trends. It calculates a smoothed line based on user-defined length. Additionally, it identifies pivot highs and lows using specified bar counts and

Indicator v5 Moving averages
Updated 8 months ago · None stated GitHub repository of LOWESS (Locally Weighted Scatterplot Smoothing)

4x EMA + Volume

by hasnocool
106 stars

This strategy plots four exponential moving averages on the price chart and filters trades with a smoothed Ease of Movement oscillator. In the default mode it opens a long when price and the four averages are stacked upward and Ease of Movement is positive, th

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 4x EMA + Volume

5-10-20 Cross

by hasnocool
106 stars

This strategy combines three exponential moving averages with a Supertrend indicator to generate trend-following trade entries directly on the price chart. A long position is entered when the fastest EMA is above the medium EMA, the medium EMA is above the slo

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5-10-20 Cross
99 stars

This overlay indicator plots Jurik Adaptive Envelope Bands around price. It calculates a Jurik moving average as the middle line and builds upper and lower bands from that filter’s adaptive envelope. A ten-bar window tracks local deviation from the bands, and

Indicator v6 Moving averagesVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Jurik Adaptive Envelope Bands

A test strategy from a reference corpus that re-issues a pending stop entry every bar. When the 8-period EMA is above the 21-period EMA it places a buy stop at the previous bar high and cancels the sell stop, and otherwise it places a sell stop at the previous

Strategy v6 Moving averagesBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 94 Stop Entry Cancel No Regime Close
1 stars

This strategy draws on the price chart and filters directional signals with four optional checks. It compares a fast exponential moving average with a slower one, requires volume above its average when the volume audit is on, and aligns close with a higher-tim

Strategy v6 Moving averagesVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Fakeout Confirmed

This strategy calculates an Adaptive Hull Moving Average (HMA+) that dynamically adjusts its period based on market volatility measured by fast and slow ATR indicators. It uses slope angle calculations to categorize market conditions into trending, consolidati

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 72s Strategy: Adaptive Hull Moving Average+ pt.1

The Parallel Price Universe Oscillator calculates detrended price movements relative to two derived moving averages weighted by fast and slow Fibonacci ratios. It extracts smoothed angular slopes using arctangent functions, aggregates them into a unified momen

Indicator v5 Oscillators & momentumMoving averages
Updated 7 weeks ago · None stated GitHub repository of Parallel Price Universe Oscillator
1 stars

TnSovereign Fakeout Filter V6 is a trend-following strategy designed to reduce false breakouts by evaluating entries against a four-layer scoring system. It checks fast and slow EMA crossovers alongside volume surges, higher-timeframe trend alignment, and ATR

Strategy v6 TrendMoving averages Repaints
Updated 2 months ago · None stated GitHub repository of TnSovereign Fakeout Filter V6

8 Day Run

by hasnocool
106 stars

Inspired by Linda Raschke's strategy for T-note futures, this script identifies extended trends where price remains on one side of a 5-period SMA for more than eight consecutive bars. It enters long on the first pullback below the SMA following an eight-bar bu

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8 Day Run

DMX plots the Jurik Directional Movement Index in a separate pane. The indicator computes a smoothed version of the directional movement index using Jurik smoothing applied to the ADX components derived from true range, up and down directional moves. It applie

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Jurik Directional Movement Index (DMX)

My Strategy

by be-thomas
65 stars

This strategy plots on the price chart and compares a 14-period simple moving average of close with a 28-period simple moving average. It opens a long when the faster average crosses above the slower average and opens a short when the faster average crosses be

Strategy v4 TrendMoving averages
Updated 5 days ago · GPL-3.0 GitHub repository of My Strategy
1 stars

Parallel Universe Price Forecast is an indicator that detrends price using moving averages to extract slopes and angles from two universes weighted by fast and slow factors. It normalizes the combined angle into a symmetrical oscillator and projects the price

Indicator v5 Moving averagesVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of Parallel Universe Price Forecast

8 Whittle Down

by hasnocool
106 stars

This strategy executes short positions during the end-of-day session (14:29–15:00) when the price is below the 200-day simple moving average. If price moves higher against the initial short trade, it scales into the position by submitting a second short order

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8 Whittle Down
99 stars

The Kairi Relative Index (KRI) indicator computes the percentage deviation of a source price from its simple moving average. It plots the resulting KRI value as a yellow line in a separate pane along with a dotted gray zero line. Users can select any source se

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Kairi Relative Index (KRI)
6 stars

SMC Scalping State Engine v2.2.1 is a Pine Script v5 strategy that plots Smart Money Concepts elements on the XAUUSD price chart. It uses a state transition system to detect market structure breaks, order blocks, fair value gaps, key levels and EMA alignments

Strategy v5 SMC / ICT / price actionTrend
Updated 7 months ago · None stated GitHub repository of SMC Scalping State Engine v2.2.1

MicroQuant Trend

by g-moe
3 stars

MicroQuant Trend is a Supertrend-based indicator that calculates dynamic bands using EMA of high and low prices adjusted by ATR. It plots green circles for uptrend direction and red for downtrend. Background colors change to green or red when the trend flips.

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of MicroQuant Trend

888 BOT Backtest

by hasnocool
106 stars

888 BOT Backtest is a multi-indicator trading strategy that evaluates market conditions by combining a Jurik Moving Average, Range Filter, Average Directional Index (ADX), Parabolic SAR, volume-weighted RSI, MACD, and volume thresholds. Each individual filter

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 888 BOT Backtest
37 stars

This indicator plots a volume-weighted moving average of a chosen price source on the price chart. It uses TradingView's built-in volume-weighted moving average, so bars with higher volume pull the average more than quieter bars. Length sets the lookback, Sour

Indicator v5 Moving averagesVolume
Updated 3 years ago · MIT GitHub repository of Volume Weighted Moving Average
3 stars

MicroQuant Trend Strat is a trend-following strategy overlaid on the price chart that utilizes a modified Supertrend calculation built with EMA bands and Average True Range volatility bounds. It opens long positions when the trend direction turns bullish and s

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of MicroQuant Trend Strat
1 stars

This strategy identifies trend changes using a dual moving average crossover. It computes fast and slow simple moving averages of the close price and generates long entry signals on fast SMA crossover above slow and short signals on crossover below. Upon entry

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 97a - tp/sl bracket isolate

PPUO Forecast Signals

by morindok
1 stars

The PPUO Forecast Signals indicator derives a Parallel Universe Oscillator from detrended price series using slow and fast moving averages of varying lengths. It extracts smoothed angles from the detrended values, weights and aggregates them into a universe me

Indicator v5 TrendOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of PPUO Forecast Signals
1 stars

This strategy identifies long and short positions using a dual moving average crossover on the price chart. The fast and slow simple moving averages generate crossover signals that trigger market entries. The script caps the number of intraday filled orders to

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 97b - intraday cap isolate

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