Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 40)

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

SR+Trend v6 APT

by MuhammadMuhamid
1 stars

A long-only strategy preset tuned for one crypto pair, using multi-timeframe pivot support and resistance with tighter touch zones and shorter retest windows than the other versions. It can flip broken resistance into support and supports optional moving avera

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of SR+Trend v6 APT

Market Sniper

by kasutu
1 stars

A combined chart overlay that plots EMAs of 20, 50 and 200 bars with a zone around the middle line, an Ichimoku cloud with 9, 26 and 52 bar settings, and order blocks that can show as mitigated. It also marks bullish and bearish break of structure lines, break

Indicator v5 SMC / ICT / price actionTrend
Updated 2 weeks ago · None stated GitHub repository of Market Sniper
1 stars

The Fractal Field Smoother calculates Williams Fractals based on price high and low pivot points over a user-defined period. It measures price distance and center points between consecutive fractals, using array storage to calculate smoothed field levels and b

Indicator v6 Support & resistanceTrend
Updated 7 weeks ago · None stated GitHub repository of Fractal Field Smoother

MAD Supertrend

by vedkanani123
1 stars

A separate-pane indicator that builds a Supertrend-style trailing channel from median absolute deviation instead of ATR, scaled to standard-deviation units. The centerline can be the source, a single median or a double median, and upper and lower multipliers a

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of MAD Supertrend

This indicator evaluates and scores trade signal quality using a four-layer filtering process drawn directly on the main chart. It evaluates volume spikes against a moving average, higher-timeframe EMA trend alignment, price breaches beyond ATR volatility band

Indicator v6 Volatility & bandsVolume Repaints
Updated 2 months ago · None stated GitHub repository of TeleNexus Fakeout Signal Quality

Zig Zag Channels

by VVASILEVSS
1 stars

A Pine v4 overlay that draws a zig-zag between swing highs and lows found with a highest and lowest close test over a set length, default 100. For each leg it adds dotted upper and lower channel lines offset by the largest deviation of price from the leg, and

Indicator v4 Support & resistanceTrend Repaints
Updated 3 months ago · None stated GitHub repository of Zig Zag Channels

Kalman Trend Levels

by tthanhvu002sgu
1 stars

Applies two Kalman filters, a short one at 50 bars and a long one at 150 by default, to closing price on the price chart. Trend turns up when the short filter is above the long one and down in the opposite case. Labels mark each turn with the close, and boxes

Indicator v5 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Kalman Trend Levels

STT SR TMA Scale Plan

by majohnst
1 stars

The STT SR TMA Scale Plan is an intraday trading strategy that overlays price charts to execute trades based on Triangular Moving Average (TMA) crossings, VWAP breakouts, and support/resistance levels like daily pivots or Anchored VWAP. Entries are restricted

Strategy v6 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of STT SR TMA Scale Plan

Supertrend

by riegodavid-git
1 stars

An overlay port of the classic Supertrend indicator. It builds upper and lower bands from a price source, by default hl2, plus or minus an ATR multiple, and flips the trend when the close crosses the opposite band. A green line is drawn under price in an uptre

Indicator v6 TrendVolatility & bands
Updated 4 months ago · None stated GitHub repository of Supertrend
1 stars

This strategy identifies breakout opportunities in Bursa Malaysia stocks using a slow EMA trend filter where price exceeds the 150-period EMA and the slow EMA is above its 150 EMA. It plots fast and slow EMAs on the price chart. Entry occurs on a new 20-day hi

Strategy v5 BreakoutMoving averages
Updated 4 months ago · None stated GitHub repository of KLSE VCP Breakout Backtest
1 stars

This strategy plots a volume-weighted moving average, a Hull moving average, and a linear regression on the price chart. It enters long when the Hull average crosses above the volume-weighted average while stochastic is above 50, on-balance volume is rising, m

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Advanced Indicator Suite

Talons Supertrend + ADX

by muammeryldrm42
1 stars

A strategy that trades Supertrend direction flips when ADX is above a threshold. A flip to uptrend with strong ADX opens a long, and a flip to downtrend opens a short, one position at a time. The Supertrend line is the initial stop and the take profit is 2.5 t

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Talons Supertrend + ADX

An overlay toolkit for crypto charts combining a volume profile, anchored VWAP, optional EMA lines, a higher-timeframe EMA bias and an order flow proxy from lower-timeframe delta, relative volume and cumulative delta, with price action checks from swing pivots

Indicator v6 VolumeSupport & resistance
Updated 5 months ago · MIT GitHub repository of Crypto AMT Toolkit v7.3 Auto Performance
1 stars

This intraday trading strategy combines fast, slow, and trend exponential moving averages with MACD, RSI, and ADX filters to generate trade signals during active trading sessions. It enters long positions when the fast EMA crosses above the slow EMA above the

Strategy v6 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Señales Intradía EMA + MACD v3
1 stars

An indicator on the price chart that draws a Supertrend-style band around a Kalman-type smoothed price. The Hurst exponent, estimated by variance scaling over a lookback, adjusts both the smoother gain and the ATR multiplier, so the band widens in choppy condi

Indicator v6 TrendVolatility & bands
Updated 6 months ago · None stated GitHub repository of Hurst Exponent Adaptive Supertrend
1 stars

Slow & Steady is a swing trading strategy that identifies trend direction using aligned EMAs of 50, 100, and 200 periods. It generates buy and sell signals when the MACD line crosses its signal line within a confirmed trend, filtered by ADX strength. Entries c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Slow & Steady - Swing Strategy

4x4 Futures Ghost Matrix

by knectardev
1 stars

This indicator generates intraday trading signals by combining dual-sigma standard deviation bands, Heikin Ashi candle vectors, and a four-bar confluence score. It triggers long and short signals during defined trading sessions using either mean-reversion boun

Indicator v5 Volatility & bandsMean reversion
Updated 9 months ago · None stated GitHub repository of 4x4 Futures Ghost Matrix
1 stars

This indicator calculates custom moving average convergence divergence values using selectable calculation methods, fast and slow lengths, source prices, and signal smoothing types. It plots an oscillator on the price chart with customizable vertical placement

Indicator v5 Oscillators & momentumMoving averages Repaints
Updated 9 months ago · None stated GitHub repository of MACD-X Overlay, More Than MACD
1 stars

Marks trend changes on the price chart using price against 20 and 50 period simple moving averages. A bullish trend needs the close above both and a bearish trend below both. A strict alternating rule allows a buy only after a sell and the reverse, so signals

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of RAPF v6.6 [Strict No-Repeat]

Hull Suite by InSilico

by turnupdigital
1 stars

An indicator that plots a Hull moving average on the price chart, with a choice of Hma, Thma or Ehma variants and an adjustable length and multiplier. The current value and the value two bars back form a band that is filled and coloured by trend direction, and

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Hull Suite by InSilico

TeeLek Hedging Ribbon

by theteelek
1 stars

An overlay indicator with no settings that draws coloured Hull moving average lines taken from 2-hour and 30-minute data, smoothed with EMAs. Lines turn grey, green or red depending on slope and on their position against a long-term floor derived from a 600-ba

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TeeLek Hedging Ribbon
1 stars

Despite its name, this strategy does not build a volume profile. It flags bars where volume exceeds a moving average of volume times a threshold, then goes long when the close is also above a 20-period simple moving average and the close of the oldest bar in t

Strategy v5 VolumeTrend
Updated 1 year ago · None stated GitHub repository of Volume Profile Strategy
1 stars

A separate-pane histogram that shows a fast trend above zero and a slow trend below zero, each as colored bars. The fast trend uses 21, 55 and 89 period simple averages and the slow trend uses 3, 8 and 20 period averages. Green means a bullish stack, yellow a

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Trend Histogram (Fast and Slow)

Super Trend + MACD

by akash-yellgetti
1 stars

A strategy script that combines a custom ATR-based Supertrend calculation with MACD line and signal crossovers. It draws green triangles for MACD bullish crosses, red triangles for bearish crosses, and separate triangles for the Supertrend direction on the pri

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Super Trend + MACD

DMI & ADX

by JohnsonHsiao
1 stars

This indicator computes and plots the Directional Movement Index and Average Directional Index using Pine Script's built-in DMI function. It renders the positive directional indicator (+DI), negative directional indicator (-DI), and the ADX line in a separate

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of DMI & ADX

SAMA

by rajatjpatel
1 stars

A smoothed moving average drawn on the price chart. Before averaging, each price is clamped inside a narrow standard deviation channel built around a short weighted average, which limits the effect of sharp spikes. The clamped price then goes through two weigh

Indicator v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SAMA
1 stars

This Pine v4 strategy trades a crossover of a 10-period and a 30-period simple moving average. It enters long on an upward cross when RSI is above 50 and short on a downward cross when RSI is below 50, with a fixed order quantity. Each entry gets a stop loss a

Strategy v4 TrendMoving averages Archived
Updated 4 years ago · None stated GitHub repository of Take Profits and Stop Losses
1 stars

This indicator is a Chandelier Exit style trailing stop, similar to a Supertrend, calculated from Heikin Ashi candles rather than the current chart candles. A long stop trails below the highest recent close and a short stop trails above the lowest, each offset

Indicator v5 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of Chandelier Exit Heikin Ashi Signal
1 stars

The EOSBTC EMA Cross Strategy evaluates price action relative to an Exponential Moving Average (EMA) on the main price chart. It enters a long position when a candle opens above the EMA and closes green, and enters a short position when a candle opens below th

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of EOSBTC EMA Cross Strategy
947 stars

This indicator calculates a moving average where historical prices are weighted according to a sine function over a user-defined length. It plots directly on the price chart, coloring the line based on whether the slope is rising or falling. Optional settings

Indicator v6 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Sine Weighted Moving Average
330 stars

This strategy plots a multi-timeframe exponential moving average on the price chart while evaluating momentum using the Relative Strength Index. It enters long positions when price exceeds the moving average by at least one percent and RSI crosses above the ov

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of RSI + 1200 Strategy [Alose]

ADX Histogram

by harryguiacorn
220 stars

This indicator calculates and displays the Average Directional Index (ADX) as a column histogram in a separate pane. It evaluates market trend strength by calculating directional movement metrics based on specified smoothing and DI length inputs. When the ADX

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Histogram

5 Minute EMA Strategy

by hasnocool
106 stars

5 Minute EMA Strategy is a trend-following system designed for short timeframes that executes trades around moving average crossovers. It plots fast and slow moving averages (supporting EMA, SMA, RMA, or WMA) directly on the price chart. Users can enable an op

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 5 Minute EMA Strategy

Aroon Oscillator

by mihakralj
99 stars

Aroon Oscillator calculates the difference between Aroon Up and Aroon Down across a user-defined lookback period. It plots the resulting oscillator line between -100 and +100 in a separate pane, alongside horizontal reference levels at 0 and plus or minus 50,

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

This indicator plots five moving averages of a chosen source on the price chart, defaulting to EMA lengths 10, 20, 30, 40 and 50. The user can switch the average type to SMA, WMA or HMA and recolor each line. Wide translucent glows sit under the lines, and sof

Indicator v5 TrendMoving averages
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Rainbow MA Ribbon 10-50

MS+MACD Enhanced Tests

by iamrichardD
57 stars

This script implements an enhanced testing framework for the Market Structure MACD 4H strategy. It defines test cases with pass rates and includes mock functions simulating advanced market structure detection, MACD sensitivity analysis across trending and chop

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of MS+MACD Enhanced Tests

Power Of Index with Trendline Pivots, EMA, and RSI overlays Smart Money Concepts market structure analysis directly on the price chart. It identifies internal and swing market structure shifts, such as Break of Structure and Change of Character patterns. The s

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints

V1 Binancash - Futures Strategy 1M Candles is an intraday trading strategy designed for 1-minute cryptocurrency futures charts. It calculates dynamic support and resistance levels using pivot highs and lows, combined with a custom smoothed trend filter and a 3

Strategy v5 TrendSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of V1 Binancash - Futures Strategy 1M Candles
29 stars

This indicator detects swing highs and lows to plot bull and bear trendlines directly on the main price chart. It projects valid trendlines forward while applying rules for maximum slope, bar span, and average bar range tolerance to filter out invalid or broke

Indicator v6 TrendSupport & resistance
Updated 2 weeks ago · MIT GitHub repository of Zen Swing Trendlines

VWMA Band

by tistaharahap
25 stars

The VWMA Band indicator calculates volume-weighted moving averages based on high, low, median (HL2), and close prices over a specified period. It plots an upper band, lower band, median line, and close VWMA directly on the main price chart with a translucent c

Indicator v4 Moving averagesVolatility & bands
Updated 6 years ago · None stated GitHub repository of VWMA Band

HG Strat

by benso87
24 stars

This strategy implements an ADX trend-following system with moving average pullbacks. It identifies strong market momentum when the Average Directional Index exceeds a chosen threshold, then monitors price retests of an exponential or simple moving average. Lo

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of HG Strat

This indicator modifies Perry Kaufman's Adaptive Moving Average by integrating John Ehlers' dominant cycle detection. It filters the selected price source with a high-pass filter and a super smoother, then evaluates Pearson correlation across multiple lags to

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Perry J. Kaufman - Adaptive Moving Average - Modified
16 stars

This strategy implements Turtle System 1 fast trend following directly on the price chart. It opens long or short positions upon 20-bar Donchian channel breakouts and exits on opposing 10-bar Donchian extremes. Position sizing is calculated dynamically from AT

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 1: Fast Breakout (S1)

Trend Compass 4H

by chris-c-thomas
14 stars

Trend Compass 4H plots a multi-EMA ribbon (10/21/50) along with higher-timeframe reference levels on the price chart. It classifies trend phase into six states and calculates a composite weighted trend score. The script detects RSI and MACD divergences, analyz

Indicator v6 TrendMoving averages
Updated 6 months ago · MIT GitHub repository of Trend Compass 4H

The Candle Story Engine evaluates multi-candle price action dynamics, analyzing pressure, sequence persistence, deceleration, and structural exhaustion across a customizable lookback window. Incorporating optional trend context via exponential moving averages,

Indicator v6 Candlestick patternsBreakout
Updated 3 days ago · MIT GitHub repository of Candle Story Engine [WavesUnchained]

Parabolic SAR - Eterna

by EternaHybridExchange
9 stars

Calculates the Parabolic Stop and Reverse (SAR) indicator paired with an optional Exponential Moving Average (EMA) trend filter. A long position is triggered when price crosses above the SAR while remaining above the trend EMA. A short position is entered when

Strategy v5 TrendMoving averages
Updated 7 months ago · MIT GitHub repository of Parabolic SAR - Eterna

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