Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 20)

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

ATR Trailing Stop

by pineforge-4pass
1 stars

This Pine Script strategy generates entry signals from an EMA of length 20 crossed by close price. Long crossover enters long position and sets initial trailing stop below close using ATR multiplied by 2.0. Short crossover enters short and sets trailing stop a

Strategy v6 TrendVolatility & bands
Updated 7 days ago · Apache-2.0 GitHub repository of ATR Trailing Stop

EMA-Volume

by engtuncay
1 stars

EMA-Volume plots two exponential moving averages on the price chart and tints the background when the faster average crosses above or below the slower one. It also builds simple moving averages of raw and scaled dollar volume, then compares a 30-bar volume ave

Indicator v6 Moving averagesVolume
Updated 7 days ago · None stated GitHub repository of EMA-Volume

DEPV2 A2 TREND

by YuceSezar89
1 stars

The indicator computes the normalized deviation of close price from HLC3 SMA using ATR for trend measurement. It plots deviation Z-score, trend state (1 bullish, -1 bearish, 0 neutral via state machine), and strength level (0-2) in a separate pane. Settings ad

Indicator v6 TrendMoving averages
Updated 13 days ago · None stated GitHub repository of DEPV2 A2 TREND

MACD Signal Turn

by quantxaashish
1 stars

MACD Signal Turn calculates standard Moving Average Convergence Divergence (MACD) and signal lines using exponential moving averages. It identifies bullish crossovers that occur while the MACD line is below zero and bearish crossunders that take place while th

Indicator v5 Oscillators & momentumMoving averages
Updated 2 weeks ago · MIT GitHub repository of MACD Signal Turn

Kernal Cipher 3

by kdricha0602
1 stars

Kernal Cipher 3 is a momentum trading strategy that plots signal diamonds on the price chart for breakout, reversal and continuation setups. It calculates EMAs of varying lengths to detect trend regime and slope, ADX for strength confirmation, WaveTrend oscill

Strategy v6 TrendOscillators & momentum
Updated 5 weeks ago · MIT GitHub repository of Kernal Cipher 3

MTF Confluence Engine

by mrme000m
1 stars

MTF Confluence Engine is a separate-pane indicator that evaluates trend, momentum, and volatility metrics across the current chart timeframe and two configurable higher timeframes. It combines EMA alignment, SuperTrend direction, RSI values, Bollinger and Kelt

Indicator v5 TrendOscillators & momentum Repaints
Updated 7 weeks ago · None stated GitHub repository of MTF Confluence Engine

Moving Average (EMA)

by DEVfancybear
1 stars

This script calculates and plots an Exponential Moving Average (EMA) based on the closing price directly on the main price chart. It functions as a classic trend-following reference, smoothing price action to help identify direction or dynamic support and resi

Indicator v6 TrendMoving averages
Updated 7 weeks ago · MIT GitHub repository of Moving Average (EMA)
1 stars

This lightweight indicator template calculates a simple moving average based on a user-selected price source and lookback length. It plots the calculated moving average line, dynamically coloring it green when the price is above the moving average and red when

Indicator v6 Moving averagesTrend
Updated 8 weeks ago · MPL-2.0 GitHub repository of Lightweight Indicator Template

Directional EMA For Loop

by vedkanani123
1 stars

A separate-pane oscillator that smooths price with a selectable moving average, then scores its direction by looping over a range of lookbacks from a start to an end value. The score is compared with long and short thresholds to mark uptrend and downtrend stat

Indicator v6 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of Directional EMA For Loop
1 stars

This Pine Script v6 strategy generates multi-layered trading signals plotted directly on the price chart. It combines eight modular signal engines: EMA crossover pullbacks, price action breakouts, RSI momentum and divergence, MACD histogram flips, volume surge

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Advanced Swing Strategy v6

EMA Cross Strategy

by ashishgkwd
1 stars

EMA Cross Strategy is a Pine v4 strategy that plots a fast and a slow exponential moving average, 13 and 48 by default. It enters long when the fast EMA crosses above the slow one and short on the opposite cross, with a trade direction option for long only, sh

Strategy v4 Moving averagesTrend Repaints
Updated 4 months ago · None stated GitHub repository of EMA Cross Strategy

Index Futures Beat Buy and Hold

by PETERSAMUELOPS12
1 stars

A leveraged trend-following strategy for index futures that uses 20, 50 and 200 period EMAs to decide between long, flat and optional short positions. Leverage is higher in confirmed uptrends and steeper trends, lower for shorts, and reduced when ATR as a perc

Strategy v6 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Index Futures Beat Buy and Hold

EMA Crossover Strategy

by Sandesh30-cloud
1 stars

This strategy tracks trend changes by calculating a 50-period fast Exponential Moving Average and a 200-period slow Exponential Moving Average. It triggers a long entry when the fast EMA crosses above the slow EMA and closes the position when the fast EMA cros

Strategy v5 TrendMoving averages
Updated 6 months ago · None stated GitHub repository of EMA Crossover Strategy

ICT v4-weinkya Strategy

by tndg16-bot
1 stars

This strategy implements an Inner Circle Trader (ICT) framework by identifying order blocks, fair value gaps, liquidity pools, and optimal trade entry (OTE) zones. It computes a confluence score requiring a user-defined minimum threshold alongside 200 EMA and

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · None stated GitHub repository of ICT v4-weinkya Strategy

BTC ATH Golden Cycle

by ymlee1104
1 stars

This strategy plots a Bitcoin all-time-high cycle model on the price chart. It starts from a chosen date and can show an Ichimoku cloud, a fast and slow geometric mean, and supply and demand boxes. Drop percentage, rise percentage, and a weight set the cycle l

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

Ichimoku Cloud Strategy

by Basant1Saini
1 stars

This strategy plots Ichimoku Cloud components on the price chart and generates trades based on trend confirmation. It enters long when a bullish Tenkan-Kijun cross occurs above the cloud or upon a bullish cloud breakout, with optional Chikou Span confirmation.

Strategy v5 TrendBreakout
Updated 8 months ago · None stated GitHub repository of Ichimoku Cloud Strategy
1 stars

The Squeeze Momentum BB Enhanced indicator computes a momentum oscillator from close prices using linear regression or SMA. It identifies squeezes between Bollinger Bands and Keltner Channels to flag potential breakouts. Plots include colored momentum lines, f

Indicator v5 Oscillators & momentumMoving averages
Updated 9 months ago · None stated GitHub repository of Squeeze Momentum BB Enhanced

VMC Strat Hybrid Trend

by matlaenousse
1 stars

VMC Strat Hybrid Trend is a long-oriented trading strategy plotted directly on the price chart. It combines an exponential moving average trend filter with WaveTrend, RSI, Stochastic RSI, and a custom Money Flow Index calculation. Long entries trigger when Wav

Strategy v6 TrendOscillators & momentum
Updated 10 months ago · None stated GitHub repository of VMC Strat Hybrid Trend

Ultra Clean Signals

by KirstonKK
1 stars

A minimal chart-overlay indicator that plots a 20 and a 50 EMA and prints large buy or sell labels on an EMA cross. A buy also needs volume above 1.5 times its 20-bar average, RSI between 35 and 65 and price above the fast EMA; a sell needs the opposite price

Indicator v6 Moving averagesTrend
Updated 10 months ago · None stated GitHub repository of Ultra Clean Signals

EMA Pullback Strategy

by surajmateti
1 stars

This strategy plots a slow trend EMA and a faster entry EMA on the price chart. It opens a long position when price is above the trend EMA, closes below the entry EMA, and crosses back above that entry EMA. It exits with a percentage stop loss and take profit

Strategy v5 TrendMoving averages
Updated 11 months ago · None stated GitHub repository of EMA Pullback Strategy

This indicator plots Parabolic SAR circles and a configurable exponential moving average on the price chart. It treats the average of open, high, low, and close above the EMA as bullish and below it as bearish. A buy label appears when SAR is below the low, th

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Parabolic SAR + EMA 200 + MACD Signals

Keltner Channel

by Studentcodee
1 stars

The Keltner Channel strategy plots upper and lower bands on the price chart overlay using an exponential moving average or simple moving average combined with ATR or range calculations. The source crosses the bands to generate signals. It enters long positions

Strategy v6 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Keltner Channel
1 stars

A long-only strategy that enters when a fast simple moving average crosses a slow one, using the cross function so either direction of crossing can trigger the entry. Each open position gets a percentage take profit and a percentage stop loss calculated from t

Strategy v6 Moving averages
Updated 1 year ago · None stated GitHub repository of Profit and Stop Loss Strategy

SOLBTC MTPI

by Mikelkulla
1 stars

SOLBTC MTPI is a Pine Script strategy designed to gauge whether Solana is outperforming Bitcoin to determine market allocation. It calculates a composite trend signal using liquidity-weighted moving averages with Supertrend logic, DEMA filters, and normalized

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

MACD Indicator

by CodeThat
1 stars

This indicator calculates and plots a standard Moving Average Convergence Divergence oscillator in a separate chart pane. It computes the fast MACD line, the slow signal line, and the histogram based on user-configurable short, long, and signal period inputs.

Indicator v6 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of MACD Indicator

Volume Price Indicator

by fuyuanyuan
1 stars

This indicator plots colored volume bars on the price chart, where green shows price up days and red shows price down days. It also draws an EMA of volume in yellow. The script detects bullish and bearish divergences by comparing price highs/lows to volume hig

Indicator v6 VolumeMoving averages
Updated 1 year ago · None stated GitHub repository of Volume Price Indicator

Moon Phase and MA

by mrgunkin
1 stars

This indicator calculates the lunar age from the chart date and marks a new moon above the bar and a full moon below the bar. It also plots the close as a daily 200-period moving average and weekly 20- and 200-period moving averages, each as a simple or expone

Indicator v5 Moving averages Repaints
Updated 1 year ago · MIT GitHub repository of Moon Phase and MA

BTC Bot

by zhuzp98
1 stars

A long-only strategy for Bitcoin-style charts that combines an RSI-based momentum signal with a trend filter using one or two simple moving averages. It buys when the smoothed RSI signal crosses above zero while price is in an uptrend, sizes positions from a s

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of BTC Bot
1 stars

This indicator calculates multiple smoothed versions of a chosen dataset using Kalman filters with adjustable gain parameters. It plots the resulting lines on the price chart for visual comparison. The main settings allow selection of the input source and togg

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Kalman Gain Parameter Mechanics

CM_EMA Trend Bars

by Hurairahengg
1 stars

CM_EMA Trend Bars is a trend-following indicator that plots buy and sell signal shapes on the price chart based on exponential moving average position. It calculates a single exponential moving average (EMA) using a customizable period, defaulting to 34 bars.

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of CM_EMA Trend Bars

ARI-Overextension

by alessioricco
1 stars

This indicator measures how far the close sits from a Hull moving average and plots that gap as a percentage in a separate pane. It also calculates an exponential moving average over the same trend length. The plotted line is red above 20, green below zero, an

Indicator v4 Moving averagesMean reversion
Updated 2 years ago · Apache-2.0 GitHub repository of ARI-Overextension

TrendGlow

by RobACurtis
1 stars

TrendGlow is a price-chart indicator that recolors candles according to a bullish, bearish, or sideways trend. It imports a BullBear library and can combine Stochastic RSI, MACD, and SMA checks on a user-selected timeframe through request.security. Users toggl

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

MA Cross

by jubayernil
1 stars

This indicator calculates three Simple Moving Averages with periods of 55, 89, and 233 on closing prices and overlays them directly on the price chart. It evaluates a specific bearish crossover pattern where the 55-period fast moving average drops below the 89

Indicator v4 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of MA Cross

Asymmetric Band

by JohnsonHsiao
1 stars

This indicator calculates volatility-based envelopes directly on the price chart. It plots a central exponential moving average of closing prices alongside asymmetric outer bands. The upper band is derived from an EMA of price highs plus a standard deviation o

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · None stated GitHub repository of Asymmetric Band
1 stars

A Pine v4 strategy that plots a 30-period exponential moving average of the close in orange on the price chart. It goes long when a green candle opens above the average and short when a red candle opens below it, closing each position when the opposite signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of ADABTC EMA Cross Strategy

Generic Strategy

by rocketbrainsurgeon
1 stars

This strategy is a bare template that crosses a fast 15-period and a slow 45-period exponential moving average of the bar midpoint. It enters long on an upward cross and short on a downward cross, reversing between the two, and starts trading from a date set b

Strategy v4 Moving averagesTrend
Updated 5 years ago · GPL-3.0 GitHub repository of Generic Strategy

NYSE

by rosskevin
1 stars

This indicator plots NYSE market breadth in a separate pane. It requests the daily advance-decline series, smooths the average of open, high, low and close with a 15-period simple moving average, and fills the area against a zero line green when that average i

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · AGPL-3.0 GitHub repository of NYSE

Chop Zone

by DT021
1 stars

Chop Zone measures the slope of a 34-period exponential moving average of the close. It scales the one-bar EMA change by the average price and a 30-bar high-low range, converts that slope into degrees, and paints a single column in a separate pane. Turquoise t

Indicator v4 TrendMoving averages
Updated 6 years ago · GPL-3.0 GitHub repository of Chop Zone
947 stars

The Henderson Weighted Moving Average indicator calculates a smoothed moving average line using Henderson's symmetric weight kernel formula applied to the chosen source series over a specified period length. It plots directly on the main price chart pane. The

Indicator v6 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Henderson Weighted Moving Average
330 stars

This strategy enters long when a bullish candle closes above an EMA and its upper wick is no larger than a set percent of the candle range, and short on the opposite bearish setup. It closes a long after price rises a small fixed fraction above the entry bar o

Strategy v5 Candlestick patternsMoving averages
Updated 2 months ago · None stated GitHub repository of Full Candle [Alorse]

This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,

Strategy v5 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Indicator Strategy (StochRSI, MFI & EMA) With Safety Orders
105 stars

This strategy plots a fast and a slow simple moving average on the price chart. It enters a long position when the fast average crosses above the slow average and closes that long when the fast average crosses below the slow average. Percentage take profit and

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Simple Moving Average Crossover

MACD Histogram Percentile Rainbow calculates the standard Moving Average Convergence Divergence line, signal line, and histogram in a separate indicator pane. It evaluates the relative magnitude of histogram bars against historical data using a percentile rank

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of MACD Histogram Percentile Rainbow

RSC Trend Trading Study

by readysetcryptocodes
43 stars

This indicator plots Donchian Channels alongside fast and slow simple moving averages directly on the price chart. It generates bullish breakout signals when the high reaches the upper channel while the close is above the 50 SMA (and optionally the 200 SMA). B

Indicator v4 TrendBreakout
Updated 2 years ago · None stated GitHub repository of RSC Trend Trading Study

This strategy overlays the price chart to execute long and short trades on BTCUSDT. It requests multi-timeframe data across daily, 3-minute, 5-minute, 8-minute, and 10-minute periods to generate signals alongside VWMA volatility bands and smoothed moving avera

Strategy v5 Volatility & bandsMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of BTCUSDT 10M - No Repaint v1.1 2023

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