Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 62)

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

PineForge - Pendulum SAR Rotation calculates Parabolic SAR and Exponential Moving Average (EMA) values to identify trend-filtered long entries. The strategy enters a long position when price crosses above the Parabolic SAR while remaining above the trend EMA.

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Pendulum SAR Rotation

This indicator calculates moving averages with periods derived from a user-selected date range multiplied by Fibonacci ratios (1.0, 1.618, and 0.618). On the chart's final bar, it renders these moving average paths directly on the price chart using polylines.

Indicator v5 Moving averagesSupport & resistance

PineForge - Relay Enum Regime

by pineforge-4pass
1 stars

This strategy executes trades based on one of two selectable regimes: trend-following or mean reversion. In trend mode, it enters long positions on a bullish EMA crossover and exits on a bearish crossover. In reversion mode, it buys when the RSI dips below an

Strategy v6 TrendMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Relay Enum Regime
106 stars

This strategy calculates a simple moving average basis flanked by three upper and three lower volatility bands scaled using Fibonacci ratios of the Average True Range. It enters long when the bar intersects a chosen target band and enters short when price touc

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Fibonacci Ratios

PineForge Anvil Percent Costs

by pineforge-4pass
1 stars

This Pine Script v6 strategy calculates two simple moving averages, one fast and one slow. It enters long positions when the fast SMA crosses above the slow SMA and closes long positions when the fast SMA crosses below the slow SMA. The strategy uses percent-o

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Anvil Percent Costs

PineForge Archive Map Presence

by pineforge-4pass
1 stars

This strategy generates trading signals on the price chart using a regime-based RSI indicator. It selects an RSI threshold from an internal map based on the chosen regime or falls back to a configurable value. Long entries occur on RSI crossover above the thre

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Archive Map Presence
106 stars

This strategy plots customizable Bollinger Bands directly on the price chart using eleven selectable moving average types, including VAR, DEMA, ZLEMA, Hull, and Tillson T3. It generates long entry stop orders when price crosses above the lower band and short e

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy (MA type)

This strategy plots Bollinger Bands on the price chart using an EMA or SMA basis and a matching standard-deviation calculation. It enters long when price crosses back above the lower band and short when price crosses back below the upper band. An optional Intr

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy with Intraday Intensity Index

This strategy plots Bollinger Bands and an exponential moving average on the price chart. It enters long when price touches the lower band above the EMA and a bearish candle is followed by a bullish candle, and enters short on the mirrored upper-band setup. Ex

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Trending Reverse Strategy
3 stars

Pro In Out Divergence is a lower-pane oscillator indicator that combines normalized stochastic layers, triple exponential moving averages (TEMA), and DMI/ADX state calculations. It tracks momentum shifts and inflow or outflow states relative to zero lines and

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of Pro In Out Divergence

PineForge Cascade MTF Tuple

by pineforge-4pass
1 stars

PineForge Cascade MTF Tuple is a multi-timeframe trend-following strategy designed for price charts. It uses a single security request to retrieve an Exponential Moving Average and Average True Range from a higher timeframe. The strategy plots an entry thresho

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Cascade MTF Tuple

MA Sabres [LuxAlgo]

by regalouisei
2 stars

MA Sabres identifies trend reversals by monitoring direction changes in a selectable moving average after a user-defined trend duration. The indicator supports various moving average types including SMA, EMA, HullMA, VWMA, DEMA, and TEMA. When a moving average

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of MA Sabres [LuxAlgo]
1 stars

A long-only session strategy that trades inside a configurable time window, 08:00 to 16:00 UTC by default. It enters long at the start of the window or when a 16-period EMA crosses above a 44-period EMA inside it, and closes the position when the window ends.

Strategy v6 Sessions & timeMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Compass Session Market
3 stars

Psychological Levels is a strategy that plots horizontal grid lines based on whole, half, and quarter psychological price levels directly on the chart. It triggers trades during designated intraday session windows, filtering signals using a multi-timeframe mov

Strategy v5 Support & resistanceSessions & time
Updated 5 months ago · None stated GitHub repository of Psychological Levels
1 stars

This strategy identifies severe close-to-close volatility shocks and triggers an immediate exit from any open long position. It enters long when the rate of change of close crosses above a user-defined momentum threshold and the close sits above the trend EMA.

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Flashpoint Immediate Close

Booz Strategy

by hasnocool
106 stars

Booz Strategy is a price-chart strategy that opens longs when a fast EMA crosses above a slow EMA and shorts when it crosses below, provided an optional longer moving-average trend filter agrees. SMA or EMA choices and lengths change the filter and a plotted s

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Booz Strategy
3 stars

Psychological Levels is a chart overlay indicator that draws horizontal quarter, half, and whole round-number levels. It marks buy and sell signals when volume crosses user thresholds near those levels, with an optional moving-average filter, a delay between s

Indicator v5 Support & resistanceVolume
Updated 5 months ago · None stated GitHub repository of Psychological Levels

PineForge Gatekeeper Risk Cap

by pineforge-4pass
1 stars

This Pine Script v6 strategy gates long trades to a user-defined session window (default 0900-1700 Asia/Taipei) and enforces a maximum daily filled orders limit. It generates entries solely on fast EMA crossover above the slow EMA while inside the session. Pos

Strategy v6 Sessions & timeMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Gatekeeper Risk Cap
3 stars

Psychological Levels is a price-chart strategy that draws quarter, half, and whole rounded price levels. A rounding value sets the level spacing, and each level type can be toggled with its own color, line style, and width. Buy and sell volume thresholds, a pr

Strategy v5 Support & resistanceVolume
Updated 5 months ago · None stated GitHub repository of Psychological Levels
3 stars

Psychological Levels calculates and overlays key rounded price thresholds on the main chart, distinguishing between whole, half, and quarter price levels. It identifies potential trade setups filtered by defined session time windows, prior-day range conditions

Indicator v5 Support & resistanceSessions & time
Updated 5 months ago · None stated GitHub repository of Psychological Levels
1 stars

This strategy calculates a linearly weighted moving average centerline explicitly using a while loop, accompanied by a standard deviation upper band. It enters a long position when the close crosses over the upper band. Exits occur when the price crosses back

Strategy v6 BreakoutVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Heliograph While Channel

Breakout Trend Trading

by hasnocool
106 stars

This strategy trades breakouts, pullbacks, and reversals in the chosen direction on the price chart. Entries can require new long-term highs or lows and recent moving-average alignment, with optional weekly or monthly Supertrend filters. Exits can follow an op

Strategy v4 TrendBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of Breakout Trend Trading
1 stars

A long-only strategy that enters when the close crosses above a 34-period simple moving average. Each trade has an ATR-based protective stop and is closed after a fixed number of bars if still open. Inputs set the average length, hold period, ATR length and st

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Horizon Next-Bar Close
3 stars

This strategy trades swing high breakouts on lower timeframes in alignment with higher-timeframe moving average trends. It evaluates price highs using a configurable lookback period and applies higher-timeframe moving average filters along with an optional ATR

Strategy v5 TrendBreakout
Updated 5 months ago · None stated GitHub repository of Qullamaggie Breakout Fixed

PineForge Loopback Method For

by pineforge-4pass
1 stars

The PineForge Loopback Method For is a strategy that calculates an average vote by comparing current close to historical closes across user-defined horizons. It enters a long position when the average vote crosses above a minimum threshold and price exceeds th

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Loopback Method For

BT-5M-1H

by hasnocool
106 stars

BT-5M-1H is a mean-reversion strategy designed for 5-minute charts that simulates 1-hour Bollinger Bands to identify overbought and oversold conditions. It takes positions when price crosses standard deviation multiplier levels and exits using configurable log

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BT-5M-1H

This indicator calculates the Range Action Verification Index as the absolute percentage difference between a short simple moving average and a long simple moving average of close. It plots that value in a separate pane with a dashed threshold line and a dotte

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of RAVI: Chande Range Action Verification Index
2 stars

The Moving Regression Prediction Bands indicator calculates polynomial regression bands from historical price data using a moving window. It fits a polynomial curve of specified degree to generate upper and lower bands representing expected price ranges with p

Indicator v5 Moving averagesVolatility & bands
Updated 8 months ago · None stated GitHub repository of Moving Regression Prediction Bands

BTC 15 min

by hasnocool
106 stars

This strategy combines percentage-based moving average channels, a linear regression curve, and an external timeframe Hull moving average variant to generate trade signals. Buy entries trigger when the linear regression crosses above the smoothed moving averag

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BTC 15 min
99 stars

This indicator applies the rectified linear unit to the difference between the selected source and a 20-period simple moving average. Positive deviations plot in green and negative deviations plot in red in a separate pane. The only input changes the price ser

Indicator v6 Moving averagesAI / machine learning
Updated 4 weeks ago · Apache-2.0 GitHub repository of Rectified Linear Unit (ReLU)

This multi-filter strategy triggers intraday entries by combining Relative Strength Index (RSI) range conditions with Volume Weighted Moving Average (VWMA) crossovers, Simple Moving Average (SMA) price alignment, and volume oscillator filters. Users can restri

Strategy v5 Oscillators & momentumMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Rising Bars 30 Sec RSI SMA VWMA Exit Strategy
1 stars

This strategy calculates an ALMA smoothed version of the close price and the correlation between close and volume. It enters long trades when price crosses above ALMA and correlation exceeds the minimum threshold. It exits on price crossing below ALMA, correla

Strategy v6 Moving averagesVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Quarry ALMA Correlation
3 stars

A momentum scalping strategy designed for 5-minute charts that combines the Relative Strength Index (RSI) with fast and slow Simple Moving Averages (SMA). It triggers long entries when the 14-period RSI exceeds 70 while the 5-period SMA is above the 20-period

Strategy v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of RSI MA Scalp Strategy

Numbers Renko

by regalouisei
2 stars

This indicator calculates and overlays numerical volume or time metrics directly on chart bars, primarily tailored for Renko style analysis. It compares current values against an EMA or SMA baseline to grade activity across multiple visual tiers and color scal

Indicator v5 VolumeMoving averages
Updated 8 months ago · None stated GitHub repository of Numbers Renko
1 stars

This strategy plots a fast and a slow exponential moving average on the price chart. It enters long and closes any short when the fast average crosses above the slow average, and enters short and closes any long when the fast average crosses below the slow ave

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Switchback All-In Reversal

This strategy plots a moving average with a range band on the price chart and places stop entries when the source crosses the upper or lower band. Long and short orders are cancelled if price returns through the average or reaches the stored stop price. Option

Strategy v4 Moving averagesVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Built-in Kelly ratio for position sizing
1 stars

A long-only strategy that enters when a 19-period EMA crosses above a 58-period EMA. Half of the position is closed by a market order once price reaches an ATR multiple above the average entry. The rest is closed when the EMAs cross back down or when the close

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Tranche Partial Market Close

Bulle de bollinger

by hasnocool
106 stars

Bulle de bollinger is a price-chart strategy that plots a 20-period simple moving average and two-standard-deviation Bollinger bands, with a fill between the bands. It enters long when the prior bar's open and close are below the lower band, and short when the

Strategy v4 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of Bulle de bollinger

Bulle de Bollinger

by hasnocool
106 stars

The script plots the SMA middle band along with Bollinger upper and lower bands with two standard deviations, filling the area between them on the price chart. It signals long entries on a close crossing above the lower band after the previous bar was below it

Strategy v4 Moving averagesVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bulle de Bollinger
1 stars

This strategy overlays a fast and a slow exponential moving average on the price chart and treats their crossovers as entries. It opens a long position when the fast average crosses above the slow average and, when shorts are allowed, opens a short on the oppo

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Aurora Market Bracket
1 stars

This session-based strategy triggers long entries at the start of the New York trading session when trend and momentum conditions align. It calculates a 38-period Exponential Moving Average and a 14-period RSI. A long position is taken at session open if the c

Strategy v6 Sessions & timeTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Borough New York Session

Session Wicks

by g-moe
3 stars

This strategy executes long and short trades on the price chart by combining multi-timeframe smoothed Heikin-Ashi trends, higher-timeframe Hull Moving Average variations, and an ATR-based trailing stop. Users can adjust timeframes, smoothing lengths, Hull form

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Session Wicks
1 stars

The Cadence Matrix Pairing strategy calculates price direction changes and volume confirmation across short, medium, and long horizons using close comparisons and simple moving averages of volume. It assembles these binary votes into a transposed matrix and ta

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Cadence Matrix Pairing
106 stars

This strategy searches for long buy-and-hold entries on the price chart. It calculates a user-length EMA and a fixed 12/26 MACD, then opens a long position when price is within the maximum EMA distance, that distance is not shrinking, MACD is at or below zero,

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Buy and Hold entry finder Strategy
99 stars

This indicator measures the root mean squared error between a chosen price source and an exponential moving average of that same source. It averages squared differences over a user-set lookback with a circular buffer, then plots the square root as a red area i

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Root Mean Squared Error (RMSE)

Session Wicks

by g-moe
3 stars

This strategy calculates smoothed Heikin-Ashi candles alongside a moving average of the Relative Strength Index to enter trend reversals. It triggers long entries when smoothed Heikin-Ashi turns bullish while RSI trades above its moving average, and short entr

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Session Wicks

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