Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 78)

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

Pivot Trendlines

by g-moe
3 stars

This indicator identifies pivot highs and lows using a swing lookback period and connects them with trendlines on the price chart. It generates long and short entry signals when price moves through predefined percentage thresholds in three steps for buy and se

Indicator v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines
3 stars

This indicator plots horizontal support and resistance levels alongside sloping diagonal trendlines based on pivot high and pivot low points directly on the price chart. It provides three independent groups of pivot length settings, allowing traders to monitor

Indicator v5 Support & resistanceTrend
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines v2

This overlay indicator plots three moving averages chosen from EMA, SMA, HMA, VWMA, or RMA. Inputs also configure Stochastic RSI and RSI lengths, buy and sell thresholds, and an optional RSI divergence filter with its own lookback. A session window can restric

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines with Divergence Scanner

Custom Pattern Detection

by regalouisei
2 stars

This indicator identifies multi-leg custom harmonic or structural patterns on the price chart based on pivot high and low points. It calculates Zigzag trendlines using a configurable lookback period and filters pattern segments (AB, BC, CD, DE, EF) using targe

Indicator v5 Support & resistanceTrend Repaints
Updated 8 months ago · None stated GitHub repository of Custom Pattern Detection

Notch Filter (NOTCH)

by mihakralj
99 stars

Calculates and plots a second-order Infinite Impulse Response (IIR) notch filter directly on the price chart. Based on the RBJ Audio EQ Cookbook design, the filter attenuates a specific cyclic frequency component from the input series while preserving other ma

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Notch Filter (NOTCH)

This indicator plots pivot trendlines on the price chart and scans for divergences using RSI. It combines multiple moving averages, stochastic RSI indicators, and multi-timeframe stochastic RSI to generate buy and sell signals based on confluence. Entries foll

Indicator v5 TrendDivergence Repaints
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines with Divergence Scanner

BB9 MA200 Strategy

by hasnocool
106 stars

A trend-following strategy combining Bollinger Bands with a long-term moving average filter. It plots a 200-period EMA along with standard 21-period Bollinger Bands directly on the price chart. Long entries trigger when both the upper and lower Bollinger Bands

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of BB9 MA200 Strategy

NW - Nadaraya-Watson Kernel Regression is an indicator that applies a non-repainting Gaussian kernel regression filter to smooth price data. For each bar, it calculates a normalized weighted average of historical values using a Gaussian weighting function, ope

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of NW - Nadaraya-Watson Kernel Regression

This strategy draws on the price chart and manages long and short entries around pivot trendlines. It filters signals with three configurable moving averages, Stochastic RSI, a higher-timeframe Stochastic RSI, and optional RSI divergence. A session window can

Strategy v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines with Divergence Scanner Strategy
1 stars

This indicator calculates a simple moving average (SMA) alongside a zero-centered symmetrized price series and its moving average. It uses Average True Range (ATR) to create a dynamic price offset, plotting a stepline translated moving average along with an up

Indicator v5 Moving averagesVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of Symmetrized MA & Dynamic Offset

This strategy combines triple moving average trend filtering with Stochastic RSI levels and optional RSI divergence signals to generate long and short trade entries. It uses Average True Range multipliers to define dynamic take profit and stop loss levels for

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines with Divergence Scanner Strategy
1 stars

A test strategy from a reference corpus that evaluates RSI, a MACD histogram and a Bollinger middle line on 1-hour data requested from a 15-minute chart, with lookahead off. It goes long one unit when hourly RSI is above 55, the hourly histogram is positive an

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Recompute Probe 01 MTF RSI MACD BB

Parabolic SAR

by mihakralj
99 stars

Parabolic SAR plots dots on the price chart to indicate trend direction and potential reversals. It calculates a trailing stop level that starts at the extreme price of the prior bar and adjusts using an acceleration factor that increases with each new extreme

Indicator v6 TrendSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Parabolic SAR
3 stars

Premium Dashboard evaluates multiple technical indicators, including moving averages, oscillators, and price action metrics, displaying a consolidated confluence table on the main chart pane. It calculates bullish and bearish alignment across up to ten customi

Indicator v5 Screeners & dashboardsMoving averages
Updated 5 months ago · None stated GitHub repository of Premium Dashboard
99 stars

This indicator plots an extended Parabolic SAR on the price chart. It tracks a stop-and-reverse level with separate acceleration-factor start, step, and maximum settings for long and short modes. The start value can force an initial long or short direction, or

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Parabolic SAR Extended (SAREXT)
2 stars

Dynamic Linear Regression Channels calculates and plots an auto-adjusting linear regression line alongside upper and lower standard deviation bands on the price chart. Unlike fixed-length regression tools, it dynamically expands its calculation window bar-by-b

Indicator v5 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of Dynamic Linear Regression Channels
1 stars

The strategy enters a long position of two lots at 1:15 on the hour when no position is open. It then places a take-profit order for half the position at 0.3 percent above the average entry price and a stop-loss order for the remaining half at 0.6 percent belo

Strategy v6 Sessions & timeScalping
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 41 - partial qty percent
1 stars

Time Analyzer {Morindok} calculates pivot highs and lows over a user-defined length to establish structural market baselines. It supports either an alternating ZigZag mode or independent high and low swing tracking. Based on these anchor points, the script con

Indicator v5 Support & resistanceTrend
Updated 7 weeks ago · None stated GitHub repository of Time Analyzer {Morindok}
106 stars

The Bear & Bull Zone Signal Strategy is a trend-momentum strategy that calculates an RSI based on Heikin-Ashi closes, smoothed with fast and slow double EMAs to identify bullish and bearish zones. It also computes a Stochastic oscillator applied to RSI values.

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bear & Bull Zone Signal Strategy

Best Crypto DEMA

by hasnocool
106 stars

Best Crypto DEMA is a long-only trend-following strategy that generates trading signals based on Double Exponential Moving Average crossovers. It calculates fast and slow DEMAs across a user-defined timeframe resolution, with an option to derive prices from He

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Best Crypto DEMA
106 stars

The Binary Options Strategy Template is a Pine Script v4 strategy that overlays the 14-period simple moving average on the price chart. It signals long entries when the close price is above the SMA and short entries when below. Positions close automatically af

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Binary Options Strategy Template
106 stars

This strategy calculates custom moving averages weighted by binomial coefficients. It plots a fast and a slow binomial moving average directly on the price chart, filling the space between them according to the trend direction. A long position enters when the

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Binomial Moving Average
1 stars

This strategy isolates request.security with gaps on and lookahead off. On a 15-minute chart it requests the 60-minute close and stores the last non-empty higher-timeframe close. A roll up is a newly returned close above that stored value, and a roll down is o

Strategy v6 Trend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 47 - security gaps on

Gann Box (Zeiierman)

by regalouisei
2 stars

The Gann Box (Zeiierman) indicator calculates and overlays Gann Box and optional Gann Fan structures directly on the main price chart. It projects horizontal Fibonacci level bounds and dynamic angle lines based on significant high and low points to highlight p

Indicator v5 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of Gann Box (Zeiierman)

BlackSwan Strategy

by hasnocool
106 stars

This strategy detects large single-candle body expansions exceeding approximately 1.91% of price to enter momentum breakouts. It enters long positions on large bullish candles and short positions on large bearish candles. Positions are closed when the 144-peri

Strategy v4 BreakoutMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BlackSwan Strategy

Golden Pocket

by regalouisei
2 stars

Golden Pocket indicator identifies potential reversal zones by drawing Fibonacci retracement lines and boxes between pivot highs and lows on the price chart. It applies moving average filters to confirm trend direction for both bull and bear setups. Users can

Indicator v5 Support & resistanceMoving averages
Updated 8 months ago · None stated GitHub repository of Golden Pocket

PF TV Golden 49 - NA NZ History

by pineforge-4pass
1 stars

This validation strategy evaluates warmup behavior and historical references using missing value functions like nz() and fixnan(). It calculates raw price changes, substitutes missing values, and computes an eight-period simple moving average score. The strate

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV Golden 49 - NA NZ History
3 stars

This indicator calculates a 30-period and a 50-period simple moving average of the closing price and plots both lines in a separate pane. It fills the space between them teal when the shorter average is above the longer average and red when it is below. There

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Price Action Candles
106 stars

The Bollinger %B Candles Strategy evaluates price volatility and momentum by calculating Bollinger Bands %B oscillator values in a separate pane. It incorporates customizable moving average filters, ATR multipliers, and optional higher-timeframe yearly high or

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger %B Candles Strategy
2 stars

This indicator implements Hosoda's Ichimoku Theories directly on the price chart, combining standard Ichimoku Kinko Hyo components (Tenkan-sen, Kijun-sen, Kumo cloud, and Chikou span) with Time Theory and Wave Theory analysis. It detects swing highs and lows,

Indicator v5 TrendSupport & resistance
Updated 8 months ago · None stated GitHub repository of Ichimoku Theories [LuxAlgo]
3 stars

This lightweight indicator calculates a 9-period Exponential Moving Average (EMA) and a 20-period EMA, plotting both directly on the price chart overlay. It also plots a third line in orange that displays the mathematical sum of the two EMAs as a simple trend

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Price Action Candles

PF UDT probe 04 - default param

by pineforge-4pass
1 stars

This Pine Script strategy implements a custom long-only EMA crossover on the price chart. It defines a UDT struct Cfg with a threshold method that accepts default parameter values. The strategy computes RSI and ATR indicators then uses three call styles to the

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT probe 04 - default param

Universe Of Mirrors

by morindok
1 stars

This Pine Script indicator calculates two pairs of parallel universes derived from moving averages of the source price using Fibonacci ratios of the golden ratio. It plots Universe A and Universe B lines along with their inverse counterparts, plus fill bands b

Indicator v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Universe Of Mirrors
106 stars

This strategy enters long positions during a specified trading session when multiple technical indicators align. It executes a buy order when the low drops below the lower Bollinger Band while RSI and ADX exceed configurable threshold values, price closes abov

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band + RSI + ADX + MACD
99 stars

This indicator calculates J. Welles Wilder's Plus Directional Indicator (+DI) to measure upward price momentum. It computes Positive Directional Movement (+DM) and True Range (TR), smoothing them using a compensated Running Moving Average (RMA) technique for a

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Plus Directional Indicator (+DI)
2 stars

This indicator provides an interactive framework for validating Elliott Wave motive wave structures directly on the price chart. Users select six anchor points corresponding to wave origins and terminals (points 0 through 5) using interactive chart inputs. The

Indicator v5 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of Interactive Motive Wave Checklist
1 stars

This strategy serves as a Pine Script v6 validation probe testing User-Defined Type (UDT) methods as conditional triggers for strategy entries. It calculates 9-period and 21-period Exponential Moving Averages to detect crossover and crossunder signals. Custom

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT Probe 14 - Method Drives Entry
106 stars

Bollinger Band Breakout is a positional strategy combining Bollinger Bands with the Relative Strength Index (RSI). It opens long positions when price crosses above the upper Bollinger Band while 14-period RSI is between 60 and 70. Short entries trigger when pr

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band Breakout
99 stars

This indicator calculates Wilder's plus directional movement and plots the smoothed value in a separate pane. On each bar it compares the upward and downward price moves, keeps only a positive up move that exceeds the down move, then applies a compensated RMA

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Plus Directional Movement (+DM)

This indicator plots a linear regression line based on closing prices using a 10-period window. The regression calculates a straight line that best fits the price data points over the specified length. It draws the resulting trend line in a separate pane for v

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Price Action Candles with Linear Regression

This strategy combines Volume Weighted Moving Average (VWMA) Bollinger Bands with 200-period and 50-period Exponential Moving Averages (EMAs). It identifies long trade opportunities when the 50 EMA is above the 200 EMA and price falls to or below the lower Fib

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with Fib Golden Ratio (0.618)

PF_WS01_REV

by pineforge-4pass
1 stars

This strategy uses two exponential moving averages (fast period 5, slow period 13) to detect trend changes via crossover signals on the price chart. It enters long on fast EMA crossing above slow EMA and short on the reverse crossover. The script includes expl

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF_WS01_REV
1 stars

Zero-Lag Fractal KdV Smoothing is an indicator that applies fractal dimension-based smoothing to price data using a KdV-like wave equation. It computes a weighted average between the current close price and the prior filtered value, where the weights depend on

Indicator v5 Moving averagesVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of Zero-Lag Fractal KdV Smoothing
99 stars

This indicator plots a rolling polynomial regression fitted to a chosen price source over a lookback window. It builds the normal equations, solves them with Gauss-Jordan elimination and partial pivoting, and returns the polynomial value at the current bar. Pe

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Polynomial Fitting (POLYFIT)

This overlay strategy combines swing price structure with MACD structure and two higher-timeframe exponential moving averages. It finds pivot highs and lows over ten bars, labels higher highs, lower highs, higher lows and lower lows, and builds matching states

Strategy v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Price Action Candles with MACD Signals 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