Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 58)

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 Magic

by capissimo
114 stars

Calculates and plots a dynamic trend line on the price chart using Commodity Channel Index (CCI) and Average True Range (ATR). The trend direction is established by whether CCI is above or below zero, which controls an ATR-based trailing line. Generates buy an

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

Andean Scalping

by hasnocool
106 stars

Andean Scalping is a Pine Script v5 strategy template designed for backtesting trading signals. It features session and date-range filtering, directional trade toggles for long and short entries, and optional trend filtering tools including higher-timeframe EM

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Andean Scalping
99 stars

This indicator calculates a second-order Chebyshev Type II lowpass filter and plots the result on the price chart. Length sets the cutoff period, and stopband attenuation in decibels controls how strongly higher-frequency components are reduced. The source inp

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Chebyshev Type II Filter (CHEBY2)
46 stars

This multi-timeframe indicator calculates an adaptive trailing stop line based on Bollinger Bands evaluated on a user-selected resolution. It calculates standard deviation and simple moving average bands from the higher timeframe data, tracking trend shifts wh

Indicator v5 TrendVolatility & bands
Updated 8 weeks ago · None stated GitHub repository of MTF Bollinger Bands Trend Stop

Doji Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects and highlights the Bearish Doji Star candlestick reversal pattern directly on the price chart. It checks for an uptrend using simple moving average rules, followed by a long bullish candle and a gapping doji candle. When identified, the

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

This strategy enters long or short on a Donchian channel break and sizes each unit by risking a percentage of equity against an ATR stop. It adds units as price advances by a fraction of ATR, up to a set maximum. A three-tier time exit uses RSI: fading momentu

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 42: Momentum-Gated Time

Market State Engine classifies the current market into nine states including balance, compression, bull and bear expansion, pullback, exhaustion, and transition. It computes orthogonal axes for structural regime, energy phase, value location relative to adapti

Indicator v6 TrendSupport & resistance Repaints
Updated 3 days ago · MIT GitHub repository of Market State Engine [WavesUnchained]

SAIYAN OCC Strategy R5.41

by IAMATOMIC001
3 stars

SAIYAN OCC Strategy is a price-chart strategy that builds a short moving average of open and close prices using TEMA, Hull, or ALMA and colours bars by trend. It can take long, short, or both directions, optionally from Heikin Ashi closes or a multiplied alter

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of SAIYAN OCC Strategy R5.41

CHOCH + BOS

by skipp-dev
1 stars

Calculates market structure breaks by identifying Change-of-Character (ChoCH) and Break-of-Structure (BOS) levels on the price chart using swing high and swing low pivots. It features an integrated volume filter requiring breakout volume to exceed an SMA multi

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 4 days ago · None stated GitHub repository of CHOCH + BOS
1 stars

A swing strategy that goes long when the SuperTrend (period 10, multiplier 5) is bullish, price is above a rising 200-period EMA, and the long side is enabled. Shorts follow the mirror rules but are switched off by default. An optional partial exit closes a se

Strategy v6 TrendMoving averages
Updated 8 days ago · GPL-3.0 GitHub repository of Pro-Swing System: 200 EMA and SuperTrend

DEPV2 DEBUG S22

by YuceSezar89
1 stars

DEPV2 DEBUG S22 is a multi-symbol crypto indicator that monitors twenty perpetual futures pairs across four distinct market dimensions: trend, momentum, volatility, and volume. It evaluates signals using simultaneous consensus or sequential chains, requiring a

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

0-1 Reversal Signals

by morindok
1 stars

0-1 Reversal Signals tracks consecutive sequences of bullish or bearish candlestick closes to highlight potential trend reversals. It counts consecutive green (1) or red (0) candles and generates visual Buy or Sell shape signals directly on the price chart whe

Indicator v5 Candlestick patternsTrend
Updated 7 weeks ago · None stated GitHub repository of 0-1 Reversal Signals

Apex Nexus Flip Engine v11

by vedkanani123
1 stars

A trend flip indicator on the price chart with BUY and SELL labels. It builds a zero-lag trail from an ATR multiple and an optional volume-weighted source, with an evasive mode that pushes the trail away during small pullbacks. Flips pass gates for choppiness,

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Apex Nexus Flip Engine v11
1 stars

This multi-factor consensus strategy aggregates directional votes across five independent analytical agents: dual EMA trend alignment (50/200), RSI momentum, Bollinger Bands baseline position, intraday VWAP, and higher-timeframe daily EMA 50 trend. It executes

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of TN Federated Swarm Voting v6

Polish

by GreyssonEnterprises
1 stars

This indicator overlays multiple smoothed moving averages, candlestick reversal patterns, and trading session highlights directly onto the price chart. It calculates 21, 50, optional 100, and 200-period smoothed moving averages alongside a short-term moving av

Indicator v4 Moving averagesCandlestick patterns
Updated 3 months ago · MIT GitHub repository of Polish

MACD Test VWAP

by tseitz
1 stars

This strategy combines standard Moving Average Convergence Divergence (MACD) crossovers with Volume Weighted Average Price (VWAP) level interactions. It enters long positions when the MACD line sits above its signal line and short positions when below. Positio

Strategy v4 TrendOscillators & momentum Repaints
Updated 4 years ago · None stated GitHub repository of MACD Test VWAP

Laguerre Filter

by everget
947 stars

The Laguerre Filter is a technical indicator designed to reduce lag while smoothing price data using John Ehlers' time-warping Laguerre polynomials. It processes a selected price source across four recursive filter components governed by a user-defined damping

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Laguerre Filter
257 stars

This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of SPY Options Trading - Alert

Choppiness Index

by mihakralj
99 stars

The script plots the Choppiness Index in a separate pane. It sums true range over a lookback and compares that sum with the highest-high to lowest-low range, then scales the result from 0 to 100. Lower readings indicate a trending market and higher readings in

Indicator v6 TrendVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Choppiness Index

Doji Star - Bullish

by TWODS-CAPITAL
37 stars

This indicator marks a bullish Doji Star on the price chart. It looks for a downtrend, a long black candle, and a following doji whose body sits below the prior candle body. Trend detection can use a 50-period SMA, both 50- and 200-period SMAs, or no filter. A

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

This strategy implements a Donchian breakout trend-following system with volatility-adaptive profit targets. It enters long or short on 55-period Donchian channel breakouts, sizes positions by ATR risk, and pyramids up to four units as price advances. Stop los

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 43: Volatility Adaptive

FilledValueGap E002

by ruckard
13 stars

FilledValueGap E002 is a trading strategy that enters positions opposite to the direction of a filled value gap, operating on the premise that the prevailing trend will resume after gap completion. It utilizes Curie closing moving averages as trend filters to

Strategy v5 SMC / ICT / price actionTrend
Updated 1 year ago · None stated GitHub repository of FilledValueGap E002

Calculates continuous structural market bias by detecting swing high and low pivots (higher highs, higher lows, lower highs, and lower lows) using configurable left and right bar lookbacks. It assigns weighted values to classified pivots within a rolling windo

Indicator v6 SMC / ICT / price actionTrend
Updated 3 days ago · MIT GitHub repository of Market Structure Advanced [WavesUnchained]

Setup-1

by IAMATOMIC001
3 stars

This indicator plots multiple technical analysis components directly on the price chart, including a Nadaraya-Watson envelope, pivot-based trendlines, and a kernel regression oscillator. It also renders visual overlay panels for the Relative Strength Index and

Indicator v5 TrendOscillators & momentum Repaints
Updated 12 months ago · None stated GitHub repository of Setup-1

NASDAQ 100 Peak Hours Strategy

by wynnforthework
2 stars

This Pine Script strategy trades the NASDAQ 100 index during peak hours using EMA crossovers, RSI, and VWAP filters. Long entries occur when close exceeds the 9-period EMA which is above the 21-period EMA, with RSI above 50, price above VWAP, EMAs aligned, and

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of NASDAQ 100 Peak Hours Strategy

CHOCH + BOS Strategy

by skipp-dev
1 stars

This strategy identifies market structure shifts, specifically Change of Character (ChoCH) and Break of Structure (BOS), on the main price chart. It triggers entries based on swing pivot breakouts with an optional volume filter and moving average confirmation.

Strategy v6 SMC / ICT / price actionTrend
Updated 4 days ago · None stated GitHub repository of CHOCH + BOS Strategy

Quantum Trend Signal

by rosijay17-cmd
1 stars

An overlay indicator that plots a fast and a slow EMA, defaulting to 21 and 55, and shades the chart background by which one is higher. A BUY triangle appears when the fast EMA crosses above the slow one while RSI is above 55 and ATR exceeds a fraction of its

Indicator v6 TrendMoving averages
Updated 8 days ago · GPL-3.0 GitHub repository of Quantum Trend Signal

DEPV2 DEBUG S23

by YuceSezar89
1 stars

DEPV2 DEBUG S23 is a Pine Script v6 indicator that draws in a separate pane and watches up to twenty user-selected Binance perpetual symbols. It combines four signal classes—trend, momentum, volatility, and volume—through a single class, simultaneous agreement

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

The 7 Golden MA Detrended Layers indicator calculates seven simple moving averages with period lengths scaled according to powers of the golden ratio (Phi). It subtracts each moving average from the source price to construct seven detrended price oscillator la

Indicator v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of 7 Golden MA Detrended Layers

Parabolic SAR

by ivansoft
1 stars

Plots the Parabolic SAR with the built-in function using a start of 0.02, increment of 0.02 and maximum of 0.2, drawn as crosses in a separate pane. It also includes a hand-written Pine version of the same calculation, plotted with the same settings, so the tw

Indicator v6 Trend
Updated 1 year ago · None stated GitHub repository of Parabolic SAR
1 stars

A Pine v4 strategy that plots a 21-period exponential 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 each position when the opposite signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of MLNBTC EMA Cross Strategy
947 stars

This indicator fits a least-squares linear regression to every available bar, up to a 5000-bar limit, using the selected source. It draws one orange regression line on the price chart and refreshes that line on the last bar. A label reports the slope, intercep

Indicator v4 Trend
Updated 12 days ago · GPL-3.0 GitHub repository of Linear Regression (All Data)

1 Pair TF Strength

by capissimo
114 stars

This indicator evaluates momentum strength for a single selected symbol across multiple intraday timeframes (1m to 60m). It retrieves price data across seven timeframes using security calls, combines them into an aggregate metric with optional ATR-based weight

Indicator v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of 1 Pair TF Strength

Astor SMA20/60

by hasnocool
106 stars

This strategy plots SMA20 and SMA60 on the price chart for BTCUSDT. It generates long entries on close crossing above SMA20 and short entries on crossing below. Separate signals trigger on SMA60 crossovers. Backtest starts at user-defined year, month, and day

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Astor SMA20/60

This indicator plots the Christiano-Fitzgerald asymmetric band-pass filter in a separate pane. It estimates the cyclical component of a series under a random-walk assumption, using ideal band-pass weights between a minimum and maximum period and forcing the we

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Christiano-Fitzgerald Band-Pass Filter (CFITZ)
16 stars

Seykota Alt 44: ADX Pyramid is a trend-following strategy that plots on the price chart. It enters positions on Donchian Channel breakouts when the Average Directional Index (ADX) confirms a strong trend. Position sizing uses Average True Range (ATR) risk, wit

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 44: ADX Pyramid

FilledValueGap F002

by ruckard
13 stars

FilledValueGap F002 is a trading strategy that enters trades when a recent price gap is filled, operating under the assumption that price action will continue in the direction of the underlying trend. It plots Curie closing moving average lines directly on the

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of FilledValueGap F002

Best SMA Finder

by regalouisei
2 stars

Best SMA Finder is an overlay indicator that scores simple moving average lengths with a crossover backtest. Long Only mode records a long entry when close crosses above the average and an exit when close crosses below it. Buy and Sell mode flips between long

Indicator v6 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Best SMA Finder
1 stars

This indicator plots CHOCH (Change of Character) and BOS market structure signals on the price chart based on SMC logic. It calculates fast and slow EMAs, RSI, ATR volatility filters, and sweep lookback to detect breakouts and pullbacks. Signals trigger entrie

Indicator v6 SMC / ICT / price actionTrend Repaints
Updated 4 days ago · None stated GitHub repository of CHOCH-Base Indikator (RUNA logic)

Median Crossover

by pineforge-4pass
1 stars

This strategy plots a rolling median and an exponential moving average of close on the price chart and enters when the two cross. A median cross above the EMA opens a long; a cross below opens a short, reversing the prior position with a fixed quantity of one.

Strategy v6 Moving averagesTrend Repaints
Updated 7 days ago · Apache-2.0 GitHub repository of Median Crossover

A strategy that trades liquidity sweeps within a trend context. Trend comes from EMAs, ADX with DI alignment and an optional confirmed higher-timeframe EMA filter, with optional ROC and balance-of-power agreement. A swing level is swept and reclaimed by a cand

Strategy v6 SMC / ICT / price actionVolume Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Ranger V2 POC State Delta Session Profiles

DEPV2 DEBUG S24

by YuceSezar89
1 stars

This indicator draws in a separate pane and requests data for up to twenty user-chosen symbols, defaulting to Binance crypto perpetual contracts. It combines four signal classes: trend, momentum, volatility, and volume. Signal mode can use one class, require a

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

A strategy that implements the Parabolic SAR calculation in code, with start, increment and maximum acceleration settings. It plots the current and next bar SAR values as crosses on the price chart. On each confirmed bar it places a stop order at the next SAR

Strategy v6 Trend
Updated 1 year ago · None stated GitHub repository of Parabolic SAR 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