A moving average smooths price into one line. Shorter averages follow price closely; longer ones change slowly. Crossovers between a fast and a slow average are among the oldest trading rules.
Every average lags. Variants such as Hull, ALMA or adaptive averages trade some of that lag for more noise, so test the settings rather than assuming a newer formula is better.
357 of these 3,064 scripts are marked Repaints, or read higher-timeframe data with lookahead on.
Before You Use One
Note which price the average uses (close, HL2, OHLC4).
Test crossover rules in a sideways market, where they whipsaw.
Compare lengths on the timeframe you actually trade.
Moving averages: Indicators, Strategies and Libraries
Doge SMA is a long-only moving-average crossover strategy drawn on the price chart. It calculates a fast and a slow simple moving average of close and enters a long position when the fast average crosses above the slow average, but only inside a user-defined s
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This strategy calculates and plots a fast Exponential Moving Average (EMA) and a slow EMA directly on the main price chart. It enters long trades when the fast EMA crosses above the slow EMA and exits when the fast EMA crosses below the slow EMA. Inputs allow
This indicator plots five custom moving averages on the price chart, using EMA, SMA or WMA types with periods of 10, 55, 200, 20 and 100. It highlights multiple crossovers between the MAs including MA1-MA2, MA1-MA3, MA1-MA4, MA1-MA5, MA2-MA3, MA2-MA4, MA2-MA5,
This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can
This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk
This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre
This multi-timeframe indicator calculates and plots 20-period and 60-period simple moving averages from the 60-minute timeframe directly onto the price chart. The 20-period average displays as a green line, while the 60-period average appears in blue. It serve
This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev
The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab
This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy combines three Exponential Moving Averages with Williams Fractals to execute trend-following or mean-reverting trades. It analyzes price structure using short, medium, and long-term EMAs along with fractal highs and lows. Entries trigger when fra
The Aberration indicator calculates channel bands based on the absolute deviation of a price source from a central moving average. Traders can choose between SMA, EMA, WMA, RMA, or HMA for the baseline, then apply a multiplier to the smoothed deviation to form
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem
Minimal Fill Examples is an educational reference script demonstrating five basic implementations of the fill function in Pine Script. It calculates simple moving averages and plots price lines alongside horizontal reference levels. The script showcases variou
This strategy plots a MACD oscillator in a separate pane and trades Bitcoin futures from zero-line and signal-line crosses. Optional early momentum signals, a volume filter, and a trend moving-average filter can confirm entries. It sizes positions as fixed con
Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas
The 8-Factor Composite Screener evaluates equities across fundamental and technical criteria, including valuation ratios, earnings and revenue growth, 12-month return momentum, proximity to 52-week highs, Stage 2 moving average alignment, benchmark relative st
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open
SSE Index RSI Bounce Strategy is a multi-timeframe momentum and trend strategy that combines daily and weekly Relative Strength Index (RSI) bounds with Exponential Moving Averages (EMA). It identifies long entries when daily or weekly RSI crosses up from overs
This indicator plots Aberration bands on the price chart around a central moving average. It measures the absolute deviation of the source from that average, smooths the deviation with a simple moving average, and offsets the center by a multiplier to form upp
Gold Scalping BOS & CHoCH with MA Filter is a strategy that identifies market structure shifts using Break of Structure (BOS) and Change of Character (CHoCH) signals alongside exponential moving average trend filters. Long trades enter when bullish BOS, bullis
Profit Maximizer (PMax) is a trend-following overlay indicator that combines moving averages with an ATR-based trailing stop mechanism. It calculates a selected moving average—supporting types such as EMA, SMA, ZLEMA, VAR, and TSF—and constructs a trailing ban
This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req
This indicator overlays exponential moving averages and a session VWAP on the price chart. It builds a daily VWAP from typical price and volume, then plots one- and two-standard-deviation bands around it on selected intraday charts. EMA lengths change by timef
This strategy trades longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian
This intraday strategy implements Mark Fisher's Opening Range Breakout (ORB) methodology tailored for index futures like ES and NQ. It calculates session opening ranges, volume z-scores, and VWAP bands to plot support, resistance, and confirmation levels on th
This strategy enters directional trades based on MACD histogram zero-line crossovers filtered by a safety threshold. Users toggle long or short trading modes independently. MACD lines can be calculated using simple or exponential moving averages. Exits execute
CombinedBinHAndClucV6 is a trading strategy based on the popular BinHV45 and ClucMay72018 algorithms. It calculates dual Bollinger Bands, Exponential Moving Averages, Relative Strength Index, Average True Range, and volume metrics across primary and one-hour h
This indicator scans up to thirty symbols simultaneously against selected technical strategies, such as moving average crosses, price strength, or volume momentum. It displays long and short signals using shapes, labels, and horizontal lines directly inside a
This indicator plots an exponential moving average on the price chart and formats structured JSON alert payloads on confirmed bar closes. It is designed to export real-time market data to external webhook receivers or AI assistant backends. Inputs allow users
The [Pirate] 2 Moving Averages and Cross indicator plots fast and slow moving averages directly on the price chart to assist with trend identification. Users can select from exponential, simple, running, weighted, or volume-weighted moving average types. It au
BBW RSI 15 Study is an overlay indicator designed for automated crypto trading via webhooks. It plots standard-deviation-adjusted Bollinger Bands directly on the price chart while calculating secondary metrics such as Stochastic RSI, volume moving averages, an
The Hedge Scalp indicator calculates an Exponential Moving Average (EMA) and generates four long grid levels and one hedged short grid level at user-defined percentage distances below the EMA. It models grid entry execution and average entry take-profit levels
This indicator is a short Pine Script v6 test fixture for function signature checks. It calculates a 14-period simple moving average of the close and calls alert with a fixed message. The remaining lines deliberately misuse functions, including an extra argume
This indicator collection calculates and plots previous daily high and low price levels on the chart to identify potential supply and demand zones. It includes real-time intraday high and low calculations, RSI divergence detection across a customizable period
Complete is a short Pine Script v6 indicator used as an editor completion fixture. It declares a user-defined Point type with float fields, constructs one instance, and reads its x coordinate. It also calculates a five-bar simple moving average of the close an
This indicator draws a visual present-state context panel on the price chart. It classifies volatility from ATR and Bollinger bandwidth percentiles, measures how far price sits from an EMA in ATR units, and scores trailing candle noise with wick ratio, directi
BBW RSI 60 Study combines Bollinger Bands, Bollinger Band Width (BBW), and the Relative Strength Index (RSI) to monitor volatility compression and momentum reversals. It plots standard Bollinger Bands directly on the price chart while internally calculating RS
This strategy calculates a standard moving average convergence divergence oscillator and executes trades directly on the main price chart. It opens a long position when the histogram delta crosses above zero and enters a short position when it crosses below ze
This overlay indicator plots the 100-period and 200-period exponential moving averages on the price chart and marks buy or sell triangles after an EMA crossover when the next two candle opens stay on the correct side of the 100 EMA and price stays within a sym
P404 Smoke is a price-chart strategy that sequences an optional higher-timeframe EMA bias, a liquidity range from recent pivots, a sweep of buy-side or sell-side liquidity, and a market structure shift within a set bar window. Comments state it then looks for
This indicator detects bullish and bearish engulfing candlestick patterns on the main price chart based on configurable bar fullness and height filters. It identifies specific pattern variations, including 3-Strike reversals and 180-degree turnarounds, marking
Kalman Percentile Bands plots a volatility-adaptive Kalman mean along with three empirical percentile bands on each side of the price chart. It calculates a local-level Kalman filter as the fair value mean, normalizes price deviations by an EWMA of volatility,
This indicator plots Bollinger Bands and smoothed HAMA candles on the price chart. It builds each candle from separate moving averages of open, high, low and close, using selectable EMA, SMA or WMA lengths. A simple moving average forms the band basis, and an
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.