Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 24)

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

2 stars

This indicator tracks and plots market breadth data for major stock market indices such as the S&P 500, Nasdaq, Dow Jones, and Russell indices in a separate pane. It fetches external market breadth metrics showing the percentage of stocks trading above various

Indicator v5 Moving averages
Updated 1 year ago · None stated GitHub repository of 市场宽度 - Market Breadth

Elder Force Index

by ryangaraygay
2 stars

The Elder Force Index indicator calculates efi as the EMA of price change times volume with a configurable length. It then plots the difference between efi and its 9-period SMA as colored column bars in a separate pane, with positive values colored up and nega

Indicator v5 Oscillators & momentumVolume
Updated 1 year ago · MIT GitHub repository of Elder Force Index
2 stars

The MarketSmith Indicator enhances price action visualization by applying custom candle coloring and overlaying configurable moving averages on the main chart. Bar colors can be based either on the bar open relative to close or on the price relative to the pre

Indicator v5 Moving averagesTrend
Updated 2 years ago · MIT GitHub repository of MarketSmith Indicator

MACD

by Metzenas
2 stars

This indicator calculates the MACD oscillator using fast and slow moving averages by default, plotting the MACD line, signal line, and histogram in a separate pane. The histogram changes color based on growth or decline above or below zero to signal momentum s

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · None stated GitHub repository of MACD

Candlestick Patterns

by pineforge-4pass
1 stars

This strategy detects bullish and bearish engulfing candles, hammers, shooting stars, and morning stars from current and prior bar bodies. It enters long when a bullish pattern occurs while price is below a simple moving average, and short when a bearish patte

Strategy v6 Candlestick patternsTrend Repaints
Updated 7 days ago · Apache-2.0 GitHub repository of Candlestick Patterns

I_extremes

by GammaExpansion
1 stars

I_extremes plots a collection of built-in extreme, pivot, ranking and statistical series in a separate pane. It draws 20-bar highest and lowest values, pivot highs and lows, value-when and bars-since results, and flags for close crossing a 20-period simple mov

Indicator v6 Support & resistanceMoving averages
Updated 7 days ago · MIT GitHub repository of I_extremes

EMA-Volume-Momentum

by engtuncay
1 stars

This indicator overlays two exponential moving averages (defaults 50 and 200) alongside scaled volume moving averages on the price chart. It calculates volume momentum via RMA and On-Balance Volume (OBV) compared to its EMA. The script highlights trend changes

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

Dhan+Webhook

by 7b809
1 stars

An overlay indicator that combines a Hull-style moving average, selectable as HMA, EHMA or THMA, with pivot-based support and resistance lines and optional labels. It builds alert messages in JSON for a broker webhook, including action, price, quantity, order

Indicator v5 Moving averagesSupport & resistance
Updated 2 weeks ago · None stated GitHub repository of Dhan+Webhook

Pin Bar Strategy

by moonyroy
1 stars

This strategy identifies long and short pin bar candlestick patterns aligned with trend conditions defined by an Exponential Moving Average (EMA) and an Average True Range (ATR) filter. Long trades enter when an uptrend is active, price is near the EMA, and a

Strategy v6 Candlestick patternsTrend
Updated 3 weeks ago · None stated GitHub repository of Pin Bar Strategy

Simple Test

by mrme000m
1 stars

This indicator plots a 14-period relative strength index of the close and a 21-period exponential moving average of the close in a separate pane. The RSI series is drawn in purple and the EMA series in blue. There are no user inputs, so both lengths stay fixed

Indicator v5 Oscillators & momentumMoving averages
Updated 7 weeks ago · None stated GitHub repository of Simple Test

Strategy Template

by MoDarK-MK
1 stars

This strategy template provides a modular foundation for building TradingView v6 backtests. It uses a placeholder Exponential Moving Average crossover signal combined with customizable filters for higher-timeframe trend alignment, volatility regime thresholds,

Strategy v6 TrendMoving averages
Updated 8 weeks ago · MPL-2.0 GitHub repository of Strategy Template

TRAMA Turtle

by dwightspitz
1 stars

A strategy that draws a triple Hull moving average cloud and up to five TRAMA adaptive average clouds on the price chart, each with its own length, delay and timeframe. Only the Hull and first TRAMA clouds are on by default. It includes ATR-based position sizi

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TRAMA Turtle

EMA + Supertrend + OBV

by vedkanani123
1 stars

A price-chart indicator that stacks a 21, 50 and 200 EMA ribbon with a Supertrend line and an ATR-based volatility stop. On-balance volume trend and a volatility-percentile regime feed a scoring step, and a multi-timeframe heatmap table shows the combined read

Indicator v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of EMA + Supertrend + OBV

Regime Trend Rider

by jayadevrana
1 stars

This long-only trend strategy trades only while price is above a 200-period SMA that is also rising. It enters when price crosses back above a 20-period EMA after a pullback within that uptrend, and exits on an ATR-based chandelier trailing stop that ratchets

Strategy v6 TrendMoving averages
Updated 2 months ago · Custom licence GitHub repository of Regime Trend Rider

GrimmHA Strategy Indicator

by GreyssonEnterprises
1 stars

An indicator that combines Heikin-Ashi candle recognition, doji detection and four smoothed moving averages with lengths of 21, 50, 100 and 200. It can show entry signals, trade levels, background colours and a statistics table, with a risk-to-reward ratio and

Indicator v5 Candlestick patternsMoving averages
Updated 3 months ago · MIT GitHub repository of GrimmHA Strategy Indicator

MRM Scanner

by majohnst
1 stars

The MRM Scanner is a multi-symbol technical analysis tool that scans a user-defined watchlist of up to 20 stock symbols. It calculates a cloud from 144 and 169 EMAs along with Fibonacci retracement levels based on swing highs and lows over a configurable lookb

Indicator v6 Screeners & dashboardsMoving averages
Updated 4 months ago · None stated GitHub repository of MRM Scanner

EMA Channel Reversal

by rubbermetal
1 stars

EMA Channel Reversal is a strategy that plots a 200-period EMA channel built from highs, closes and lows, plus fast and slow momentum EMAs with an optional glow. Entries follow a tracked sequence of breakout, momentum confirmation and pullback, with an alterna

Strategy v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of EMA Channel Reversal

The If Wrapped Subexpression Condition strategy is an exponential moving average crossover trading model. It calculates an 8-period fast EMA and a 21-period slow EMA from closing prices. The strategy executes a long entry when the fast EMA crosses above the sl

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of If Wrapped Subexpression Condition

EMA + Trend + Liquidity

by kvmafthab-pixel
1 stars

This overlay plots a four-length exponential moving average ribbon and classifies trend on the price chart. It marks strong bullish when the 21-period average is above the 50 and 200 with a positive short slope, strong bearish when that stack is reversed, and

Indicator v5 TrendMoving averages
Updated 5 months ago · Custom licence GitHub repository of EMA + Trend + Liquidity

High Margin Pro

by Sandesh30-cloud
1 stars

High Margin Pro is a long-only chart strategy. It plots a 50-period EMA, a 200-period EMA, and a 60-minute 200-period EMA. A long entry requires the fast EMA above the slow EMA, price above the higher-timeframe EMA and within one ATR below the fast EMA, an RSI

Strategy v5 TrendMoving averages
Updated 6 months ago · None stated GitHub repository of High Margin Pro

BTCDOM Strategy

by AlanGuo
1 stars

A long-only strategy that reads Bitcoin daily closes through request.security and compares them with a 30-day simple moving average widened by a slippage percentage. It buys when Bitcoin falls below the lower offset line and closes the position when Bitcoin ri

Strategy v6 Mean reversionMoving averages
Updated 7 months ago · None stated GitHub repository of BTCDOM Strategy

BTC ATH Golden Cycle

by ymlee1104
1 stars

BTC ATH Golden Cycle is a Bitcoin-focused strategy script that plots time-based halving cycles, supply and demand zones, a ZigZag indicator, a Rainbow ribbon, and an Ichimoku Cloud directly on the main price chart. The script models historical and projected BT

Strategy v6 TrendSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle
1 stars

The Multi-Symbol Dashboard indicator overlays a customizable panel on the price chart to monitor up to six cryptocurrency symbols at once. It displays RSI, MACD histogram, EMA values, percentage price change and volume data fetched via request.security for sym

Indicator v5 Screeners & dashboardsOscillators & momentum
Updated 9 months ago · MIT GitHub repository of Multi-Symbol Dashboard

MA Crossover Strategy

by surajmateti
1 stars

This long-only strategy calculates fast and slow moving averages to generate trend-following trade signals. It enters a long position when the fast moving average crosses above the slow moving average, and closes the trade when a bearish crossover occurs. Movi

Strategy v5 Moving averagesTrend
Updated 11 months ago · None stated GitHub repository of MA Crossover Strategy

Lab-Doi-04

by theteelek
1 stars

This strategy plots on the price chart and uses daily EMA crossovers to generate signals for opening long positions in crypto trading. It activates between user-defined start and end dates and enters long trades when the fast EMA exceeds the slow EMA with bar

Strategy v6 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Lab-Doi-04

TOTAL MTPI

by Mikelkulla
1 stars

This strategy calculates the TOTAL MTPI using a combination of multiple indicators including Trend Sniper, EMA, MAMA, Kijun Sen, Supertrend and others to determine the overall direction of the cryptocurrency market cap index. It signals long entries when the c

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

This strategy uses two simple moving averages, 10 and 20 periods by default. It enters long when the fast average crosses above the slow one and enters short on the opposite cross. Each trade is paired with an ATR-based stop loss and take profit, using separat

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

MA Cross Strategy

by mkdir700
1 stars

A simple long-only strategy for the price chart built on two simple moving averages. It buys when the fast average crosses above the slow one and closes the position when the fast crosses back below. A stop loss and a take profit, entered as numeric inputs, ar

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of MA Cross Strategy
1 stars

This indicator detects a selectable set of candlestick patterns and plots them on the price chart. Fast and slow simple moving averages provide a trend context for pattern interpretation. Users can turn individual formations on or off, including doji variants,

Indicator v5 Candlestick patternsMoving averages
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns

This indicator compiles multiple technical components starting with the UCS Stochastic Momentum Index into a composite indicator framework. It calculates range baselines and nested exponential moving averages to evaluate momentum across multiple smoothed stage

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of One Indicator UCS Stochastic Momentum Index
1 stars

This Pine v5 strategy compares a 20-period EMA with a 50-period SMA. It enters long when the EMA is above the SMA and short when below, and also contains a second set of pullback entries and crossover-based closes. The code mixes two overlapping rule sets, so

Strategy v5 TrendMoving averages Archived
Updated 4 years ago · None stated GitHub repository of Moving Average Strategy

Hash Ribbons

by DT021
1 stars

This indicator plots daily Bitcoin hash-rate short and long simple moving averages in a separate pane. It marks capitulation when the short average crosses under the long average, miner capitulation while it stays below, recovery while the short average rises,

Indicator v4 Moving averagesOscillators & momentum Repaints
Updated 6 years ago · GPL-3.0 GitHub repository of Hash Ribbons
318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages
257 stars

This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross

Strategy v5 TrendSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of 30s - ES 1m Strategy Candle Bar

Ichimoku Cloud

by harryguiacorn
220 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud
219 stars

This educational indicator calculates 20-period and 60-period Simple Moving Averages (SMA) directly on the price chart. It detects bullish golden crosses and bearish death crosses between the two averages, marking occurrences with chart labels below or above b

Indicator v4 Moving averagesTrend
Updated 5 years ago · None stated GitHub repository of Teaching Example - alertcondition

This indicator trains a single-neuron artificial neural network (perceptron) on each bar to classify price movement and plot an adaptive moving average on the main chart. It evaluates historical sample data to iteratively adjust weights using a step activation

Indicator v5 AI / machine learningMoving averages
Updated 1 year ago · None stated GitHub repository of Machine Learning: Perceptron-Based Strategy

3Commas Bot

by hasnocool
106 stars

This strategy overlays moving averages on the price chart to generate long and short trade signals compatible with 3Commas bot automation. It sets stop losses relative to recent swing pivots buffered by an ATR multiplier, while exits are handled by a risk-to-r

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 3Commas Bot
104 stars

This overlay strategy combines a machine-learning distance model with a MACD oscillator to open trades on the price chart. It compares recent history using cosine similarity or Euclidean and Lorentzian distance, then filters direction with selectable moving-av

Strategy v5 AI / machine learningOscillators & momentum
Updated 3 years ago · MIT GitHub repository of MLCEL and MACD Strategy

Adaptive Price Zone

by mihakralj
99 stars

The Adaptive Price Zone indicator calculates volatility bands around a double-smoothed exponential moving average baseline directly on the price chart. It calculates internal smoothing factors using the square root of the user-specified period, double-smoothin

Indicator v6 Volatility & bandsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Adaptive Price Zone

Moon Dev SMA Ribbon 20/40

by moondevonyt
92 stars

Moon Dev SMA Ribbon 20/40 calculates two simple moving averages (default 20 and 40 periods) and overlays them directly on the price chart. The space between the moving averages is filled with a dynamic gradient that adapts in color and transparency based on tr

Indicator v6 TrendMoving averages
Updated 2 months ago · Custom licence GitHub repository of Moon Dev SMA Ribbon 20/40

SMA RSI Strategy

by PythonForForex
64 stars

This strategy evaluates simple moving averages and the Relative Strength Index to generate trading signals. It calculates a 10-period SMA, a 30-period SMA, and a 14-period RSI. Long positions are entered when the fast SMA crosses above the slow SMA while RSI i

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of SMA RSI Strategy

EMA Ribbon MACD

by iamrichardD
57 stars

This strategy combines an EMA ribbon with MACD confirmation and plots in a separate pane. It enters when ribbon alignment, optional MACD zero or signal crosses, volume, smart-money, and multi-timeframe filters agree, then exits with percentage stop loss and ta

Strategy v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD
53 stars

This strategy trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of EUR/USD EMA9-21 + RSI Scalping Strategy

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