Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 57)

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

1 stars

This strategy executes trend-following trades based on Supertrend reversals filtered by exponential moving averages. Long trades enter when the Supertrend turns bullish while the close is above the 50 and 200 EMAs. Short trades enter when the Supertrend turns

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Supertrend v6

My Script

by be-thomas
65 stars

This indicator is a simple demonstration of Pine Script type casting from official TradingView documentation. It defines a length variable as a float, explicitly casts it to an integer, and uses it to compute a 10-period Simple Moving Average of the closing pr

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

This strategy plots three exponential moving averages on the price chart and trades when they stack in order. It opens a long when the fast average rises above the middle and the middle rises above the slow, the close is above an optional regime average, and v

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Triple EMA v6
106 stars

This strategy combines the Price Moving Average Ratio Percentile (PMARP) with Madrid Moving Average Ribbon concepts to identify overextended price conditions and trend shifts. It calculates PMAR or PMARP across selectable moving average types and a lookback wi

Strategy v5 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of PMAR and Madrid MA Strategy

Relative Vigor Index

by hasnocool
106 stars

This strategy overlays two exponential moving averages and ATR-based price targets directly on the price chart while calculating the Relative Vigor Index internally. It enters long positions when the RVI line crosses above its signal line during an established

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Relative Vigor Index

Smoothed Moving Average

by TWODS-CAPITAL
37 stars

The Smoothed Moving Average indicator calculates and plots a smoothed moving average directly on the price chart. It initializes using a simple moving average over the user-defined length and recursively updates using previous average values to reduce noise an

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of Smoothed Moving Average
7 stars

This overlay strategy tracks the high and low of a user-defined London session and plots the previous session levels as support and resistance. It flags a break beyond a level when price closes past an ATR buffer, then waits a set number of bars for a retest w

Strategy v5 Sessions & timeSupport & resistance
Updated 3 months ago · None stated GitHub repository of London SR Cleaner WR (TP 0.20)
1 stars

Tn Sovereign VIOP Session v6 is an intraday session-filtered trend-following strategy. It generates buy and sell signals based on fast and slow Exponential Moving Average (EMA) crossovers strictly within specified session hours. Trade risk is managed using ATR

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign VIOP Session v6
99 stars

Gann High-Low Activator plots a trend line on the price chart from simple moving averages of highs and lows. Close above the high average sets a bullish trend and the line follows the low average; close below the low average sets a bearish trend and the line f

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Gann High-Low Activator

Mirror Oscillator Pro is a custom momentum indicator displayed in a separate pane. It projects mirrored price calculations using recent pivot highs, pivot lows, and a selectable baseline anchor such as Golden Cloud, ATR, Bollinger Bands, or Ichimoku. An RSI ca

Indicator v5 Oscillators & momentumMoving averages
1 stars

This strategy pairs the Vortex Indicator with an exponential moving average trend filter to execute trend-following trades. It initiates a long entry when VI+ crosses above VI- while price trades above the 200 EMA, and a short entry when VI- crosses above VI+

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Vortex v6

Trailering A004

by ruckard
13 stars

Trailering A004 is an automated trading strategy designed to optimize entry and exit points while minimizing stop loss and maximizing take profit. It calculates signals using high and low closing moving averages and supports strict long or short filtering. The

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering A004

M&M Trading

by g-moe
3 stars

M&M Trading is an overlay indicator that combines momentum calculations with moving averages and a visual dashboard. It calculates a modified Chande Momentum Oscillator with adjustable multipliers to identify bullish and bearish momentum triggers, optionally c

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of M&M Trading
99 stars

This indicator calculates the geometric mean of a user-selected source over a lookback window and plots the result on the price chart. It sums the natural logs of positive values, then exponentiates their average. Missing and non-positive values are skipped, a

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Geometric Mean (GEOMEAN)

Trailering B001

by ruckard
13 stars

Trailering B001 is an automated trading strategy designed to generate trade alerts and integrate with Zignaly copy-trading platforms. It utilizes custom moving average bounds (Curie High and Low closing MAs) to gauge price excursions and trigger long or short

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trailering B001

MA Trend Percent Target Strategy is a trend-following overlay strategy that executes trades based on price crossovers with a moving average. It supports multiple moving average types, including SMA, EMA, WMA, VWMA, and HMA. Trades enter when price crosses abov

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of MA Trend Percent Target Strategy

10PreBuyer

by hasnocool
106 stars

10PreBuyer is a dip-buying strategy that submits limit orders below recent price action using a discounted Hull Moving Average (HMA). It calculates the highest HMA value of high prices over a selected period, multiplied by a percentage discount factor, and pla

Strategy v4 Moving averagesMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of 10PreBuyer
3 stars

This indicator calculates standard MACD line, signal line, and histogram values while evaluating swing high and swing low pivot points on price and MACD to detect divergence. It compares recent pivot levels to identify higher highs, lower lows, and trend state

Indicator v5 Oscillators & momentumDivergence Repaints
Updated 5 months ago · None stated GitHub repository of MACD - Divergence

How To Set Time Ranges

by regalouisei
2 stars

How To Set Time Ranges is a strategy template designed to demonstrate date and time filtering for backtesting. It calculates fast and slow simple moving averages to trigger long entries on bullish crossovers and close positions on bearish crossunders. Trades a

Strategy v5 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of How To Set Time Ranges
1 stars

The strategy calculates the Stochastic oscillator using specified K and D periods, then detects bullish and bearish divergences between price pivots and the D line. Bullish signals occur when price forms lower lows while Stochastic forms higher lows within the

Strategy v6 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of TN Stochastic Causal Divergence

Trailering C002

by ruckard
13 stars

This strategy evaluates price excursion using Curie closing moving averages on the price chart to trigger trades and manage positions. It supports both long and short positions with configurable strategy date ranges and strict mode conditions. Built as an auto

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering C002

MACD Signals

by g-moe
3 stars

The MACD Signals indicator plots dual Exponential Moving Averages (EMAs) and generates buy and sell signals directly on the price chart based on MACD crossovers filtered by trend context. Users can configure independent EMA and MACD parameter settings for long

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD Signals
1 stars

A short price-chart indicator that plots a 20 and a 50 period EMA and waits for a pullback after each crossover. After the 20 crosses above the 50, it looks for price to touch the 50 and then prints a buy triangle on the next green-closing candle. After a down

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of Terilss EMA20-EMA50 Pullback Alert

Hann FIR Filter (HANN)

by mihakralj
99 stars

This indicator calculates a finite impulse response filter using Hann window coefficients and plots the smoothed series on the price chart. It weights the selected source with a raised-cosine window over the chosen length and divides by the sum of the weights.

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Hann FIR Filter (HANN)

Trailering D002

by ruckard
13 stars

Trailering D002 is an execution strategy template designed for automated crypto trading on price charts. It evaluates High and Low Curie moving average closing lines to identify potential entry conditions across customizable time windows. The strategy manages

Strategy v5 Moving averages
Updated 1 year ago · None stated GitHub repository of Trailering D002

MACD Signals

by g-moe
3 stars

MACD Signals overlays buy and sell labels on the price chart by combining MACD crossovers with RSI conditions. A buy signal is generated when a bullish MACD crossover occurs within a user-defined bar limit after the RSI dips below an oversold threshold, while

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD Signals

The Bear Crossover

by vedkanani123
1 stars

A simple moving average crossover indicator drawn on the price chart. It plots an 11-period and a 51-period exponential moving average. A BUY label appears when the fast line crosses above the slow line on a bullish candle, and a SELL label appears when it cro

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of The Bear Crossover

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy

Technical Ratings

by TWODS-CAPITAL
37 stars

This indicator scores price using moving averages, oscillators, or both, then maps the result to buy, sell, and neutral ratings. It compares several simple and exponential averages, a Hull average, a volume-weighted average, and Ichimoku lines with price, and

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · MIT GitHub repository of Technical Ratings

Trailering E002

by ruckard
13 stars

Trailering E002 is a trading strategy that uses moving average closing lines to optimize entries, take profit levels, and stop loss execution. Applied directly on the main price chart, it tracks price excursion to refine trades and includes date filtering for

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trailering E002

MACD Signals with Alert System combines multiple technical indicators into a unified signal and alert generator overlaid on the price chart. It calculates a Hull Moving Average, MACD histogram, three Exponential Moving Averages, Slow Stochastic, and Time Segme

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD Signals with Alert System

Ichimoku Kinkō Hyō

by regalouisei
2 stars

This indicator plots an enhanced version of the traditional Ichimoku Kinkō Hyō on the main price chart. It calculates adaptive Tenkan-Sen and Kijun-Sen lines using dynamic lookback periods adjusted by volume, ATR volatility, and Chikou trend filters. Users can

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Ichimoku Kinkō Hyō

Technical Ratings Strategy

by TWODS-CAPITAL
37 stars

A multi-indicator consensus strategy that computes combined rating signals from various moving averages and technical oscillators, including RSI, Stochastic, MACD, CCI, ADX, and Ichimoku Cloud. Depending on user configuration, trades are triggered by overall c

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of Technical Ratings Strategy

Trailering F008

by ruckard
13 stars

Trailering F008 is a reversal strategy and execution template designed to send automated trade signals to Zignaly copy-trading platforms. It generates entry conditions using custom moving average envelopes known as Curie closing lines, aiming to optimize posit

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering F008

This indicator overlays a Hull Moving Average and three Exponential Moving Averages on the price chart while monitoring signals from MACD, Stochastic Oscillator, and Time Segmented Volume. It tracks trend direction changes, MACD histogram color shifts from bri

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MACD Signals with Alert System

Ichimoku Oscillator

by regalouisei
2 stars

The Ichimoku Oscillator indicator calculates conversion line, base line, leading span, and lagging span using specified periods. It plots these values in a separate pane along with an optional EMA overlay. Main settings allow customization of line lengths, ATR

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Ichimoku Oscillator
1 stars

A strategy on the price chart that builds a four-point audit score from a higher-timeframe EMA, fast versus slow moving average, volume against its average, and bar movement against ATR. When the score reaches a minimum, it logs a message and moves through enu

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of TN Universal Sovereign
106 stars

This strategy identifies trend-following entries using a triple exponential moving average alignment and ATR-based exits on the main price chart. Long signals trigger when the fast EMA is above the medium EMA and medium is above slow, accompanied by a close ab

Strategy v4 Moving averagesVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3 EMA + Stochastic RSI + ATR

Trailering G010

by ruckard
13 stars

Trailering G010 is a Pine Script v5 strategy that draws on the price chart. It uses Curie closing lines from simple moving averages of an ohlc4 source, with separate high and low lengths, to run long-only and short-only logic at the same time, including an opt

Strategy v5 Moving averages
Updated 1 year ago · None stated GitHub repository of Trailering G010

This strategy combines MACD histogram crossovers with a dual moving average cloud to generate long and short trading signals directly on the price chart. It evaluates histogram crossings relative to zero while filtering entries using overall MACD positioning a

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MACD Signals with Trading Dashboard Strategy
3 stars

This strategy calculates a Volume-Weighted Moving Average Convergence Divergence (VWMA MACD) and its histogram average to generate trade signals in a separate pane. It enters long positions when the MACD histogram crosses above its simple moving average and sh

Strategy v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD VWMA Strategy
106 stars

This Pine Script strategy calculates three RSI indicators with periods 50, 75 and 100 on the chosen source. It computes multiple simple and exponential moving averages on the fast RSI and assigns colors based on changes relative to the slow RSI. Long entries t

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 3 RSI MA movement crypto 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