Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 34)

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

4 stars

This indicator plots a Chandelier Exit trailing stop on the price chart. It sets a long stop from the highest high over the ATR length minus an ATR multiple, and a short stop from the lowest low plus that multiple. Each stop only moves in the favorable directi

Indicator v6 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of Chandelier Exit [trugurpala]
4 stars

This strategy overlays directly on the price chart to identify pullback buying opportunities during established bullish moves. It checks whether price gained by a specified percentage over an earlier window and subsequently pulled back by a minimum threshold o

Strategy v5 TrendMean reversion
Updated 5 months ago · None stated GitHub repository of Buy the Dip in an Uptrend

UT Bot Alerts

by ShabbirHasan1
4 stars

UT Bot Alerts combines an ATR-based trailing stop mechanism with selectable channel bands, including Bollinger Bands, Keltner Channels, and standard or pivot-based Donchian Channels. Signals are driven by crossovers between price and the adaptive ATR trailing

Strategy v4 TrendVolatility & bands
Updated 1 year ago · Custom licence GitHub repository of UT Bot Alerts
4 stars

This indicator calculates rolling quartiles and interquartile ranges (IQR) across a customizable lookback window, plotting a statistical box plot offset to the right of the chart. It identifies the 25th, 50th (median), and 75th percentiles along with standard

Indicator v5 Volatility & bandsSupport & resistance
Updated 3 years ago · None stated GitHub repository of Quartiles with Box Plot [KL]

Stats Table

by degenview
3 stars

Displays a statistical summary table pinned to the top right of the price chart. It calculates key metrics including ATR percentage relative to price, high-low range percentage over a configurable bar count, relative volume compared to its simple moving averag

Indicator v6 Screeners & dashboardsTrend
Updated 2 days ago · GPL-3.0 GitHub repository of Stats Table

Alert System with Trading Dashboard calculates two exponential moving averages on the chart while tracking fast and slow EMA crossover states across four configurable timeframes. It displays a visual table on the price chart showing the directional bias for ea

Indicator v5 Screeners & dashboardsMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Alert System with Trading Dashboard

BTMM HTF Bias System

by jcortes254
3 stars

BTMM HTF Bias System analyzes trend alignment and higher-timeframe directional bias using exponential moving averages across multiple timeframes, such as 1-hour, 4-hour, daily, and weekly charts. Based on Steve Mauro's Beat The Market Maker methodology, it cal

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of BTMM HTF Bias System

DX Strat

by jawauntb
3 stars

DX Strat is an intraday directional trading strategy that combines a composite RSI momentum calculation, moving averages, Keltner Channels, and VWAP to execute trades. It initiates long positions when composite momentum RSI crosses above 77 and short positions

Strategy v5 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of DX Strat

Currency Strength Chart

by itmakesyousick
3 stars

Calculates and displays the relative currency strength of major currencies, including EUR, USD, JPY, GBP, CHF, AUD, and CAD. It plots strength lines and optional histograms in a separate pane to highlight directional momentum across Forex pairs. Users can adju

Indicator v5 Oscillators & momentumTrend
Updated 4 years ago · None stated GitHub repository of Currency Strength Chart

SUSHI 2H ZEGUELA DEMABOT

by danielvm-git
2 stars

This overlay strategy plots up to three double exponential moving averages of a chosen source on the price chart. With the default lengths, it treats a crossover of the first and second DEMA as a long signal and a crossunder as a short signal; a third DEMA can

Strategy v4 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of SUSHI 2H ZEGUELA DEMABOT

Lakshmi Strategy v2

by voletiramu
2 stars

The Lakshmi Strategy v2 automatically computes daily price zones from previous candle bodies using body width and wick factors then overlays them on the chart. It generates long signals when VPA close positions confirm at zone levels with fallback stop losses

Strategy v6 TrendSupport & resistance
Updated 6 months ago · None stated GitHub repository of Lakshmi Strategy v2

Volatility Stop

by avatar-lavventura
2 stars

The Volatility Stop indicator calculates a dynamic trailing stop line based on the Average True Range. It tracks ongoing price extremes and adjusts the stop level using a specified ATR multiplier and lookback length. The script evaluates trend direction change

Indicator v5 Volatility & bandsTrend
Updated 7 months ago · None stated GitHub repository of Volatility Stop

This strategy generates long entry signals by combining a Donchian Channel breakout with a moving average trend filter, volume confirmation, and a macro volatility regime gate based on CBOE VIX and VIX3M ratios. It enters long positions when prices break above

Strategy v5 TrendBreakout
Updated 10 months ago · MIT GitHub repository of Trend-Breakout System mit VIX Heatmap Gate

FRAMA & CPMA Strategy [CSM]

by wynnforthework
2 stars

The FRAMA & CPMA Strategy overlay script combines a Fractal Adaptive Moving Average (FRAMA) and a custom CPMA indicator imported from an external library. It generates long and short trading signals when price crosses above or below either moving average line.

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of FRAMA & CPMA Strategy [CSM]

MA Based Trend

by ryangaraygay
2 stars

The script calculates three moving averages with configurable types, lengths, and price sources. It evaluates trend alignment by comparing the relative order of fast, medium, and slow averages across four market states. In a separate pane, it plots color-coded

Indicator v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of MA Based Trend

Custom Ichimoku Alerts [UT]

by theupslidedown
2 stars

This custom Ichimoku indicator plots Tenkan-Sen, Kijun-Sen, Chikou-Span, Senkou-Span A, Senkou-Span B and the cloud fill on the price chart. It generates bullish signals when Tenkan crosses Kijun upward, Chikou is positive, price is above the cloud, and option

Indicator v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Custom Ichimoku Alerts [UT]

Swing 4h Majors

by nvolpe2007-cell
1 stars

A long-only strategy for large crypto pairs on 4-hour bars, forced to 4-hour data by default. An entry needs price above a 50-bar EMA with the 20-bar EMA above it, rate of change above a minimum, RSI crossing up through 50 but below an overbought limit, and an

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of Swing 4h Majors

EMA Trend Signals

by jayadevrana
1 stars

This indicator calculates fast (9-period), slow (21-period), and trend (200-period) Exponential Moving Averages (EMAs) directly on the price chart. It plots all three EMAs along with a color-coded fill between the fast and slow moving averages. BUY signals tri

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of EMA Trend Signals

Chandelier Exit

by pineforge-4pass
1 stars

This strategy calculates Chandelier Exit trailing bands using average true range (ATR) and highest high / lowest low lookback levels. It maintains a stateful direction variable that flips bullish when the close crosses above the short band level or bearish whe

Strategy v6 TrendVolatility & bands
Updated 7 days ago · Apache-2.0 GitHub repository of Chandelier Exit
1 stars

This indicator calculates dual Exponential Moving Averages alongside their slopes, normalized distance, and momentum to detect trend shifts on the price chart. It plots standard EMA crossovers while also assessing early warning conditions when EMAs approach ea

Indicator v6 TrendMoving averages
Updated 7 days ago · None stated GitHub repository of Gelişmiş EMA Trend Analizi
1 stars

A long-only strategy that buys when the MACD line crosses above zero and closes the position when it crosses back below zero. MACD fast, slow and signal lengths and the price source are adjustable. It invests the full equity per trade, includes a commission se

Strategy v6 Oscillators & momentumTrend
Updated 8 days ago · None stated GitHub repository of MACD Zero-Line Strategy Long Only
1 stars

A strategy that uses a Hull-smoothed volatility band trend engine to set direction, then enters only on a pullback into the trailing trend level followed by a reclaim candle. Settings cover minimum bars since the flip, pullback tolerance in ATR, lookback and m

Strategy v6 TrendVolatility & bands Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Adaptive Trend Pullback Continuation v1

DEPV2 A6 MTF HA GUCU

by YuceSezar89
1 stars

This indicator calculates Heikin Ashi scores for multiple multiplier timeframes relative to a signal timeframe. It computes HA power for 2x, 3x, 4x, and 6x the base timeframe (default 15 minutes) using custom HA candle logic and normalizes the close-open range

Indicator v6 TrendCandlestick patterns
Updated 13 days ago · None stated GitHub repository of DEPV2 A6 MTF HA GUCU
1 stars

A long-only crypto spot strategy that builds support and resistance zones from pivots on 5-minute, 15-minute, 1-hour and 4-hour charts and enters after price retests a support zone, within a set number of bars. Touch zones are sized by ATR or ticks, and a mini

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of SR Trend Final - Support Retest + MA R:R
1 stars

A trend-continuation indicator that draws every historical trade on the price chart. Direction comes from a 50 and 200 EMA pair, optionally confirmed by the same EMAs on a higher timeframe. An entry appears when price closes back across the fast EMA after a pu

Indicator v6 TrendMoving averages Repaints
Updated 2 weeks ago · None stated GitHub repository of Trend Pullback Sniper

Kalman Trailing Stop

by vedkanani123
1 stars

A price-chart indicator that builds a Kalman-filter baseline, optionally weighted by volume, and trails a stop at a standard-deviation distance, flipping when price penetrates it and the baseline slope agrees. A wick-and-sweep filter marks liquidity-sweep sign

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Kalman Trailing Stop
1 stars

A strategy that trades a 9 and 21 EMA crossover only in the direction of a higher-timeframe trend. The higher timeframe, daily by default, supplies an EMA and prior close from the previous completed bar, and a long needs the close above that EMA while a short

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MTF Trend Sovereign Strategy
1 stars

This strategy combines VWAP bands with a multi-factor momentum scoring system to trade trend continuations. It enters positions during pullbacks or breakouts around VWAP when momentum criteria—derived from EMAs, ROC, RSI, MACD, and ADX—reach user-defined thres

Strategy v6 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Fusion VWAP Momentum Strategy
1 stars

This indicator maps Smart Money Concepts (SMC) elements directly onto the price chart. It identifies swing highs and swing lows to track market structure (HH, HL, LH, LL), Break of Structure (BoS), and Change of Character (CHoCH) using either pivot or session

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 4 months ago · None stated GitHub repository of SMC Market Structure Indicator

EMA Crossover

by rubbermetal
1 stars

EMA Crossover plots a fast and a slow exponential moving average, fills the space between them green or red by direction, and marks each cross with a Long or Short label. A background tint appears when the gap between the averages exceeds a multiple of ATR. Op

Indicator v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of EMA Crossover
1 stars

This strategy executes long trades based on directional candle signals fetched from a custom secondary timeframe. It evaluates bullish or bearish candle alignment on the requested timeframe and enters a long position when the state turns bullish. Position sizi

Strategy v6 Trend
Updated 4 months ago · MIT GitHub repository of MTF LTF Position State

Tactical

by dtheran1
1 stars

A trend and signal overlay for the price chart. It draws a trend line from a moving average, 45 periods by default and selectable as SMA, EMA, WMA, HMA or VWMA, with colour by direction and an optional fill. Long and short signals are labelled progressively as

Indicator v6 TrendMoving averages
Updated 6 months ago · None stated GitHub repository of Tactical

Energy Block V13

by shawnwong84
1 stars

A box breakout strategy whose header comments describe a focus on cutting losing trades. It uses a wider ATR stop, an extra early exit when floating loss exceeds a multiple of the box height, a strict EMA 50 trend filter, a volume filter and a trailing profit

Strategy v6 BreakoutTrend
Updated 7 months ago · None stated GitHub repository of Energy Block V13
1 stars

This Bitcoin trading strategy analyzes golden cycle phases using halving dates and custom lengths for pre- and post-halving rises and drops. It plots a rainbow ribbon, supply and demand zones, Ichimoku cloud, geometric mean indicator, and ZigZag lines on the p

Strategy v6 TrendSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle v5
1 stars

An indicator that reads trend from a fast and slow EMA on four-hour data and requires a minimum percentage separation between them. Entries also need volume above its moving average by a multiple, an RSI check and on-balance volume above its EMA. A cooldown li

Indicator v5 TrendVolume
Updated 7 months ago · None stated GitHub repository of V13 Trend Momentum Rider
1 stars

Plots five moving averages on the price chart in one script, defaulting to exponential averages of 9, 20, 50, 100 and 200 bars in graded blue shades. Each line has its own type from SMA, EMA, SMMA, WMA or VWMA, plus length, source, offset and an optional highe

Indicator v5 Moving averagesTrend
Updated 9 months ago · MPL-2.0 GitHub repository of Multiple Moving Averages
1 stars

A strategy based on the Open Close Cross idea, where a moving average of the open is compared with one of the close. It offers twelve moving average types, an optional alternate higher-timeframe resolution, a delay offset to limit repainting, and long, short o

Strategy v6 Moving averagesTrend Repaints
Updated 9 months ago · None stated GitHub repository of OCC Strategy Optimized

SFA_MSB_v1

by genesisgrubio39
1 stars

SFA_MSB_v1 is a logic-only Pine Script library providing structural flow analytics outputs. It calculates bullBreak and bearBreak booleans when swing highs or lows are crossed using specified break triggers, with optional ATR confirmation and regime detection.

Library v6 TrendSupport & resistance
Updated 10 months ago · None stated GitHub repository of SFA_MSB_v1

Scalping for S50

by lumduan
1 stars

This strategy plots three EMAs (fast length 8, mid 21, slow 55) on the price chart to identify trend direction. It signals long entries in aligned bull trends confirmed by RSI above 50 and bullish MACD during trading hours, entering when price rises above the

Strategy v6 ScalpingTrend
Updated 1 year ago · None stated GitHub repository of Scalping for S50

TOTAL MTPI STRAT M_K

by Mikelkulla
1 stars

This strategy overlays the price chart to determine macro market direction by aggregating signals from an ensemble of up to 26 trend, momentum, and moving-average indicators. It incorporates an Augmented Dickey-Fuller (ADF) market regime filter to detect rangi

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TOTAL MTPI STRAT M_K

Trend Indicator A

by mkdir700
1 stars

A price-chart overlay that draws a selectable moving average of the close, with optional high and low lines and a fill between them, coloured by trend direction. The average type can be ALMA, HMA, SMA, SWMA, VWMA, WMA, ZLEMA or EMA. Optional RSI and volume con

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

This indicator identifies support and resistance turning points on the price chart using higher-order momentum analysis. It calculates a double-smoothed exponential moving average, derives its first momentum, and detects zero-crossings of its second momentum t

Indicator v4 Support & resistanceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Support and Resistance Levels v3
1 stars

An overlay that plots up to three double exponential moving averages with separate lengths, where setting a length to zero disables a line. The crossover logic depends on which lines are active: price against the first line when it is alone, or the first line

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Double Exponential Moving Average

Ichimoku Kumo

by hayashi19
1 stars

This indicator draws an Ichimoku Kinko Hyo set on the price chart, with conversion and base lines, leading spans A and B, a lagging line and a cloud filled lime or red depending on which span is higher. Candles are coloured green, red or white by their positio

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Ichimoku Kumo

RSI-ADI-Combo

by DT021
1 stars

This indicator combines the Average Directional Index (ADX) for trend strength, Money Flow Index (MFI) for volume flow analysis, and Relative Strength Index (RSI) for momentum signals. The ADX is plotted as colored columns with background coloring indicating u

Indicator v4 TrendOscillators & momentum
Updated 6 years ago · GPL-3.0 GitHub repository of RSI-ADI-Combo

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