Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 63)

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

Trend Following Engine v3

by rosijay17-cmd
1 stars

An overlay indicator that scores trend continuation setups from 0 to 100 and fires a signal when the score passes a threshold. The score blends normalised ADX, trend efficiency, relative volume, DI separation, slope and momentum, each with adjustable low and h

Indicator v6 TrendOscillators & momentum
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Engine v3

DEPV2 DEBUG S43

by YuceSezar89
1 stars

Monitors up to twenty cryptocurrency perpetual contracts across four analytical dimensions: trend, momentum, volatility, and volume. The indicator evaluates signals using single-method triggers, simultaneous confluence thresholds, sequential execution chains w

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

CODEX NO1 Flip Engine v5

by vedkanani123
1 stars

A structure-confirmed trend flip indicator on the price chart, where BUY exits a short and enters long and SELL does the reverse. A flip passes a chain of tests: confirmed close, clean regime, normalized baseline slope relative to ATR, displacement, a complete

Indicator v6 TrendVolatility & bands Repaints
Updated 2 months ago · None stated GitHub repository of CODEX NO1 Flip Engine v5
1 stars

An indicator in a separate pane that plots two linear regression slopes of the open and close average: one from the chart timeframe and one requested from the daily timeframe, both coloured by direction. It adds percentile bands of positive and negative slope

Indicator v6 Trend
Updated 1 year ago · None stated GitHub repository of Trend by Linreg Slope Pivot
1 stars

This indicator tracks Tom DeMark TD Sequential setup counts in a separate pane. It compares the current close to the close four bars earlier, accumulating positive counts during upward momentum and negative counts during downward momentum. The values display a

Indicator v5 TrendMean reversion
Updated 1 year ago · None stated GitHub repository of TD Sequential Number
947 stars

The Spencer 21-Point Moving Average calculates a specialized weighted moving average using Spencer's 21-point smoothing formula. It applies a specific set of symmetric positive and negative weights across 21 consecutive bars to generate a smoothed curve direct

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Spencer 21-Point Moving Average
114 stars

This indicator calculates a stepped trend line directly on the main price chart by combining price efficiency with adaptive standard deviation thresholds. When price exceeds the volatility band, the step level adjusts and changes color between green and red. T

Indicator v4 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Efficient Trend Step Mod

Hammer - Bullish

by TWODS-CAPITAL
37 stars

This indicator marks a bullish hammer candlestick on the price chart. It looks for a small real body above the bar midpoint, a lower shadow at least twice the body, and no upper shadow. A trend filter can require price below a 50-period SMA, below both a 50-pe

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Hammer - Bullish

Ruckard Eve A011

by ruckard
13 stars

This strategy evaluates trend reversals using fast-paced high and low closing moving averages combined with Directional Movement Index (ADX, DI+, and DI-) strength filters. It executes long, short, or reverse entries when signal criteria and strength threshold

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Eve A011

MTF WaveTrend Opportunity Hunter calculates multi-timeframe momentum and confluence scores using WaveTrend across custom Regime, Setup, Trigger, and Context timeframes. It plots a net confluence score histogram, multi-layer heat ribbons, an RRG-style Rotation

Indicator v6 TrendOscillators & momentum
Updated 3 days ago · MIT GitHub repository of MTF WaveTrend Opportunity Hunter [WavesUnchained]

HB Directional Range

by eddiebelaval
7 stars

HB Directional Range calculates and plots consolidation range boxes directly on the price chart based on candle body behavior. It tracks high and low boundaries, extending the active range box as long as candle bodies remain within it. When a candle body break

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of HB Directional Range

Faith JL

by g-moe
3 stars

This indicator evaluates market sentiment and momentum using Aroon crossovers, intra-bar buy and sell volume estimation, and an ATR-based calculation. It generates modular buy and sell conditions filtered by volume thresholds, percentage bands, and Aroon signa

Indicator v5 VolumeTrend
Updated 5 months ago · None stated GitHub repository of Faith JL

This strategy plots EMAs on the price chart. It signals long entries when the fast EMA crosses above the slow EMA on a barstate.isconfirmed bar and exits on opposite cross when barstate.isconfirmed. It uses fixed position sizing of 1 with no stop loss. The mai

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF barstate-magnifier probe 01b isconfirmed OFF

A trend-following strategy that marks entries with triangles. Trend needs a fast and slow EMA stack with a minimum slope, an optional ADX filter and an optional higher-timeframe EMA check defaulting to daily. Two entry modes are offered: a pullback continuatio

Strategy v6 TrendBreakout Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Strategy - Triangle Entries

DEPV2 DEBUG S44

by YuceSezar89
1 stars

DEPV2 DEBUG S44 is a multi-asset signal and confluence indicator designed for cryptocurrency pairs. It monitors up to twenty Binance perpetual contracts across four distinct analytical dimensions: trend, momentum, volatility, and volume. The script supports mu

Indicator v6 Screeners & dashboardsTrend Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S44

Trend Strength Index

by ivansoft
1 stars

Plots the correlation between closing price and bar index over a chosen length, 14 by default, in a separate pane. Values near plus one indicate a steady rise across the window and values near minus one a steady fall. Gradient fills shade the area above and be

Indicator v6 Trend
Updated 1 year ago · None stated GitHub repository of Trend Strength Index
1 stars

This indicator calculates TD Sequential setups by comparing the current close price to the close four bars ago. It increments or decrements a setup count and tracks direction to identify progression in trend. The setup count is plotted as a status line on the

Indicator v5 TrendSupport & resistance
Updated 1 year ago · None stated GitHub repository of TD Sequential OnChart

Forecast Oscillator

by capissimo
114 stars

This indicator calculates Tushar Chande's Forecast Oscillator by determining the percentage difference between the input price and its linear regression estimate over a set lookback period. The script normalizes the resulting oscillator using a min-max scaling

Indicator v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Forecast Oscillator

Band-Zigzag TrendFollower Strategy is a trend-following trading system that combines volatility bands, such as Bollinger Bands or Keltner Channels, with pivot-based trend structure. It evaluates trend switches and invalidation levels using adaptive or sticky b

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Band-Zigzag - TrendFollower Strategy [Trendoscope]

Hanging Man - Bearish

by TWODS-CAPITAL
37 stars

This overlay indicator marks a bearish hanging man candlestick on the price chart. It looks for a small real body sitting in the upper part of the range, a lower shadow at least twice the body, and no upper shadow, and only while an uptrend filter is active. T

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Hanging Man - Bearish
2 stars

This indicator plots Fibonacci Time-Price Zones on the price chart. It draws horizontal and vertical Fibonacci levels from 0.236 to 1.236 using user-defined values, colors, and line thicknesses. Different zone types such as retracement and shapes including cir

Indicator v6 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of Fibonacci Time-Price Zones

USI-Flip

by skipp-dev
1 stars

This indicator plots buy and short signal labels directly on the price chart based on crossovers across six multi-length RSI lines. The script identifies flip conditions when the fastest line crosses through the slower line bundle, filtered by a configurable v

Indicator v6 Oscillators & momentumVolume Repaints
Updated 4 days ago · None stated GitHub repository of USI-Flip

A Donchian-style trend strategy that enters on a breakout of a 55-bar channel and exits on a 20-bar channel break, with a 200-period EMA as the regime filter. Entries can require a fresh breakout and an ADX and DMI strength check. An ATR trailing stop is drawn

Strategy v6 TrendBreakout
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Strategy v6 Signal Cooldown

DEPV2 DEBUG S46

by YuceSezar89
1 stars

DEPV2 DEBUG S46 is a Pine Script v6 indicator that draws in a separate pane. It tracks up to twenty user-selected crypto perpetual symbols and combines four signal classes: trend, momentum, volatility, and volume. The signal mode can use one class, require sev

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

This indicator combines a scaled Forecast Oscillator with a Point of Force state detector. The Forecast Oscillator calculates the percentage deviation of price from its linear regression curve and normalizes the output between 0 and 1, plotting a line in a sep

Indicator v4 Oscillators & momentumSupport & resistance Repaints
106 stars

This strategy plots multiple indicators on the price chart for Bank Nifty index. It calculates MACD on different timeframes, RSI, ADX, Stochastic oscillator, and Bollinger Bands. The strategy generates buy signals when MACD shows upticks across timeframes, RSI

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bank Nifty Bullish Intraday

Calculates John F. Ehlers' Distance Coefficient Filter as a distance-weighted finite impulse response filter overlaid directly on the price chart. It weights historical price samples based on the sum of squared price differences across the lookback window, red

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of EDCF: Ehlers Distance Coefficient Filter

Harami - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects a bearish Harami candlestick pattern on the price chart. It requires a long bullish candle in an uptrend followed by a smaller bearish candle whose range sits inside the previous body. Trend context is optional and uses a 50-period SMA,

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Harami - Bearish

IFA-VP Context

by eddiebelaval
7 stars

This indicator plots a fixed lookback Volume Profile alongside 20, 50, and 200 Simple Moving Averages directly on the price chart. It highlights trend changes via moving average crosses and marks Point of Control reactions, High Volume Nodes, and Value Area bo

Indicator v6 VolumeSupport & resistance
Updated 3 months ago · None stated GitHub repository of IFA-VP Context

Fractals

by g-moe
3 stars

The Fractals indicator identifies potential reversal points on the price chart by detecting local swing highs and lows. It plots down fractal markers above the bar for swing highs and up fractal markers below the bar for swing lows. The Periods setting control

Indicator v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of Fractals
1 stars

This indicator plots a volume-weighted moving average as the central trend baseline on the price chart and surrounds it with ATR volatility bands. Trend conditions change when price breaks beyond those bands. Presets change the VWMA length and ATR multiplier f

Indicator v6 TrendMoving averages
Updated 4 days ago · None stated GitHub repository of Volume Weighted Trend [SkippAlgo]

PF FX 5dp - SMA20/50 cross

by pineforge-4pass
1 stars

This strategy generates crossover signals using SMA20 and SMA50 on the EURUSD forex pair at 5 decimal places. It enters a long position when the fast SMA crosses above the slow SMA and immediately closes any existing short position. It enters a short position

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF FX 5dp - SMA20/50 cross

Trend Pivot Retracements

by rosijay17-cmd
1 stars

An overlay indicator that sets a trend direction from 50-bar highs and lows, flagging an uptrend on a new high and a downtrend on a new low. Within the trend it detects pivot lows or highs and measures the retracement from the recent extreme, drawing a dashed

Indicator v6 TrendSupport & resistance
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Pivot Retracements

DEPV2 DEBUG S47

by YuceSezar89
1 stars

This indicator is a multi-symbol debug panel that plots signal state in a separate pane. It watches up to twenty configurable symbols, defaulting to Binance USDT perpetual contracts, and classifies direction with trend, momentum, volatility, and volume methods

Indicator v6 Screeners & dashboardsTrend Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S47
1 stars

A simple price-chart indicator that plots a fast and a slow exponential moving average, defaulting to 20 and 50 periods, with a fill between them. It prints a buy label when the fast average crosses above the slow one and a sell label when it crosses below, an

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of EMA Crossover Buy/Sell Signals

SMA Strategy

by tseitz
1 stars

A Pine v4 strategy that plots a simple 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 the opposite side. Inputs set the SMA length, long and

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SMA Strategy

T3 Moving Average

by everget
947 stars

The T3 Moving Average indicator calculates Tim Tillson's smoothed moving average overlay. It applies a generalized DEMA calculation iteratively across three passes to reduce lag while minimizing overshoot relative to price action. Users can adjust the period l

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of T3 Moving Average
330 stars

MA Cross + DMI [Alorse] is a trend-following strategy that calculates two moving averages (EMA or SMA) alongside the Directional Movement Index (DMI). It plots the two moving averages directly on the price chart. Long positions are entered when the fast moving

Strategy v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MA Cross + DMI [Alorse]

This strategy overlays Supertrend on the price chart and trades only inside a set session and backtest date range. It enters long when Supertrend turns up, or after a chosen candle delay while the trend is up, and enters short on the opposite conditions. It cl

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of BankNifty 5min Supertrend Based Strategy

Efficiency Ratio (ER)

by mihakralj
99 stars

This indicator calculates Kaufman's Efficiency Ratio as a signal-to-noise measure of price movement. It compares the absolute net change over a lookback period with the sum of absolute bar-to-bar changes, then clamps the result between 0 and 1. Values near 1 m

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Efficiency Ratio (ER)

Ruckard Irene A003

by ruckard
13 stars

Ruckard Irene A003 is an overlay strategy that combines fast moving averages with Directional Movement Index (ADX, DI+, DI-) filters to execute trades. It evaluates price momentum relative to high and low moving averages while checking ADX strength thresholds.

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Irene A003

Fractals with Divergence Scanner is an overlay indicator that combines Exponential Moving Averages, an eight-line EMA ribbon cloud, and WaveTrend divergence analysis. It calculates baseline EMA trends alongside WaveTrend oscillators to detect regular and hidde

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Fractals with Divergence Scanner

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