Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 35)

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

Parabolic SAR

by everget
947 stars

This indicator plots the Parabolic SAR on the price chart using TradingView's built-in SAR function. Direction is long when the SAR sits below the close and short when it sits above. Circles mark the SAR and are colored by that direction. Optional buy and sell

Indicator v6 Trend
Updated 12 days ago · GPL-3.0 GitHub repository of Parabolic SAR
575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener
330 stars

This indicator calculates the Supertrend direction across multiple selected symbols on the active timeframe using custom ATR length and multiplier settings. When the trend switches between bullish and bearish for any enabled asset, the script triggers formatte

Indicator v5 Trend
Updated 2 months ago · None stated GitHub repository of Multi Supertrend [Alorse]
318 stars

This indicator plots three moving averages on the price chart using lengths of 8, 21 and 50 by default. It colors the first average blue, the second maroon and the third red. A translucent fill between the first and second averages turns lime when the first is

Indicator v5 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TVT 3X Scale In Out
257 stars

This strategy overlays the price chart and builds Ichimoku-style Tenkan, Kijun, Chikou, and Senkou values from a ten-bar average of opens. It plots pivot highs and lows as resistance and support circles and reconstructs Heikin-Ashi-like prices from recent open

Strategy v5 TrendSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of Dev - Futures No repaint

This strategy implements a single-layer perceptron machine learning model built from scratch to generate trading signals directly on the price chart. It calculates predictions based on sample size, threshold settings, and optional volatility or volume filters.

Strategy v5 AI / machine learningTrend
Updated 1 year ago · None stated GitHub repository of Machine Learning: Perceptron-Based Strategy [5] (v.3)
104 stars

The ABC and Parabolic SAR Strategy calculates ABC chart patterns using a ZigZag structure alongside Fibonacci retracement levels and a trend cloud formed by six moving averages. It visualizes trend direction and pattern signals directly on the main price chart

Strategy v4 TrendSupport & resistance Repaints
Updated 3 years ago · MIT GitHub repository of ABC and Parabolic SAR Strategy
92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap

EMA Ribbon Overlay

by iamrichardD
57 stars

Calculates exponential moving averages for fast, pivot, and slow lengths along with optional 50, 100, and 200 simple moving average context lines. It visualizes bullish and bearish ribbon fills on the main price chart alongside MACD calculations to generate ea

Indicator v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Overlay

This indicator combines Chaikin Money Flow (CMF), a SuperTrend baseline, and an Average True Range (ATR) calculation inside a separate sub-pane. It calculates a standard 20-period CMF plotted as a line and colored histogram columns around a zero baseline, trac

Indicator v6 TrendVolume
Updated 6 months ago · Apache-2.0 GitHub repository of Institutional View: CMF & SuperTrend

This indicator plots a Bessel-weighted moving average on the price chart. It applies a finite impulse response window whose weights follow a Bessel-style function of a selected order, then normalizes those weights and averages the chosen source over the lookba

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Bessel-Weighted Moving Average (BWMA)
43 stars

This indicator calculates standardized trend strength and historical volatility to estimate position sizes. It computes the differences between three user-defined EMAs standardized by price using MACD logic, while historical volatility is derived from the stan

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility v2
43 stars

This strategy executes trades on short-term cryptocurrency charts using a combination of pivot support and resistance levels and a multi-pole smoothed trend filter. Entries trigger when price crosses the smoothed trend line and confirms above or below a short-

Strategy v5 TrendBreakout Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m - Strategy Candle Bar

Aroon

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the standard Aroon Up and Aroon Down lines in a separate pane. It tracks the number of bars since the highest high and lowest low occurred over a specified lookback period, expressing the values as percentage levels between

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of Aroon
29 stars

Zen EMA Pullback Patterns identifies pullback formations relative to an Exponential Moving Average on the price chart. It detects 3-bar pullbacks consisting of three consecutive bearish bars above the EMA or bullish bars below it, as well as 4-bar micro channe

Indicator v6 Moving averagesCandlestick patterns
Updated 2 weeks ago · MIT GitHub repository of Zen EMA Pullback Patterns
23 stars

This strategy evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses

Strategy v6 TrendVolume Repaints
Updated 4 weeks ago · Custom licence GitHub repository of TradingAlpha Point-Clip Strategy
16 stars

This strategy trades Donchian channel breakouts on the price chart and exits on a shorter Donchian channel. It sizes each unit from a percentage of equity and an ATR-based initial stop, then adds units as price moves a set ATR distance, up to a maximum unit co

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 16: Anti-Chop Filters
16 stars

Smart Money Concepts [LuxAlgo] X CDC overlay indicator visualizes market structure and smart money concepts directly on the price chart. It detects real-time internal and swing market structure events including Change of Character (CHoCH) and Break of Structur

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints

DI Engulfing A002

by ruckard
13 stars

This strategy executes trades based on candlestick engulfing patterns aligned with a 200-period exponential moving average trend filter. It enters long positions when a bullish engulfing candle follows three consecutive bearish candles while price trades above

Strategy v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of DI Engulfing A002
11 stars

Simple Long Term Strategy plots five exponential moving averages on the price chart and trades crossovers between selected averages. It enters long when the first selected average crosses above the fifth and enters short on the opposite cross, only inside the

Strategy v4 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of Simple Long Term Strategy
10 stars

TPCharts Alert EMAs Standard calculates three multi-timeframe Exponential Moving Averages using a user-selected resolution, defaulting to daily data. It computes a shortest, shorter, and longer EMA configured through custom length inputs. The script plots thes

Indicator v4 Moving averagesTrend Repaints
Updated 5 years ago · GPL-3.0 GitHub repository of TPCharts Alert EMAs Standard

Calculates a composite Trend Factor ranging from -100 to +100 alongside a confidence score from five weighted evidence blocks: linear regression slope, trend strength metrics (ADX, Efficiency Ratio, R-squared), swing market structure, volatility quality, and e

Indicator v6 TrendVolatility & bands
Updated 3 days ago · MIT GitHub repository of Bayesian Trend Factor [WavesUnchained]

Keltner Channel Trend - Eterna

by EternaHybridExchange
9 stars

This strategy plots a Keltner channel from an EMA basis and ATR bands on the price chart. It enters long when price crosses back above the lower band while trading above a slower trend EMA, and short when price crosses back below the upper band while below tha

Strategy v5 TrendVolatility & bands
Updated 7 months ago · MIT GitHub repository of Keltner Channel Trend - Eterna

OTE (Optimal Trade Entry)

by muammeryldrm42
7 stars

This strategy draws optimal trade entry zones on the price chart from confirmed swing pivots. A later swing high after a swing low defines an up impulse, and the reverse defines a down impulse. It then marks the 0.62 to 0.79 Fibonacci retracement of that swing

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of OTE (Optimal Trade Entry)

This long-only trend-following strategy combines Ichimoku Kinko Hyo components with higher timeframe moving average filters. It triggers long entries when price trades above a higher timeframe EMA and a bullish Tenkan-Sen cross above Kijun-Sen occurs under fav

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo Momentum Strategy
7 stars

This strategy trades crossovers between a weekly-anchored Volume Weighted Average Price (VWAP) and a 4-hour 90-period exponential moving average. It plots both indicators directly on the price chart. A long position is opened when weekly VWAP crosses above the

Strategy v5 Moving averagesTrend Repaints
Updated 3 years ago · MIT GitHub repository of 4H Bullish Buy 4H Bearish Sell Weekly

This indicator combines a 200-period Exponential Moving Average (EMA), a Stochastic RSI oscillator, and three distinct Supertrend lines utilizing different ATR periods and multipliers. It overlays the EMA and Supertrend tracking lines directly onto the price c

Indicator v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Stochastic + Triple Supertrend

AG Trend-Pullback

by eltonaguiar
4 stars

This strategy trades trend pullbacks on the price chart. It goes long when the 50-period EMA is above the 200-period EMA, price is above the slower average, RSI of length 2 is below 20, and ADX is above 15. Shorts mirror that in a downtrend with RSI above 80.

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Trend-Pullback

MTF MA bands + RSI

by InNoobWeTrust
4 stars

This indicator plots multi-timeframe moving average bands alongside a Relative Strength Index in a separate pane. It calculates up to four configurable moving averages across different timeframes, offering selectable types such as SMA, EMA, and WMA with colore

Indicator v6 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of MTF MA bands + RSI
4 stars

This strategy builds Chandelier trailing stops from the highest high and lowest low over an ATR window, offset by an ATR multiple. The long stop only ratchets up and the short stop only ratchets down. Direction turns long when the close exceeds the prior short

Strategy v6 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of Chandelier Strategy [trugurpala]
4 stars

Ichimoku Cloud — Large Cap is a long-only trend-following strategy designed for large-cap stocks. It calculates standard Ichimoku components, including Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span. Trades enter on a bullish Tenkan/Kijun

Strategy v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of Ichimoku Cloud — Large Cap
4 stars

This indicator plots a fast and a slow moving average on the price chart and marks bullish and bearish crossovers. The user can choose SMA, EMA, RMA, or WMA, the price source, and both lengths. Triangle shapes appear below or above the bar at each crossover, a

Indicator v5 TrendMoving averages
Updated 11 months ago · Custom licence GitHub repository of MA Crossover Indicator [Lab]

Trend Finder w/ COV

by kevinhhl
4 stars

This indicator measures price volatility using the Coefficient of Variation, calculated by dividing the standard deviation by the simple moving average over a specified lookback period. It filters out ranging market conditions by comparing the current variatio

Indicator v5 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of Trend Finder w/ COV

MACD Indicator (14,21)

by might-tree
4 stars

This script plots three MACD lines calculated from exponential moving averages on the close price. The first line subtracts the 14-period EMA from the 21-period EMA, the second subtracts the 41-period EMA from the 90-period EMA, and the third subtracts the 90-

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of MACD Indicator (14,21)
4 stars

Snagprofit Buy Sell is an overlay trend-following indicator that calculates smoothed triple exponential moving averages (TMA) based on Heikin-Ashi and standard price inputs. It plots two trend lines directly on the chart and fills the space between them in gre

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snagprofit Buy Sell
3 stars

This strategy plots a 12-line moving average rainbow directly on the price chart using customizable types such as EMA, SMA, RMA, WMA, HMA, or VWMA. It enters positions based on moving average alignment and turnover signals across the ribbon. Exits are managed

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Moving Average Rainbow (Stormer)

TQQQ TSI Divergence

by yalili8521
2 stars

This strategy identifies hidden bullish and bearish divergences between price pivots and the True Strength Index (TSI) indicator. It incorporates an Exponential Moving Average (EMA) trend filter and a customizable trading session time window. Long positions en

Strategy v6 Oscillators & momentumDivergence
Updated 9 days ago · None stated GitHub repository of TQQQ TSI Divergence
2 stars

The GMMA indicator plots two groups of exponential moving averages on the price chart. The short-term group uses EMAs with periods 3, 5, 8, 10, 12 and 15. The long-term group uses EMAs with periods 30, 35, 40, 45, 50 and 60. The two groups are colored blue and

Indicator v6 Moving averagesTrend
Updated 12 days ago · MIT GitHub repository of GMMA = Guppy Multiple Moving Average
2 stars

This indicator tracks multi-timeframe market structure across up to four user-defined timeframes in a separate pane. It identifies structural changes through Break of Structure (BoS) and Change of Character (CHoCH) events derived from pivot highs and lows. Use

Indicator v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of Market Structure MTF Trend [Pt]

Zeguela Demabot

by danielvm-git
2 stars

This strategy calculates and plots up to three Double Exponential Moving Averages directly on the price chart. It signals entries based on DEMA crossovers and crossunders, using an optional third moving average as a directional trend filter. Position sizing al

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Zeguela Demabot

Heikin Ashi Supertrend

by wynnforthework
2 stars

This strategy applies a Supertrend calculation to Heikin Ashi price data to identify trend direction and potential market reversals. It executes trades based on Supertrend trend shifts and incorporates an On-Balance Volume filter. Risk management includes a co

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Heikin Ashi Supertrend

Neural Network

by iceberg211
2 stars

Calculates composite scoring across multiple technical indicators including EMAs, SuperTrend, Parabolic SAR, Hull Moving Average, RSI, MACD, WaveTrend, Stochastic, Bollinger Bands, and ATR. Trading entries trigger on the price chart when cumulative weighted sc

Strategy v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Neural Network

MA Based Trend BarColor

by ryangaraygay
2 stars

MA Based Trend BarColor plots three configurable moving averages directly on the price chart. Users can customize the calculation type (SMA, EMA, or VWMA), source price, and lookback length for fast, medium, and slow periods. The script evaluates the stacked a

Indicator v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of MA Based Trend BarColor

Trading Rush Choppy Market

by theupslidedown
2 stars

Trading Rush Choppy Market identifies trending versus choppy market conditions based on consecutive bar close price movements. It evaluates sequences of higher or lower closes over the previous six bars to assign trend strength levels. When conditions indicate

Indicator v5 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of Trading Rush Choppy Market
2 stars

This indicator detects trend changes and divergences using a Zigzag tool combined with an oscillator such as RSI or external sources. It plots zigzag lines on the price chart to mark potential trend reversals and identifies regular and hidden divergences. The

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MIT GitHub repository of Zigzag Trend/Divergence Detector

Trend Signal (Honest)

by nvolpe2007-cell
1 stars

A simple trend indicator that compares the close with a long moving average, 100 bars by default, and a hysteresis band of two percent to reduce whipsaws. A buy appears when price closes above the band and a sell to cash when it closes below. The moving averag

Indicator v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Trend Signal (Honest)

EMA Trend Strategy

by jayadevrana
1 stars

Calculates a 9-period fast EMA, 21-period slow EMA, and 200-period trend EMA overlaid on the price chart. It enters long positions when the fast EMA crosses above the slow EMA while price is above the 200 EMA, and short positions when the fast EMA crosses belo

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of EMA Trend 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