Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 74)

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

My Script

by be-thomas
65 stars

This indicator calculates and plots a 5-period simple moving average and a 50-period simple moving average based on the closing price directly on the main price chart. It detects crossover points between the fast and slow moving averages, marking each occurren

Indicator v4 Moving averagesTrend
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Tri-Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator scans price charts to identify the Bearish Tri-Star candlestick pattern, which consists of three consecutive Doji candles appearing at the peak of an uptrend. It verifies trend context using simple moving averages (SMA 50 or SMA 200) or allows t

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

This strategy combines MACD and Supertrend to generate entries on the price chart. The MACD oscillator uses selected source, fast length 12, slow 26, signal 9 and EMA or SMA. Supertrend on higher timeframe 15 provides trend direction and ATR trailing stop. Sig

Indicator v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of MACD VWMA Strategy
106 stars

This trading strategy combines three Exponential Moving Averages (8, 14, and 50 periods by default) with Stochastic RSI and Average True Range (ATR). It enters a long position when EMA 1 is above EMA 2, EMA 2 is above EMA 3, and the Stochastic RSI %K line cros

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 3 x EMA + Stochastic RSI + ATR

Trailering J009

by ruckard
13 stars

Trailering J009 is a long-only strategy designed for cryptocurrency trading with Zignaly integration. It evaluates price excursion across multiple sub-strategy trigger conditions to size trade entries and refine exit points. The system features flexible exit m

Strategy v5 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of Trailering J009

Market Rhythm Adaptive Trading Algo V1 is an overlay indicator that combines Kaufman Adaptive Moving Averages (KAMA), an ADX regime filter, Choppiness Index, Rate of Change, and RSI to identify market rhythm and trend entries. Depending on whether the ADX valu

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Market Rhythm Adaptive Trading Algo V1
1 stars

A gold-focused price-chart indicator that measures rolling correlation between the chart symbol and the dollar index, and when the correlation is inverse enough it generates signals from RSI crossing its oversold and overbought levels. It adds a Supertrend tre

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Wake Up, Neo Gold/DXY Confluence
106 stars

This long-only trend-following strategy identifies breakout trades by requiring price to breach a 250-bar high while aligned with 50-period, 150-period, and 200-period Simple Moving Averages. It calculates relative strength against a comparative market benchma

Strategy v4 TrendBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of 365 Day High Breakout Strategy

Hurst Exponent (HURST)

by mihakralj
99 stars

Calculates and plots the Hurst Exponent to quantify the persistence, mean-reverting tendencies, or random walk characteristics of a time series. It computes logarithmic returns, segments the lookback window into sub-periods to determine rescaled range statisti

Indicator v6 TrendMean reversion
Updated 4 weeks ago · Apache-2.0 GitHub repository of Hurst Exponent (HURST)

The Keltner Center Of Gravity Channel Mutations Indicator calculates adaptive channel metrics based on Donchian range Fibonacci levels (38.2% and 61.8%) and Average True Range (ATR) offsets. The lookback period automatically adjusts according to the active tim

Indicator v5 Volatility & bandsVolume
Updated 8 months ago · None stated GitHub repository of Keltner Center Of Gravity Channel Mutations Indicator

TN_CMO_v26

by raybird
1 stars

The TN_CMO_v26 strategy calculates the Chande Momentum Oscillator and applies causal divergence filters against price action within a trend regime defined by a 200-bar EMA. It generates long entries on bullish divergence or CMO crossing above negative extreme

Strategy v6 DivergenceOscillators & momentum Repaints
Updated 2 months ago · None stated GitHub repository of TN_CMO_v26

Ichimoku Cloud

by mihakralj
99 stars

This indicator plots the five classic Ichimoku components on the price chart. It calculates Tenkan-sen, Kijun-sen, and Senkou Span B as midpoints of the highest high and lowest low over their periods, then derives Senkou Span A from Tenkan and Kijun. Chikou Sp

Indicator v6 TrendSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ichimoku Cloud

TRIX

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the classic Triple Exponential Average (TRIX) momentum oscillator in a separate pane. It applies a triple exponential moving average to the natural logarithm of closing prices and computes the 1-bar rate of change multiplied

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of TRIX

Welles Wilders MAs - MTF

by eddiebelaval
7 stars

Calculates four Welles Wilder Moving Averages (RMA) using a user-specified timeframe and plots them directly on the price chart. The script tracks short, medium, extension, and long trend lines (default periods 34, 72, 89, and 144). Users can configure timefra

Indicator v5 Moving averagesTrend
Updated 3 months ago · None stated GitHub repository of Welles Wilders MAs - MTF

Kernel Regression Toolkit

by regalouisei
2 stars

The Kernel Regression Toolkit calculates and plots non-linear regression estimations directly on the price chart. It provides multiple configurable kernel regression lines using functions such as Rational Quadratic, Gaussian, Periodic, and Locally Periodic ker

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Kernel Regression Toolkit
1 stars

A price-chart indicator that plots a zero-lag EMA with an ATR band around it. The trend flips long when price closes above the upper band and short when it closes below the lower band, marked with buy and sell labels and a shaded channel. Optional features inc

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Adaptive Zero-Lag Reversal Engine

TnS_ICT_Combo_V6

by raybird
1 stars

TnSovereignIctComboV6 is a multi-confluence ICT SMC strategy on the price chart. It calculates HTF EMA bias, killzone sessions, FVG detection, liquidity sweeps, market structure shifts, premium discount arrays and V17 fractal gate to achieve minimum confluence

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of TnS_ICT_Combo_V6
1 stars

A Pine Script v4 indicator on the price chart that draws a moving average wave, a channel of exponential averages on the high, close and low with a default length of 38, centred on a chosen source. It can also colour candles by whether they close above, below

Indicator v4 Moving averagesTrend
Updated 6 months ago · None stated GitHub repository of ZLEMA Wave and GRaB Candles Alt2
106 stars

3x Supertrend and Stoch RSI is an overlay strategy combining three Supertrend indicators with Stochastic RSI momentum and a 200-period Exponential Moving Average. It uses the 200 EMA to establish the primary trend direction, requiring agreement across fast, me

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 3x Supertrend and Stoch RSI

Inertia Oscillator

by mihakralj
99 stars

This indicator calculates the Inertia Oscillator, measuring market trend strength based on the distance between price and its linear regression value. Over a user-defined length and price source, it computes the linear regression line and calculates the curren

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Inertia Oscillator
2 stars

This indicator splits volume into buying and selling portions from candle body and wick proportions, then measures the linear-regression slope of those series over a chosen period. It plots the resulting trend strength in a separate pane as columns or another

Indicator v5 VolumeTrend
Updated 8 months ago · None stated GitHub repository of KINSKI Volume Regression Trend

Apex Ultra Engine v3

by vedkanani123
1 stars

An overlay indicator built on a zero-lag EMA with an ATR trailing stop. It reads market regime from ADX, adds RSI and Stochastic RSI momentum filters, and treats volume or oversized candles as spikes with a cooldown. Entries can display three take profit level

Indicator v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Apex Ultra Engine v3

TnS_ICT_V20

by raybird
1 stars

TnS_ICT_V20 is a Pine Script v6 strategy that identifies institutional trading opportunities using ICT concepts. It calculates pivot swings as support and resistance levels, OTE zones, and a thermodynamic audit based on free energy and fractal entropy to filte

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of TnS_ICT_V20

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance
106 stars

The 3x SuperTrend Strategy combines three SuperTrend indicators, a 200-period Exponential Moving Average trend filter, and a Stochastic RSI oscillator to generate entry signals. Long trades require price to be above the 200 EMA with Stochastic RSI crossing up

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3x SuperTrend Strategy (Mel0nTek)

Trailering N006

by ruckard
13 stars

Trailering N006 is a crypto strategy framework designed for automated execution via Zignaly alerts. It calculates trade signals based on price excursion logic across lookback periods to enter positions with dynamic capital sizing. Key settings allow filtering

Strategy v5 TrendScalping
Updated 1 year ago · None stated GitHub repository of Trailering N006

The Linear Regression Oscillator [ChartPrime] calculates a slope and intercept using linear regression over a specified lookback period, normalizing the values with a 100-period z-score calculation. It plots the normalized oscillator in a separate pane with dy

Indicator v5 TrendOscillators & momentum Repaints
Updated 8 months ago · None stated GitHub repository of Linear Regression Oscillator [ChartPrime]

Extrapolated Previous Trend

by vedkanani123
1 stars

An overlay indicator that fits a linear regression to closing prices of the previous period on a chosen timeframe, such as the prior day, and extends that line into the current period. The line is teal when the slope was up and red when it was down, candles ar

Indicator v5 TrendSupport & resistance
Updated 2 months ago · None stated GitHub repository of Extrapolated Previous Trend

4 MA Strat

by hasnocool
106 stars

Calculates four selectable moving averages (SMA, EMA, WMA, RMA, HMA, or ALMA) with custom periods to generate crossover trading signals directly on the price chart. Signals are triggered when a selected moving average crosses another, with an optional fourth m

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 4 MA Strat

This strategy calculates a 10-period and a 20-period simple moving average directly on the price chart. It triggers long entries on SMA bullish crossovers and short entries on SMA bearish crossunders, formatting alert payloads into JSON string templates for we

Strategy v5 Moving averagesTrend Repaints
Updated 5 months ago · None stated GitHub repository of Messing with Alerts & Calc Every Tick

Grok Apex Flip Engine v1

by vedkanani123
1 stars

An always-in flip indicator on the price chart, written in Pine version 5, where BUY exits a short and enters long and SELL does the reverse. It uses a wide Supertrend-style ATR trail with a cap on how far the trail can move per bar, plus an optional volume-we

Indicator v5 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Grok Apex Flip Engine v1

TnS_IctCombo_V6

by raybird
1 stars

This Pine Script strategy identifies high-confluence trading opportunities using ICT and SMC logic. It calculates a confluence score from HTF bias via EMA, FVG detection with lookback, liquidity sweep confirmation, market structure shift breaks, premium discou

Strategy v6 SMC / ICT / price actionTrend Repaints
Updated 2 months ago · None stated GitHub repository of TnS_IctCombo_V6

4x EMA + Volume

by hasnocool
106 stars

This strategy plots four exponential moving averages on the price chart and filters trades with a smoothed Ease of Movement oscillator. In the default mode it opens a long when price and the four averages are stacked upward and Ease of Movement is positive, th

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 4x EMA + Volume

This indicator reconstructs a low-pass filtered series from the selected source using a discrete Fourier transform. It applies a Hann window over a fixed window of 32, 64, or 128 bars, keeps only the chosen number of lowest-frequency harmonics, and adds their

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Inverse Fast Fourier Transform (IFFT)

This indicator calculates a volatility-adaptive SuperTrend by applying k-means clustering to ATR values over a user-defined training period. It segments historical volatility into high, medium, and low clusters to dynamically adjust the SuperTrend bands to shi

Indicator v5 TrendVolatility & bands
Updated 8 months ago · None stated GitHub repository of Machine Learning Adaptive SuperTrend [AlgoAlpha]

5-10-20 Cross

by hasnocool
106 stars

This strategy combines three exponential moving averages with a Supertrend indicator to generate trend-following trade entries directly on the price chart. A long position is entered when the fastest EMA is above the medium EMA, the medium EMA is above the slo

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5-10-20 Cross

Trailering Q004

by ruckard
13 stars

Trailering Q004 is an execution strategy that generates automated trading signals integrated with Zignaly webhooks. It uses historical statistical advice and price excursion limits to enter long or short positions based on sub-strategy trigger conditions. The

Strategy v5 TrendMean reversion
Updated 1 year ago · None stated GitHub repository of Trailering Q004

Nexus Prime Engine v1

by vedkanani123
1 stars

An overlay always-in flip indicator where a buy closes a short and enters long, and a sell does the reverse. It uses a zero-lag EMA trail sized by ATR, smoothed price, an ADX regime read with trending and sideways thresholds, RSI and Stochastic RSI checks, and

Indicator v5 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Nexus Prime Engine v1

This strategy evaluates multi-factor breakout confluence using a customized scoring system on the price chart. It checks Minervini-style Volatility Contraction Pattern trend templates, TTM squeeze volatility compression, volume dry-up with OBV accumulation, mo

Strategy v6 BreakoutVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Breakout Confluence V6

Volatility Stop

by TWODS-CAPITAL
37 stars

This indicator plots a Volatility Stop on the price chart. It trails a stop from the running high or low of the source, offset by the average true range times a multiplier, and flips the trail when the source crosses the stop. An uptrend colors the stop one wa

Indicator v5 Volatility & bandsTrend
Updated 3 years ago · MIT GitHub repository of Volatility Stop

Trailering S002

by ruckard
13 stars

Trailering S002 is a long-only automated strategy template built for Zignaly webhook execution. It evaluates historical price stats and maximum excursion to trigger long trades, dynamically adjusting capital allocation based on active signal conditions. The sc

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Trailering S002

SMC Luxmod Nuburo4

by alboogycOdR
6 stars

This indicator identifies Smart Money Concepts (SMC) structure directly on the price chart. It detects and plots internal and swing market structures, including Break of Structure (BOS) and Change of Character (CHoCH). The script highlights order blocks, stron

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of SMC Luxmod Nuburo4
2 stars

This indicator applies a k-Nearest Neighbors machine learning algorithm to calculate price predictions and direction on the main chart. It analyzes sequences of historical price data points to locate similar patterns and averages nearest neighbor matches. User

Indicator v5 AI / machine learningTrend Repaints
Updated 8 months ago · None stated GitHub repository of Machine Learning: kNN (New Approach)

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