Pine Library · 3,064 open-source scripts

Free Moving Average Pine Scripts (page 52)

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

3 stars

The Grid Bot Simulator strategy models automated grid trading directly on the price chart. It divides a user-specified price channel between upper and lower bounds into equal grid intervals. Depending on the chosen market direction filter, the strategy execute

Strategy v5 Support & resistanceMoving averages
Updated 5 months ago · None stated GitHub repository of Grid Bot Simulator
1 stars

This Pine Script strategy overlays two exponential moving averages on the price chart. It generates buy signals when the fast EMA crosses above the slow EMA and the tick counter is divisible by the step value. It generates sell signals on the opposite cross un

Strategy v6 Oscillators & momentumMoving averages Repaints
Updated 7 days ago · Apache-2.0 GitHub repository of PF kanuck-probe-02-calc-on-every-tick
1 stars

TN Sentiment Macro Sovereign is a trend-following strategy that combines technical moving average crossovers with external macro sentiment data. It calculates 12-period and 26-period Exponential Moving Averages alongside a smoothed sentiment metric fetched via

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of TN Sentiment Macro Sovereign
1 stars

A Pine v4 strategy that plots a 41-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 XLMBTC EMA Cross Strategy
947 stars

Moving Average Channel plots separate simple moving averages for upper and lower bands on the price chart. It fills the space between bands with semi-transparent color and colors bars green above the upper band, red below the lower band, or gray in between. Us

Indicator v4 Moving averagesSupport & resistance
Updated 12 days ago · GPL-3.0 GitHub repository of Moving Average Channel
106 stars

This overlay strategy plots a short Bollinger Band and enters long when the close crosses above the lower band while a 14-period SMA is above a 42-period SMA. It enters short when the close crosses below that lower band while the faster SMA is below the slower

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Best TradingView Strategy
65 stars

This overlay indicator shows how a value computed inside a function can be read outside it. A one-element float array stores the current average of high, low, close, and the previous average, falling back to close when that average is missing. The function the

Indicator v4 Moving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Debugging from inside functions
13 stars

This strategy plots a trend ribbon and colored background on the price chart using moving averages calculated across price highs and lows. It generates trade signals to automate orders through Zignaly webhooks or email alerts. Users can configure the moving av

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon

Predictive Moving Average Convergence Divergence - Ryder calculates a classic MACD oscillator with customizable fast, slow, and signal lengths. In addition to plotting the standard MACD line, signal line, and histogram in a separate pane, it calculates forward

Indicator v6 Oscillators & momentumMoving averages

Heikin Ashi

by g-moe
3 stars

This indicator combines a standard relative strength index (RSI) with a Heikin Ashi moving average trend visualization in a separate pane. It calculates the RSI along with a customizable moving average overlay supporting SMA, EMA, SMMA, WMA, and VWMA types. Ad

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

Simple Moving Average (SMA)

by mushroom-men-Trading
2 stars

This script calculates and plots a Simple Moving Average on the price chart. It uses a custom function with circular buffer and running sum for efficient computation of the SMA value from the chosen source, defaulting to close prices. The primary setting allow

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Simple Moving Average (SMA)
1 stars

This strategy uses lower-timeframe data to probe numeric array reductions in Pine Script. On a 15-minute chart it fetches 15 one-minute closes using request.security_lower_tf and sums them to create a synthetic intra-bar momentum. It plots EMAs on the price ch

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF lower-tf probe 01 - float ratio15

P_ver_ema_series_length

by GammaExpansion
1 stars

This indicator plots an exponential moving average of the close price in a separate pane. The average length is not a user setting. On each bar it equals the bar index modulo ten, plus one, so the length cycles through the integers from one to ten. Because the

Indicator v6 Moving averages
Updated 7 days ago · MIT GitHub repository of P_ver_ema_series_length
1 stars

A trend indicator drawn on the price chart that plots EMA 9, 21, 50 and SMA 200 with shaded clouds between them. Buy and sell conditions are filtered by RSI thresholds, a minimum and rising ADX, relative volume, and a smart range filter that skips small or cho

Indicator v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of JL2 EMA RSI ADX Volume Smart Range
1 stars

A Pine v4 strategy that plots a 36-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 XMRBTC EMA Cross Strategy

[RS]Signal to Noise Bands

by ricardosantos79
261 stars

This overlay indicator plots a simple moving average of close as a center line and two pairs of bands around it. Width equals the standard deviation of close times the base-ten log of the ratio of the powered signal to the powered deviation. A second pair keep

Indicator v5 Volatility & bandsMoving averages
Updated 4 years ago · None stated GitHub repository of [RS]Signal to Noise Bands
114 stars

This indicator overlays two Hull Moving Average variations smoothed with an optional Kalman filter directly on the price chart. It fills the space between the two curves with dynamic trend colors and generates buy and sell signal labels when the curves cross.

Indicator v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of HMA-Kahlman Trend & Trendlines

This strategy builds upon the Big Snapper system by combining trend-following moving averages, Chaikin Volatility, and volume filtering to generate trade signals directly on the main chart. Long and short entries trigger when Snapper signals align with medium

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Big Snapper Chaiking Volatility + TP RSI
65 stars

This educational example script demonstrates how to debug custom Pine Script functions by returning intermediate internal variables alongside main outputs using tuple destructuring. It defines a custom function that calculates an instant average price from the

Indicator v4 Moving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Debugging from inside functions
13 stars

This strategy uses Noro TrendRibbon direction changes to decide long or short bias. It builds a corridor from recent high and low prices, opening a long below that corridor while longing and a short above it while shorting, with the entry tied to a percentage

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon
1 stars

A Pine v4 strategy that plots a 22-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 XRPBTC EMA Cross Strategy

Calculates John Ehlers' Detrended Synthetic Price by taking the difference between a quarter-cycle and a half-cycle exponential moving average of the input source. It includes initial warm-up coefficient adjustments to stabilize early values and plots the resu

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers Detrended Synthetic Price (DSP)
65 stars

Debugging from Inside Functions is an educational Pine Script demonstration script that illustrates how stateful calculations and custom functions operate. It defines a function that calculates an average combining the current bar high, low, close, and a persi

Indicator v4 Moving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Debugging from Inside Functions
13 stars

This strategy plots a Noro trend ribbon on the price chart and uses ribbon side changes to choose long or short bias. It builds a corridor from recent high and low prices. A long opens when price is below that corridor during a long bias, and a short opens whe

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon

SuperTrend Toolkit

by mushroom-men-Trading
2 stars

SuperTrend Toolkit plots ATR-based SuperTrend bands and direction on the price chart. It calculates upper and lower bands using a configurable source, length, and factor multiplier. Contrarian signals generate buy and sell labels with alerts when the trend rev

Indicator v6 TrendVolatility & bands
Updated 9 months ago · None stated GitHub repository of SuperTrend Toolkit
1 stars

A test strategy from a reference corpus that checks how intrabar fills behave with the bar magnifier on. It goes long when a 9-period EMA crosses above a 21-period EMA, places a protective stop halfway between the bar open and high, and closes the long when th

Strategy v6 Moving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF Magnifier Dist Probe Endpoints
1 stars

Fibo Boxes projects price and time step zones directly on the chart starting from a designated target start time. It steps through historical data using an initial bar count and step multiplier, establishing high and low bounding boxes across calculated step r

Indicator v5 Support & resistanceMoving averages
Updated 7 weeks ago · None stated GitHub repository of Fibo Boxes by BITMOON618
1 stars

A Pine v4 strategy that plots a 36-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 XTZBTC EMA Cross Strategy

Least Squares Moving Average

by TWODS-CAPITAL
37 stars

This indicator plots a least-squares moving average on the price chart. It fits a linear regression to the selected source over a chosen lookback and draws that value as a single line. The length setting changes how many bars enter the regression, the offset s

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Least Squares Moving Average
13 stars

Ruckard Noro TrendRibbon A006 is a trend-following strategy based on Noro's trend ribbon concept using moving averages. It features customizable moving average types, lengths, and price sources to generate entry and exit signals, displayed directly on the pric

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon A006

This indicator overlays moving average clouds, swing pivots, and trade signals directly on the price chart. It combines a fast and slow moving average cloud with a long-term trend filter moving average. Trade signals are triggered by moving average crossovers

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with Pivot Trendlines

Tillson T3 Moving Average (T3)

by mushroom-men-Trading
2 stars

This indicator plots the Tillson T3 moving average on the price chart. It calculates the line from six cascaded exponential moving averages whose coefficients depend on a volume factor. Users choose the source series, the smoothing period, and the volume facto

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Tillson T3 Moving Average (T3)
1 stars

This indicator projects cycle paths and Fibonacci-scaled moving averages directly on the price chart based on two user-selected reference points in time and price. It computes a base moving average period from the elapsed bars between anchors and derives a sec

Indicator v5 Moving averagesTrend
Updated 7 weeks ago · None stated GitHub repository of Fibo Wave MA - Auto Path (Plot)

TN Sovereign

by raybird
1 stars

A strategy on the price chart that scores each setup from 0 to 4 using volume against its average, higher-timeframe EMA trend, bar movement against an ATR noise level and fast versus slow EMA alignment. Long entries are linked to a fast EMA crossing above the

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

Function - IRR

by ricardosantos79
261 stars

This script demonstrates a custom Pine Script implementation of a fourth-order Infinite Impulse Response filter function based on AmiBroker AFL. It uses this mathematical framework to construct multiple smoothing calculations, including an IIR-calculated Expon

Indicator v5 Moving averages
Updated 4 years ago · None stated GitHub repository of Function - IRR
106 stars

This overlay strategy enters a long position when the relative strength index rises by more than five points, stays below 70, and a 9-period exponential moving average crosses above a 50-period average, provided the bar is on or after 1 January 2020. It closes

Strategy v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bitpanda Coinrule Template

MA Cross

by TWODS-CAPITAL
37 stars

The MA Cross indicator calculates and plots two Simple Moving Averages (SMA) directly on the main price chart. It tracks a short-term moving average and a long-term moving average to help identify trend directions and potential crossover points. When the short

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of MA Cross
13 stars

Ruckard Noro TrendRibbon E003 is a trend-following strategy that combines Noro TrendRibbon directional bias with a high and low moving average price corridor. It enters long positions when the trend ribbon is bullish and price drops below the lower corridor th

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon E003

This strategy plots dual moving average clouds and a long-term trend filter directly on the price chart alongside Heikin Ashi data. It triggers long and short entry signals using moving average alignments and pivot trendline levels, with optional filtering via

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with Pivot Trendlines 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