Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 49)

Open-source Pine scripts that show the direction of the trend or trade with it: Supertrend variants, moving-average systems, ADX and trend filters.

Pine scripts3,870
Code shown here2,160open licence
Updated in a year2,525
No repaint flag3,292

Trend: Indicators, Strategies and Libraries

jash_GGMA_Granville

by jash-git
3 stars

This indicator implements a modified Guppy Multiple Moving Average (GMMA) framework based on Granville's trading rules. It calculates and plots five Fibonacci-based exponential moving averages (3, 13, 34, 55, and 144 EMAs) directly on the price chart. When the

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of jash_GGMA_Granville

This indicator identifies and plots volumetric order blocks alongside trend strength on the price chart. It highlights recent bullish and bearish order blocks using full candles or custom length coordinates, displaying internal buy and sell activity, mid-lines

Indicator v5 SMC / ICT / price actionVolume

Alpy Kazan

by avatar-lavventura
2 stars

This strategy tracks market direction using an ATR-based trailing envelope similar to Supertrend, combined with Bollinger Bands, Keltner Channels, and momentum filters. Long and short entry signals trigger on trend direction shifts within a specified backtest

Strategy v4 TrendVolatility & bands
Updated 7 months ago · None stated GitHub repository of Alpy Kazan

Trend Catcher Strategy

by wynnforthework
2 stars

This strategy identifies trending breakouts by comparing total candle ranges to the overall high-low channel over a set period alongside a Simple Moving Average. Long trades enter when the range efficiency ratio crosses above a threshold while the SMA rises, w

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trend Catcher Strategy

ZigZag Channel

by WISEPLAT
2 stars

Calculates ZigZag swing points, classifies market structure pivots into higher highs, lower highs, higher lows, and lower lows, and computes swing length ratios. It renders ZigZag lines, pivot labels, and channel bands directly on the main price chart. User se

Indicator v4 Support & resistanceTrend Repaints
Updated 3 years ago · None stated GitHub repository of ZigZag Channel

This indicator combines three analysis tools into a single chart overlay: a custom trend signal script, a ZigZag indicator, and a swing high and low pattern detector. It calculates dynamic support and resistance thresholds based on high-low price ranges and a

Indicator v4 TrendSupport & resistance Repaints
Updated 4 years ago · MIT GitHub repository of Trendsignal + Zig Zag + Swing Highs/Lows Candle Patterns
1 stars

This overlay strategy combines an AlphaTrend core with kinematic, Bayesian, and mean-reversion models, plus harmonic, classical, and candlestick pattern engines. It plots consolidation zones, volume-profile points of control, pattern lines, and forward forecas

Strategy v5 TrendCandlestick patterns Repaints
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro Extended

Dual SMA Cross

by pineforge-4pass
1 stars

A dual simple moving average crossover strategy with adjustable fast and slow lengths. When the fast average crosses above the slow one it closes any short and enters long; when it crosses below it closes any long and enters short. There is no stop loss, take

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Dual SMA Cross

DEPV2 D1 Giriş Kalitesi

by YuceSezar89
1 stars

This indicator evaluates trade entry quality across trend, momentum, volatility, and volume dimensions. It calculates momentum ROC z-scores, ATR-based volatility expansion, volume flow thresholds, and multi-timeframe Heikin Ashi alignment across multiple timef

Indicator v6 TrendOscillators & momentum
Updated 13 days ago · None stated GitHub repository of DEPV2 D1 Giriş Kalitesi

Root Mean Deviation Trail

by vedkanani123
1 stars

An overlay indicator that measures how far price sits from a central EMA, smooths the signed deviation with a selectable moving average, and normalizes it with a root mean square deviation to scale a trailing band. The multiplier shrinks when deviation is stro

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Root Mean Deviation Trail

V11 Swing Sniper Pro

by kevinesk
1 stars

V11 Swing Sniper Pro is a trend-following and swing timing indicator tailored for equity markets such as the KLSE. It overlays key moving averages directly on the price chart and evaluates setups across three structured tiers: trend quality based on Minervini

Indicator v5 TrendOscillators & momentum
Updated 4 months ago · None stated GitHub repository of V11 Swing Sniper Pro
1 stars

Corpus Exit Qty Percent is a Pine Script strategy that executes trades based on exponential moving average crossovers and manages positions with Average True Range levels. It calculates 12-period and 26-period EMAs along with a 14-period ATR. When the fast EMA

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Exit Qty Percent

v5 Combination

by webcrack4
1 stars

This indicator calculates several variants of the MACD oscillator, including Traditional, Histogram, Leader, and Source methods, and overlays the oscillator directly on the price chart. It plots shape labels for MACD and signal line crossovers, while rendering

Indicator v5 Oscillators & momentumMoving averages
Updated 9 months ago · None stated GitHub repository of v5 Combination

Simple Market Metrics v5

by turnupdigital
1 stars

An indicator in a separate pane that shows buy and sell signals with optional chop, moving average and time-of-day filters. It adds profit target lines at a tick distance, a profit wave band, background trend colouring and candle colouring. Built-in text descr

Indicator v5 TrendScalping
Updated 1 year ago · None stated GitHub repository of Simple Market Metrics v5

KST Step Trend

by amico1234
1 stars

This indicator builds a Know Sure Thing oscillator from four rate-of-change readings of close, each smoothed with a custom EMA and combined with weights of one through four. It then draws a step line in a separate pane that updates only when the oscillator mov

Indicator v4 Oscillators & momentumTrend
Updated 2 years ago · None stated GitHub repository of KST Step Trend

Cloud MM All MA

by rajatjpatel
1 stars

A two-line moving average cloud drawn on the price chart. Each line can use one of eleven types, including RMA, SMA, EMA, WMA, VWMA, SMMA, TMA, Hull, DEMA, TEMA and VWAP, with their own lengths, 30 and 74 by default. The space between the lines is filled green

Indicator v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Cloud MM All MA
330 stars

This indicator calculates the Directional Movement Index (DMI) and Average Directional Index (ADX) using configurable length and smoothing settings. Plotted in a separate pane, the ADX line changes color dynamically to green when DI+ exceeds DI- and red when D

Indicator v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of DMI Trade Zone [Alorse]

ESU2023-10M - V1

by dearvn
257 stars

ESU2023-10M - V1 is an intraday trend-reversal strategy designed for index futures contracts on the price chart. It calculates a 3-period moving average of candle highs and lows alongside specific three-bar price action patterns to detect short-term swing high

Strategy v5 TrendCandlestick patterns
Updated 7 weeks ago · None stated GitHub repository of ESU2023-10M - V1

LeMan Trend Indicator

by capissimo
114 stars

LeMan Trend Indicator calculates buy and sell values using normalized differences between current and highest/lowest highs and lows over adjustable lookback periods. It plots a zero line signal in a separate pane and normalized buy and sell lines in colors. Ma

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of LeMan Trend Indicator
106 stars

This strategy runs on the price chart and enters long when a fast simple moving average crosses above a slow one, and short on the opposite cross, while closing the other side. Entries also need ATR above a filter, a pullback check, a minimum candle-body chang

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 9:22 5 MIN 15 MIN BANKNIFTY

Trend Analysis

by dcaoyuan
55 stars

Trend Analysis plots a 20-period and a 50-period exponential moving average on the price chart. It marks bars whose close is above the faster average with a green square below the bar and marks other bars with a red square above the bar. It also calculates a 1

Indicator v6 TrendMoving averages
Updated 6 months ago · Apache-2.0 GitHub repository of Trend Analysis

Double Weighted Moving Average (DWMA) calculates a double-smoothed moving average by applying two consecutive weighted moving average passes to a chosen price source. Implemented with circular array buffers and running state accumulators, it achieves O(1) time

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Double Weighted Moving Average (DWMA)

Zen MIG Reversal

by Zen-Tim
29 stars

Zen MIG Reversal is a price action overlay indicator that identifies potential reversal setups using three-bar candlestick sequences, gap rules, and moving average filters. It checks for consecutive directional bars combined with either Al Brooks micro gaps or

Indicator v5 Candlestick patternsMoving averages
Updated 2 weeks ago · MIT GitHub repository of Zen MIG Reversal
16 stars

Implements a Donchian breakout trend-following strategy filtered by ADX trend strength. It initiates long or short positions when price breaks Donchian channel extremes and ADX exceeds a specified threshold. Positions are sized using ATR volatility with Turtle

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 28: ADX Filter

The indicator scores whether a counter-move against the dominant structure is maturing and whether price has started turning back. It plots a composite score in a separate pane from weighted context, correction maturity, and exhaustion, scaled by trigger and a

Indicator v6 TrendOscillators & momentum
Updated 3 days ago · MIT GitHub repository of Directional Probability Engine v2 [WavesUnchained]
6 stars

Wick Rejection S/R Strategy v3 identifies key support and resistance zones on the price chart using candle wick rejection percentages and liquidity sweeps. It evaluates market structure changes, zone retests, and sweeps to assign confidence scores to trading s

Strategy v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of Wick Rejection S/R Strategy v3

Diego's Strategy

by jerryinyang
5 stars

Diego's Strategy draws confirmed swing pivots on the price chart and connects them with dashed lines when the price move exceeds an ATR-based deviation threshold. It can plot Fibonacci retracement levels and use a chosen zone for entries, with separate Fibonac

Strategy v4 Support & resistanceTrend
Updated 2 years ago · None stated GitHub repository of Diego's Strategy

This short-only trading strategy combines exponential moving averages across daily timeframes with Bollinger Band squeeze logic. It evaluates long-term trend conditions or volatility squeeze setups to trigger short entries. Position management includes customi

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of EMAs + BB Squeeze + Trend Short Strategy
4 stars

The Fakeout Filter indicator calculates a four-layer signal quality score ranging from 0 to 4 to evaluate trade setups. It assesses four conditions: volume expansion above a moving average multiple, alignment with a higher timeframe EMA trend, price move excee

Indicator v6 TrendVolume Repaints
Updated 2 months ago · MIT GitHub repository of Fakeout Filter [trugurpala]
3 stars

This overlay indicator plots Parabolic SAR circles on the price chart and marks direction flips with optional start-point circles and Buy or Sell labels. Direction is long when SAR is below close and short when it is above. Alerts fire on a direction change an

Indicator v5 TrendScreeners & dashboards
Updated 2 days ago · None stated GitHub repository of Parabolic Sat Tarama Kripto

jash_GGMA_Granville

by jash-git
3 stars

jash_GGMA_Granville plots five exponential moving averages on the price chart using Fibonacci lengths 3, 13, 34, 55 and 144. It marks a reset when the shortest average crosses the 55-period average and the close is on the matching side of the short average. Co

Indicator v5 TrendMoving averages
Updated 4 weeks ago · None stated GitHub repository of jash_GGMA_Granville

ALGOX

by IAMATOMIC001
3 stars

ALGOX is a trend-following strategy combining Heikin-Ashi price feeds, ATR-based Supertrend bands, moving average ribbons, and RSI filters. It generates long and short entries when price aligns across multi-timeframe moving averages and RSI thresholds, managin

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of ALGOX

MasterAlgo

by TamTH-Dev
2 stars

MasterAlgo is an overlay indicator that combines Ichimoku Kinko Hyo, session range highlights, and volume-based candle coloring into a single tool. It plots standard Ichimoku components—including Tenkan-Sen, Kijun-Sen, Chikou Span, and Kumo Cloud—and highlight

Indicator v5 Sessions & timeVolume
Updated 6 weeks ago · None stated GitHub repository of MasterAlgo

Alpy Kazan2

by avatar-lavventura
2 stars

This strategy detects momentum shifts using the WaveTrend oscillator where wt1 crosses above wt2 for long entries and below for shorts. Fractal patterns confirm reversals with upFractal and downFractal signals based on high and low price swings over multiple b

Strategy v4 Oscillators & momentumBreakout Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Kazan2

XO_macd

by wynnforthework
2 stars

XO_macd is an overlay strategy combining exponential moving average crossovers with MACD calculations. It tracks fast, slow, and consolidated bias EMAs to identify trend changes, coloring price bars and plotting Bull or Bear triangle shapes when conditions tri

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of XO_macd

This indicator plots a multi-timeframe ZigZag pattern alongside Fibonacci retracement levels directly on the price chart. It identifies swing highs and swing lows across a user-defined timeframe and period, storing recent swing coordinates in an array. From th

Indicator v4 Support & resistanceTrend Repaints
Updated 3 years ago · None stated GitHub repository of ZigZag Multi Time Frame with Fibonacci Retracement
2 stars

This strategy identifies market direction by combining a TrendSignal breakout algorithm with a Zig Zag swing overlay. It calculates dynamic price bands over a period to determine trend flips, plotting triangle shapes directly on the price chart for buy and sel

Strategy v4 TrendSupport & resistance
Updated 4 years ago · MIT GitHub repository of Trendsignal + Zig Zag Strategy

JAT+BSM Pro v13

by majixai
1 stars

A strategy that combines an AlphaTrend style volatility core with a MACD condition, higher-timeframe background, three consolidation layers with volume profile buckets, candlestick and macro pattern labels, and a forecast with Bayesian lookback. Cross-asset sy

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13

DEPV2 DEBUG ALL

by YuceSezar89
1 stars

DEPV2 DEBUG ALL evaluates multi-asset market dynamics across up to 20 cryptocurrency symbols using four distinct analytical dimensions: trend, momentum, volatility, and volume. It computes and displays diagnostic signal outputs in a separate pane, allowing tra

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG ALL

Smart Money Volume Tools

by vedkanani123
1 stars

A separate-pane volume indicator that combines fast and slow EMAs of price, a volume average and a lower-timeframe volume read, normalized with an adjustable steepness value. A signal type setting chooses between a trailing style and other readings, and the ou

Indicator v6 VolumeTrend Repaints
Updated 2 months ago · None stated GitHub repository of Smart Money Volume Tools

V12 Swing Sniper Pro

by kevinesk
1 stars

V12 Swing Sniper Pro is a swing trading indicator for Bursa Malaysia stocks. It layers macro and sector filters atop Minervini-style trend quality gates and RSI checks to validate bullish setups. The script fires buy signals when coiling, pullback proximity, b

Indicator v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of V12 Swing Sniper Pro
1 stars

This strategy plots on the price chart and enters long when a 10-period exponential moving average crosses above a 30-period one, and short on the opposite cross. Stop distance is the 10-period simple moving average of the high-low range. Each entry places a s

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Exit Stop Limit

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