Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 24)

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

ZigZag OrderBlock Retracement

by ricksimpsontrading
3 stars

ZigZag OrderBlock Retracement plots multi-layer ZigZag swing structures, order blocks, breaker blocks, and optimal trade entry (OTE) zones directly on the price chart. It supports up to four distinct ZigZag depth layers to analyze both short-term and long-term

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 10 days ago · None stated GitHub repository of ZigZag OrderBlock Retracement

Supertrend

by AkashSasikumar47
3 stars

This script plots up to three ATR-based Supertrend lines directly on the price chart. Each line uses customizable ATR periods and multipliers to establish trailing support or resistance levels based on median price calculations. Green lines below price indicat

Indicator v6 TrendVolatility & bands
Updated 2 weeks ago · MIT GitHub repository of Supertrend

Overlay Scaffold

by jpantsjoha
3 stars

This indicator plots a fast and a slow exponential moving average on the price chart. It marks bullish and bearish crosses with optional labels and circle markers, and it shades the background according to which average is higher. Users can change both lengths

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Custom licence GitHub repository of Overlay Scaffold

3MA Average

by g-moe
3 stars

The 3MA Average indicator calculates three separate moving averages using customizable lengths and types, including SMA, EMA, WMA, HMA, and VWMA. It then computes the arithmetic mean of these three values to create a composite moving average plotted directly o

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of 3MA Average

Market Regime - 50W SMA

by LucasRibeiroCaetano
3 stars

This indicator classifies market conditions into Bull Market, Correction, or Bear Market regimes using a 50-week Simple Moving Average (SMA). It requests weekly timeframe data to track consecutive weekly closes relative to the 50W SMA. A Bear Market regime is

Indicator v5 TrendMoving averages
Updated 11 months ago · Custom licence GitHub repository of Market Regime - 50W SMA

BTMM Core Foundation

by jcortes254
3 stars

This indicator plots five exponential moving averages on the price chart using lengths of 5, 13, 50, 200 and 800, labeled as a food system. It scores directional bias against a user threshold, includes an optional 15-minute-and-above rule, and shows the result

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of BTMM Core Foundation

MOTO ka AnjalikaAstra

by HelloMoto069
3 stars

MOTO ka AnjalikaAstra is an overlay indicator that combines Ichimoku Cloud concepts with Average True Range volatility filters. It calculates custom Tenkan-Sen, Kijun-Sen, and Senkou Span components using ATR bands rather than standard high and low price chann

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of MOTO ka AnjalikaAstra
3 stars

Sapphire Fibonacci Strategies is a multi-mode strategy that combines Momentum Breakout, Mean Reversion, and Fibonacci Retracement models built on Fibonacci-period moving averages. It generates long and short trade signals based on price crossovers and moving a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Sapphire Fibonacci Strategies
3 stars

This strategy implements a trend-following system based on Donchian breakout channels and volatility-adjusted position sizing. It generates long entry signals when the close price breaks above the multi-bar highest high, provided an optional benchmark trend fi

Strategy v5 TrendBreakout
Updated 2 years ago · MIT GitHub repository of Turtle Trend Follow Strategy

MA & DMI

by maxits
3 stars

MA & DMI is a strategy that combines moving average crossovers with Directional Movement Index filters to identify trade setups. It calculates a slow SMA, a medium EMA, and a fast EMA alongside ADX and DI values. Trade risk management uses an ATR-based multipl

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of MA & DMI

QQQ 5min Pure Runner

by yalili8521
2 stars

This strategy identifies trend continuation and accumulation setups on 5-minute charts. It enters long or short positions based on an aligned moving average stack, rising or falling price grinds within a lookback period, and a maximum bar size threshold to avo

Strategy v6 TrendMoving averages
Updated 9 days ago · None stated GitHub repository of QQQ 5min Pure Runner

This strategy identifies trend pullback entries using MACD signal line crossovers plotted in a separate indicator pane. Long trades enter on bullish MACD crossovers below the zero line when price is above a trend EMA and ADX exceeds a minimum threshold, with r

Strategy v6 TrendOscillators & momentum
Updated 2 weeks ago · MIT GitHub repository of MACD Pullback Sniper | Trend + ADX Filtered Strategy

SMC Flow System plots smart money concepts and market structure directly on the price chart. It identifies internal and external swings, marking Break of Structure (BOS), Change of Character (CHoCH), and swing highs or lows according to customizable sensitivit

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · Custom licence GitHub repository of SMC Flow System – by Fatich.id

Chart Visualization

by danielbodnar
2 stars

A Pine Script visualization script demonstrating custom technical drawing techniques on price charts. It plots a 20-period simple moving average with dynamic color intensity derived from price momentum, marks inside and outside bar patterns using shapes, and l

Indicator v6 TrendCandlestick patterns
Updated 2 months ago · MIT GitHub repository of Chart Visualization

Alertatron-Link Demabot 2H

by danielvm-git
2 stars

This strategy calculates up to three Double Exponential Moving Averages (DEMA) to generate trading signals based on moving average crossovers and crossunders. When configured, an optional third DEMA acts as a directional trend filter. It opens positions upon c

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Alertatron-Link Demabot 2H

This indicator plots multiple moving averages including SMA10, SMA50, SMA100, SMA200, Ichimoku conversion and lead lines, and 52-week high and low levels on the price chart. It detects breakouts using volume multiplier, optional gaps, and strong candle require

Indicator v6 BreakoutMoving averages Repaints
Updated 10 months ago · MIT GitHub repository of Ede – MA + Breakout Strategie (Dynamic MAs)
2 stars

This indicator combines Qualitative Quantitative Estimation (QQE), the AK Trend Line, and Elder's Force Index (EFI) into a single separate pane tool. It calculates QQE using smoothed RSI and Wilder's ATR, computes AK Trend values with dynamic scale factors mat

Indicator v6 Oscillators & momentumVolume
Updated 11 months ago · MPL-2.0 GitHub repository of QQE + AK Trend + EFI Combined

BBW

by wynnforthework
2 stars

This strategy combines Bollinger Band Width volatility ratio calculations with a Coppock Curve momentum indicator. It calculates the ratio of standard deviation to EMA over a user-defined length, along with an EMA of that ratio. Long positions are entered when

Strategy v5 Volatility & bandsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of BBW

Trend Indicator A

by iceberg211
2 stars

Trend Indicator A plots a moving-average trend overlay on the price chart. It calculates a selectable average of close and, optionally, of high and low, then colors the lines and the area between them bullish, bearish, or neutral. The main settings choose the

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trend Indicator A

Trend Score History

by ryangaraygay
2 stars

Trend Score History calculates a composite trend metric ranging between -5 and +5 by evaluating session VWAP, EMA alignment, price-volume flow, lower-timeframe Donchian channel breakouts, and Opening Range breakouts. It plots the cumulative score as histogram

Indicator v6 TrendOscillators & momentum Repaints
Updated 1 year ago · MIT GitHub repository of Trend Score History

9day Swing

by scallywag41
2 stars

9day Swing is a TradingView indicator that overlays SMA 9, EMA 20 and SMA 200 on the price chart to identify trend direction. It plots these moving averages in red, yellow and white or gray respectively. The indicator generates buy and sell signals as green an

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of 9day Swing
2 stars

This indicator displays market trend filter information and momentum metrics in a separate pane based on the Weekend Trend Trader strategy. It evaluates a benchmark index, such as the NASDAQ 100, comparing its close price to a simple moving average to render a

Indicator v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Weekend Trend Trader Ribbon
2 stars

This indicator plots five predefined daily moving averages directly on the main price chart. It calculates a 10-period EMA, 21-period EMA, 50-period SMA, 150-period SMA, and 200-period SMA to assist with trend identification and dynamic support or resistance t

Indicator v5 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of Daily MA's [JR-Academy]

Multi Level Zigzag

by WISEPLAT
2 stars

This indicator calculates and plots up to four hierarchical ZigZag levels directly on the price chart to map swings and market structure across different sensitivities. Each level can be toggled and configured with custom lengths and colors. Settings allow use

Indicator v5 Support & resistanceTrend Repaints
Updated 3 years ago · None stated GitHub repository of Multi Level Zigzag
2 stars

This indicator identifies Quasimodo Level (QML) market structure patterns on the price chart using a ZigZag algorithm. It includes optional directional trend filtering using dual exponential moving averages, an ADX threshold filter to verify trend strength, an

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 3 years ago · None stated GitHub repository of QML Indicator Only w/filters [upslidedown]

Supertrend

by ctkqiang
2 stars

This script calculates a custom Supertrend line on the price chart to identify trend direction and dynamic support or resistance levels. It computes upper and lower trailing bands using the Average True Range (ATR) based on a configurable multiplier and period

Indicator v4 TrendVolatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of Supertrend

Simple Indicator

by storm0611
2 stars

This indicator plots four exponential moving averages directly on the main price chart. It calculates EMAs using hardcoded lengths of 20, 50, 100, and 200 bars applied to the closing price, styled with distinct colors and increasing line widths. It also includ

Indicator v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Simple Indicator

Impulse-Orders

by DaniilOkrug
2 stars

The Impulse-Orders strategy detects impulse up and down movements on the price chart by checking for specific candle patterns relative to Fibonacci retracement levels. It tracks impulse starts and ends, confirming when the move reaches a user-defined percentag

Strategy v5 Candlestick patternsSupport & resistance
Updated 4 years ago · MIT GitHub repository of Impulse-Orders

RSI powerzone

by kat3samsin
2 stars

The RSI powerzone strategy plots the 4-period RSI in a separate pane along with horizontal levels at 30 and 55. It identifies an uptrend using a series of simple moving averages on the close price. The strategy enters long positions when the uptrend condition

Strategy v4 Oscillators & momentumMoving averages
Updated 5 years ago · MIT GitHub repository of RSI powerzone
1 stars

A long-or-cash strategy using the same entry rule as a plain trend filter: the close must be above a 100-bar simple moving average and above the close 20 bars earlier. Position size scales with momentum strength, from a minimum fraction of equity to a maximum

Strategy v6 TrendOscillators & momentum

Ghost Alpha

by mphinance
1 stars

A price-chart overlay that blends a Hull moving average band, an optional higher timeframe Hull, a TRAMA line, Keltner bands, 50 and 200 SMAs and an intraday VWAP. It also covers swing structure detection with levels and supply and demand zones, a two-line Wil

Indicator v6 TrendMoving averages
Updated 3 days ago · Custom licence GitHub repository of Ghost Alpha

A SuperTrend breakout strategy for crypto perpetual futures. An auto-adapt option picks the DEMA period, ADX threshold and take-profit multiple based on whether the symbol is Bitcoin or Ethereum, or manual values can be used. Position size comes from a fixed o

Strategy v5 BreakoutTrend Repaints
Updated 4 days ago · MIT GitHub repository of ST Breakout V10.0 Multi-Asset Strategy
1 stars

This indicator plots fast and slow EMAs on the price chart with a fill between them to show trend direction. It ranks ATR volatility over the past 200 bars to define three regimes: quiet (trade only), wild (high volatility), and neutral. The background shades

Indicator v6 TrendVolatility & bands
Updated 4 days ago · MPL-2.0 GitHub repository of Complete System: Regime + Edge + Risk

J14-E1 Adv

by moonyroy
1 stars

The j14-E1 adv indicator plots a dynamic ZigZag on the price chart by detecting swing highs and lows. It draws orange and aqua trend lines marking pivot points, with boxes showing candle shadows and bodies. The script identifies potential trend shifts via CHoC

Indicator v6 TrendSupport & resistance Repaints
Updated 6 days ago · None stated GitHub repository of J14-E1 Adv

ATR Trailing Stop

by pineforge-4pass
1 stars

This Pine Script strategy generates entry signals from an EMA of length 20 crossed by close price. Long crossover enters long position and sets initial trailing stop below close using ATR multiplied by 2.0. Short crossover enters short and sets trailing stop a

Strategy v6 TrendVolatility & bands
Updated 7 days ago · Apache-2.0 GitHub repository of ATR Trailing Stop
1 stars

A price-chart indicator that shows two tables. A focus panel runs a trend-flip and oscillator engine on one chosen futures contract across five timeframes and reports an alignment score. A board runs the same engine across a list of futures markets on one scan

Indicator v6 Screeners & dashboardsTrend
Updated 8 days ago · Custom licence GitHub repository of Phantom Flow Futures Screener

A Pine v6 strategy for crypto charts that evaluates RSI, a trend moving average with higher timeframe filter, Fibonacci Bollinger Bands and Ichimoku in a fixed order. Each indicator can be switched on for visuals, for backtesting or both, and entry and exit si

Strategy v6 Oscillators & momentumTrend
Updated 12 days ago · MIT GitHub repository of Crypto TA Pro Phase 1 Weighted Indicators

DEPV2 A2 TREND

by YuceSezar89
1 stars

The indicator computes the normalized deviation of close price from HLC3 SMA using ATR for trend measurement. It plots deviation Z-score, trend state (1 bullish, -1 bearish, 0 neutral via state machine), and strength level (0-2) in a separate pane. Settings ad

Indicator v6 TrendMoving averages
Updated 13 days ago · None stated GitHub repository of DEPV2 A2 TREND

Master Trading Strategy

by MuhammadMuhamid
1 stars

A heavily modular long strategy for crypto spot pairs in which every filter and exit has its own switch. Entries centre on pivot-based support and resistance across several timeframes with retest confirmation, plus optional moving average, volume, ATR spike, s

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of Master Trading Strategy
1 stars

Plots long and short signals on the price chart from a smoothed Hull moving average of price change, firing when momentum crosses its value two bars earlier. Each signal projects five target levels spaced by an average candle range, and a simulated position us

Indicator v6 Oscillators & momentumTrend Repaints
Updated 2 weeks ago · None stated GitHub repository of Momentum Shift Positions

A gold-oriented overlay that combines 21, 50 and 200 EMAs, an RSI filter, MACD confirmation and stochastic RSI to draw buy and sell arrows on the price chart. Stop loss and two take-profit lines are placed from ATR multiples, and daily pivot levels can be show

Indicator v5 TrendOscillators & momentum
Updated 3 weeks ago · None stated GitHub repository of neXQan XAUUSD Gold Indicator Lines

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