Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 17)

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

1 stars

A Pine v6 strategy variant for 15-minute Bitcoin perpetual charts that trades RSI momentum breakouts. Entries use RSI levels with a gap, plus candle color, EMA 200, ATR and body-size filters, and an optional pullback re-entry. This version sets a tighter fixed

Strategy v6 Oscillators & momentumTrend
Updated 4 months ago · None stated GitHub repository of BTC RSI Momentum v21
1 stars

This overlay indicator maps smart-money market structure on the price chart. It labels swing points as higher highs, higher lows, lower highs, and lower lows, and draws Break of Structure and Change of Character lines when structure breaks. A multi-timeframe t

Indicator v6 SMC / ICT / price actionScreeners & dashboards
Updated 4 months ago · None stated GitHub repository of SMC Market Structure + MTF

Simple Options Bias Strategy

by SankarSrinivasan1
1 stars

This strategy determines directional market bias for options traders by combining a 20-period Exponential Moving Average (EMA) and a 14-period Relative Strength Index (RSI). It enters a long position when the closing price is above the 20 EMA and RSI is below

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · GPL-3.0 GitHub repository of Simple Options Bias Strategy

Unified Trade Signal

by ashishgkwd
1 stars

Unified Trade Signal is an overlay indicator that prints a buy or sell label only when several conditions agree on the same bar. For a buy, price must break above a Nadaraya-Watson envelope upper band, the fast EMA must be above the slow EMA, an adaptive trend

Indicator v6 TrendOscillators & momentum Repaints
Updated 4 months ago · None stated GitHub repository of Unified Trade Signal
1 stars

An indicator for the price chart that looks for pullbacks inside a trend. It uses ADX and directional indicators with a rising-ADX check to confirm trend and direction, then measures the distance from the recent swing high or low in ATR units. Optional filters

Indicator v5 TrendVolatility & bands
Updated 4 months ago · None stated GitHub repository of Trend Scanner (ATR Pullback)
1 stars

This Pine Script strategy tests type casting and mathematical operations using logarithmic scaling on price deviation. It calculates a simple moving average over a user-defined length, computes the absolute spread between price and the average, and scales it u

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Cast And Log10 Support
1 stars

This overlay indicator fits a quadratic regression parabola to recent source prices to show a curved trend, its slope, and its curvature. Hyperbola bands use ATR and a curve-sensitivity multiplier so they widen when the trend bends and tighten when it is strai

Indicator v6 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Parabola & Hyperbola Structure

DST HMM v9 XAUUSD

by Javas128282
1 stars

DST HMM v9 XAUUSD classifies the market into hidden regimes such as Sideways, Bull and Bear using a hidden Markov model retrained on a rolling window with Baum-Welch iterations. It adds a Kalman filter line with confidence bands and an optional multi-bar Kalma

Indicator v6 AI / machine learningTrend
Updated 5 months ago · None stated GitHub repository of DST HMM v9 XAUUSD
1 stars

A strategy version of a crypto signal indicator that goes long or short when a 50 and 200 EMA trend, RSI and fast MACD ranges, ATR percent, volume ratio and ADX all pass a minimum entry score. An optional macro filter checks Bitcoin, dominance, TOTAL2 and TOTA

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Micro Atomic Crypto Alpha Strategy

Trend + Scalp + Stop Signals

by Ershubhambhagat
1 stars

A price-chart indicator that shows VWAP, a central pivot range, three EMAs, Supertrend and previous-day levels, then scores conditions to print trend signals, scalp signals and stop or exit signals. Minimum score thresholds for trend and scalp signals are adju

Indicator v5 TrendScalping
Updated 5 months ago · None stated GitHub repository of Trend + Scalp + Stop Signals

AlphaTrend Pro

by shubhamtaywade82
1 stars

A multi-layer strategy for crypto futures that groups indicators into trend, momentum and volume layers. Trend uses Supertrend, KAMA and Ichimoku, momentum uses MACD, Stochastic RSI and PZO, and volume uses relative volume. A first-come-first-served queue lets

Strategy v6 TrendOscillators & momentum Repaints Archived
Updated 5 months ago · None stated GitHub repository of AlphaTrend Pro
1 stars

This indicator plots the Parabolic Stop and Reverse (SAR) on the price chart with customizable acceleration start, increment, and maximum values. It highlights trend reversals where the price crosses the SAR line, marking flip points with directional triangula

Indicator v6 TrendScreeners & dashboards
Updated 5 months ago · None stated GitHub repository of SAR with tweakable aparameter

BVortex Multi

by Alberto082544
1 stars

The BVortex Multi strategy combines a Vortex indicator with an ADX filter to detect trend changes. It calculates Vortex values scaled for stronger signals and confirms trend direction using swing pivots on high and low prices. Buy triggers occur when Vortex cr

Strategy v6 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of BVortex Multi

MC-Predict HullMA v2

by ebarkinkaras-lang
1 stars

A price-chart overlay that plots a Hull moving average with a set of EMAs, SuperTrend and Bollinger Bands, and scores the market by weighting trend, momentum, volatility, volume, support and resistance, and a k-nearest-neighbours estimate. The nearest-neighbou

Indicator v5 AI / machine learningTrend
Updated 5 months ago · None stated GitHub repository of MC-Predict HullMA v2

BWC Momentum v5

by tonimaxx
1 stars

A long-only strategy for stocks that enters when the close is above both a 50-period and a 200-period SMA, RSI is above a set minimum, volume exceeds a multiple of its average, price has stayed above the 50 SMA for several bars and dollar volume passes a floor

Strategy v5 TrendOscillators & momentum
Updated 6 months ago · Custom licence GitHub repository of BWC Momentum v5

FPL Cheatcode

by onlyspx
1 stars

This indicator draws up to six configurable moving averages on the price chart. Each has its own type (SMA, EMA, SMMA, WMA or VWMA), length, source, offset and optional higher timeframe. Defaults are 50 and 200 averages on the chart timeframe plus hourly 21 EM

Indicator v6 Moving averagesTrend
Updated 6 months ago · None stated GitHub repository of FPL Cheatcode

PA Strategy Backtest

by Chovy-King
1 stars

A strategy version of a price-action signal set with eleven switchable entry setups, such as trend breakout, trend pullback, false breakout of a key level, range edge, breakout retest and double top or bottom. Levels come from clustered swing points, with 20,

Strategy v6 Support & resistanceTrend
Updated 6 months ago · None stated GitHub repository of PA Strategy Backtest

Beginner EMA + RSI + ATR

by Sandesh30-cloud
1 stars

Beginner EMA + RSI + ATR is a long-only trend-following strategy plotted directly on the price chart. It identifies an uptrend when the 50-period EMA trades above the 200-period EMA, triggering long entries when the 14-period RSI crosses above the 50 centerlin

Strategy v5 TrendOscillators & momentum
Updated 6 months ago · None stated GitHub repository of Beginner EMA + RSI + ATR

Algo2.0

by dtheran1
1 stars

A combined overlay for the price chart that joins an ATR Trend module with a smart money concepts module. The trend line is built from an ATR band with ten smoothing types, a fast trend, an optional smoothed range channel and buy and sell markers on trend flip

Indicator v6 TrendSMC / ICT / price action Repaints
Updated 6 months ago · None stated GitHub repository of Algo2.0

NQ SSR Strategy

by CathalF
1 stars

The NQ SSR Strategy is a trading strategy for Nasdaq futures contracts. It generates buy and sell signals based on multi-timeframe pivot high and low detection across 4H, 1H and 5M timeframes. Signals are plotted directly on the price chart as entry and exit p

Strategy v6 TrendSupport & resistance
Updated 7 months ago · None stated GitHub repository of NQ SSR Strategy

WirezardStrategyTester

by udhansingh
1 stars

A stock-oriented strategy that scores each bar from minus 100 to plus 100 by combining RSI, an impulse MACD, VIDYA, volume spikes, a spread and wick proxy for market depth, and sector ETF strength against a benchmark. Buy entries need the score above a thresho

Strategy v6 Oscillators & momentumTrend Repaints
Updated 7 months ago · MIT GitHub repository of WirezardStrategyTester

BTC ATH Golden Cycle

by ymlee1104
1 stars

BTC ATH Golden Cycle is a long-only position trading strategy designed for Bitcoin. It tracks price drawdowns relative to All-Time High (ATH) levels to execute a five-stage dollar-cost averaging entry schedule. As prices decline by configurable percentage tier

Strategy v6 Support & resistanceMoving averages
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle
1 stars

An indicator for one-hour charts that plots a Donchian channel from the highest high and lowest low over a set number of bars. A close beyond the prior channel edge marks a long or short breakout, and an ATR-multiple trailing stop line tracks the exit. An opti

Indicator v6 BreakoutTrend
Updated 7 months ago · None stated GitHub repository of V18 Donchian Channel Breakout
1 stars

This strategy implements the classic Turtle Trading System using Donchian channels. It enters long when the price breaks above the upper entry channel and short when it breaks below the lower channel, with an optional filter that skips signals following a winn

Strategy v5 BreakoutTrend
Updated 8 months ago · None stated GitHub repository of Donchian Channel - Turtle Trading

MACD Trend Filter

by itstherax
1 stars

Draws a standard 12, 26, 9 MACD with signal line and histogram in a separate pane, together with a 200-period EMA used as a trend filter. A buy label appears when MACD crosses above its signal while price is above the EMA, and a sell label when it crosses belo

Indicator v5 Oscillators & momentumTrend
Updated 8 months ago · None stated GitHub repository of MACD Trend Filter
1 stars

Buy/Sell Signals - Multi-Condition combines the Relative Strength Index (RSI) with fast and slow Exponential Moving Averages (EMA) to identify trend pullback opportunities. It displays buy signals when the RSI drops below an oversold threshold during an establ

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Buy/Sell Signals - Multi-Condition

ARC EngulfingAlgo

by Tradehook-org
1 stars

A Pine v5 strategy that trades engulfing candle patterns on the price chart. A pattern needs the current body to cover a set percentage of the previous body, with options for opposite color, doji handling and a maximum previous body size in ATR. Optional confi

Strategy v5 Candlestick patternsTrend
Updated 8 months ago · None stated GitHub repository of ARC EngulfingAlgo

Lifecycle Example

by propuchon
1 stars

This strategy demonstrates a training, testing, and deployment lifecycle for Pine Script strategies. It calculates a simple moving average (SMA 20) and generates buy signals on crossover. The runMode input selects between Training, Testing, and Deployment. In

Strategy v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Lifecycle Example
1 stars

A long-only strategy generated from the TrendLab research project, drawn on the price chart. It calculates the Parabolic SAR with acceleration start 0.01, step 0.08 and maximum 0.37. It buys when the close crosses above the SAR and closes the position when the

Strategy v6 Trend
Updated 9 months ago · MIT GitHub repository of Parabolic SAR 0.01/0.08/0.37

Calculates and plots various classical chart patterns directly on the price chart using swing high and low detection libraries. It automatically identifies formations such as double and triple tops or bottoms, head and shoulders, flags, pennants, wedges, Ellio

Indicator v5 Support & resistanceBreakout Repaints
Updated 9 months ago · None stated GitHub repository of All Chart Patterns [theEccentricTrader]

Multi-Timeframe Trend Detector

by IamTamheedNazir
1 stars

A Pine v5 indicator that compares the close with a 50-period EMA on five timeframes, by default 5 minute, 15 minute, 1 hour, 4 hour and daily, and scores each as bullish, bearish or neutral. The scores are summed into an overall bias from strong bearish to str

Indicator v5 TrendScreeners & dashboards
Updated 9 months ago · Custom licence GitHub repository of Multi-Timeframe Trend Detector
1 stars

A chart-overlay indicator that combines a volatility cloud with supply and demand zones. The cloud uses a selectable moving average with ATR bands and turns bullish or bearish, producing buy and sell labels when it flips, optionally filtered by volume and RSI.

Indicator v6 TrendSupport & resistance
Updated 9 months ago · None stated GitHub repository of Apex Trend & Liquidity Master

Viprasol Elite Flow Pro

by Thedev-Lars
1 stars

An overlay that draws a volatility-based trend cloud with three speed modes, detects premium and discount zones, and marks rejections at those zones. A volume filter flags spikes and climax bars, and signals can be set to aggressive, balanced or conservative w

Indicator v6 TrendSupport & resistance
Updated 11 months ago · None stated GitHub repository of Viprasol Elite Flow Pro
1 stars

A price-chart trend indicator that smooths the chosen source with a multi-order Kalman filter, builds ATR-based upper and lower bands around it, smooths the bands exponentially, and flips the trend when price crosses a band. An optional multi-timeframe switch

Indicator v6 TrendVolatility & bands
Updated 11 months ago · MIT GitHub repository of Kalman Exponential SuperTrend MTF

ichiV1 Ichimoku Trend

by ChiChasesCheese
1 stars

A long-only strategy ported from a Freqtrade bot, aimed at five-minute crypto charts. It combines an Ichimoku-style cloud with a ladder of EMA pairs and a fan magnitude ratio that must keep growing, so it only enters in strong trends. Exits come from a time-st

Strategy v5 Trend
Updated 12 months ago · None stated GitHub repository of ichiV1 Ichimoku Trend

EMA Fibonacci Trend

by ktg0413
1 stars

The EMA Fibonacci Trend indicator calculates and plots dynamic Fibonacci retracement and extension levels based on a 200-period Exponential Moving Average (EMA). It measures volatility using a 14-period Average True Range (ATR) relative to price, establishing

Indicator v6 Support & resistanceMoving averages
Updated 1 year ago · None stated GitHub repository of EMA Fibonacci Trend
1 stars

This strategy identifies trend re-entries by combining volatility spikes, short-term pullbacks, and moving average crossovers. It detects strong bar expansions using an ATR multiplier, checks a lookback window for pullbacks, and triggers entries when price cro

Strategy v5 TrendVolatility & bands
Updated 1 year ago · MIT GitHub repository of ATR Retracement EMA Strategy

Smoothed Heiken Ashi

by turnupdigital
1 stars

An indicator that draws smoothed Heiken Ashi candles on the price chart. Prices are smoothed with a selectable moving average type and length before the Heiken Ashi calculation and again afterwards, using an imported library of average types. Signal badges mar

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Smoothed Heiken Ashi

A price-chart overlay that combines several tools. It draws a Nadaraya-Watson kernel envelope with a repainting smoothing option, a Hull moving average band in three variants that can optionally come from a higher timeframe, and an ATR trailing stop in the sty

Indicator v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of UT Bot, Nadaraya-Watson, Hull Suite and Reversal Combo

ezTrend Lines

by ezPappi
1 stars

ezTrend Lines calculates selected oscillator indicators, including RSI, CCI, Momentum, OBV, or MACD, and displays them in a separate pane. It identifies pivot highs and pivot lows on the chosen oscillator line using configurable pivot periods and checks up to

Indicator v6 Oscillators & momentumSupport & resistance
Updated 1 year ago · GPL-3.0 GitHub repository of ezTrend Lines
1 stars

This strategy uses Bill Williams indicators including the Alligator (jaw, teeth, lips with RMA smoothing and offsets), Awesome Oscillator, and Accelerator Oscillator. It also plots fractals on the chart. Long entries occur when the Alligator is aligned bullish

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Bill Williams NTD 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