Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 4)

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

4 stars

This strategy plots three exponential moving averages on the price chart and uses RSI for exits. It opens a long when the fastest EMA crosses above the middle EMA while remaining above the slowest EMA and the bar closes above its open. Shorts use the opposite

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Tendency EMA + RSI [Alorse]

Trix Strategy V2

by CryptoRobotFr
4 stars

This strategy trades trend continuations using a triple moving average oscillator (TRIX) and a long-term moving average baseline. It opens long positions when price is above the long moving average and the TRIX histogram crosses above zero, and opens short pos

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Trix Strategy V2

UT Bot Alerts

by AntSan813
4 stars

This indicator implements the UT Bot Alerts system by tracking price action against an Average True Range trailing stop line directly on the price chart. It calculates volatility bands using user-defined ATR length and sensitivity multiplier parameters. When t

Indicator v4 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of UT Bot Alerts
4 stars

Davids Ichimoku Cloud Break is an overlay strategy that generates trade signals based on Ichimoku Cloud breakout conditions combined with an optional MACD entry filter. It calculates and plots the Conversion Line, Base Line, Lagging Span, and Leading Spans dir

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Davids Ichimoku Cloud Break

ARANLAR

by Kalumur
4 stars

ARANLAR is an overlay indicator that combines a Tillson T3 moving average, WMA crossover signals, price channel boundaries, and dynamic Fibonacci retracement levels. It plots a color-coded T3 line to show short-term trend direction and triggers buy (AL) or sel

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of ARANLAR

Supertrend EMA Strategy

by mohammad95labbaf
4 stars

Supertrend EMA Strategy is a chart overlay indicator that combines Supertrend trailing levels with an Exponential Moving Average filter to identify entry signals. Buy signals occur when the Supertrend turns bullish while price trades above the specified EMA, w

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Supertrend EMA Strategy
4 stars

This strategy executes trend-following trades based on Bollinger Band breakouts confirmed by a long-term moving average filter. A long position opens when the price crosses above the upper Bollinger Band, provided the band spread meets a minimum threshold and

Strategy v5 Volatility & bandsTrend
Updated 2 years ago · None stated GitHub repository of Bollinger Trend - Strategy V1

STPP20 + ADX

by rKv4dr4t
4 stars

This strategy combines a Pivot Point SuperTrend with an Average Directional Index (ADX) filter and a 21-period simple moving average. It enters long positions when the close crosses above the SuperTrend trailing band while remaining above the moving average an

Strategy v4 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of STPP20 + ADX
4 stars

This overlay strategy combines a Supertrend with a k-nearest-neighbors filter. It smooths price and the Supertrend with weighted moving averages, then uses neighbor count and lookback length to form an AI trend signal. Traders can allow long, short, or both di

Strategy v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of AI Volume Supertrend Strategy
4 stars

Calculates a 5-period Exponential Moving Average (EMA) to identify short and long trade setups based on price distance from the average. It triggers entries when price breaks the high or low of an alert candle that formed completely outside the 5 EMA. The stra

Strategy v5 Moving averagesBreakout
Updated 3 years ago · None stated GitHub repository of 5 EMA Strategy: Power of Stocks
4 stars

This strategy plots custom upper and lower bands on the price chart using configurable moving average types and deviation multipliers. It opens long or short positions when price crosses above or below these envelopes, with optional RSI oscillator filters for

Strategy v5 Volatility & bandsMoving averages
Updated 4 years ago · MIT GitHub repository of Bollinger Bands Strategy
4 stars

Snag - Detect Bull Bear is an indicator that identifies bull and bear market phases on the price chart. It uses a customizable ZigZag to detect trend reversals, tracking high and low points. The script applies Fibonacci-based rules to confirm breakout shifts b

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Snag - Detect Bull Bear
4 stars

Leonidas Trend Following System is a trend following indicator that plots key, long-term, and short-term exponential moving averages directly on the price chart. It calculates trend signals through EMA crossovers and price changes relative to the center line,

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Leonidas Trend Following System

EMA and ADX v1

by aofwittawat
4 stars

This indicator calculates an Exponential Moving Average (EMA) and an Average Directional Index (ADX) to signal trend entries and exits directly on the price chart. It triggers a long signal when the close is above the EMA and a short signal when below, optiona

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of EMA and ADX v1

This strategy plots three EMAs (50, 100, 200) on the price chart for crossover signals. Long entries occur when fast EMA crosses above mid EMA and close exceeds slow EMA; short entries when fast crosses below mid and close is below slow. It uses ATR trailing s

Strategy v4 Moving averagesTrend
Updated 5 years ago · MIT GitHub repository of Algo Trading Simple 3-EMA Strategy + Trailstop

Supertrend MTF Heikin Ashi

by setyadhiputrad
4 stars

This indicator calculates and plots Supertrend lines based on Heikin Ashi price data for both the current chart timeframe and a higher timeframe. It determines trend direction by comparing prices against ATR-derived upper and lower bands, shifting colors and p

Indicator v4 TrendVolatility & bands
Updated 5 years ago · GPL-3.0 GitHub repository of Supertrend MTF Heikin Ashi

CMYK RMI SMA

by myn
4 stars

CMYK RMI SMA is a multi-period strategy combining three distinct Relative Momentum Index (RMI) oscillators—Alpha, Beta, and Gamma—with Simple Moving Average (SMA) trend filters. It evaluates short, medium, and long-term momentum alongside SMA trend phasing to

Strategy v4 Oscillators & momentumTrend
Updated 6 years ago · Apache-2.0 GitHub repository of CMYK RMI SMA

ALMA Tarama

by gocaman
3 stars

This indicator plots an Arnaud Legoux moving average on the price chart and colors it by slope. It marks an entry label when the average turns up and an exit label when it turns down, and it fires matching alerts. A separate exponential moving average is drawn

Indicator v5 Moving averagesTrend
Updated yesterday · None stated GitHub repository of ALMA Tarama

OPTD ORB Strategy

by drewautomates
3 stars

The OPTD ORB Strategy detects an opening range from a user-defined session window on the chart timeframe. It waits for a specified number of consecutive closes beyond the range high or low on a separate signal timeframe to generate a long or short entry. The d

Strategy v6 BreakoutSessions & time
Updated yesterday · Custom licence GitHub repository of OPTD ORB Strategy

Zig Zag Labeler

by northis
3 stars

Calculates and plots zigzag swing lines directly on the price chart based on user-defined deviation and depth settings. It allows traders to number recent swing segments and assign specific Elliott Wave structural models, including impulses, zigzags, and diago

Indicator v6 Support & resistanceTrend Repaints
Updated 4 days ago · MIT GitHub repository of Zig Zag Labeler
3 stars

The strategy plots SuperTrend and ADX indicators directly on the price chart. It generates long signals on SuperTrend bullish flips combined with ADX above the set threshold and closes positions on SuperTrend bearish flips or when stop-loss or take-profit leve

Strategy v5 TrendOscillators & momentum
Updated 12 days ago · None stated GitHub repository of OctaStack SuperTrend + ADX

JCO Swings Trend HTF

by jcornierfra
3 stars

This Pine Script indicator detects swing highs and lows on a higher timeframe while analyzing the current chart timeframe. It calculates trend direction using swing structures with bullish or bearish momentum and compression status. CHoCH detection identifies

Indicator v6 TrendSMC / ICT / price action
Updated 12 days ago · None stated GitHub repository of JCO Swings Trend HTF

Adaptive Moving Average

by AkashSasikumar47
3 stars

Adaptive Moving Average (AMA) is a trend-following indicator that dynamically adjusts smoothing based on recent price volatility. It blends a fast EMA (default length 2) with a slow EMA (default length 30) using an adaptive multiplier derived from the highest

Indicator v6 TrendMoving averages
Updated 2 weeks ago · MIT GitHub repository of Adaptive Moving Average

Basic Strategy Scaffold

by jpantsjoha
3 stars

This strategy enters long when a fast EMA crosses above a slow EMA and short when it crosses below, only after the bar is confirmed. It sizes each order as a percentage of equity and exits with a percentage stop and a percentage target measured from the averag

Strategy v6 TrendMoving averages
Updated 3 weeks ago · Custom licence GitHub repository of Basic Strategy Scaffold

This indicator plots buy and sell signals on the price chart overlay using Supertrend as the primary trend filter combined with multiple moving average crossover strategies. Users select from preset modes or enable custom combinations via toggles for 12 differ

Indicator v6 TrendMoving averages
Updated 5 weeks ago · MIT GitHub repository of Quantum Queen X + Supertrend Signal
3 stars

This strategy implements a daily Bitcoin trend-following system combining exponential moving averages (EMA 25, 52, and 144) with daily and 4-hour MACD indicators. It triggers long and short positions based on EMA alignments, zero-line momentum segments, and hi

Strategy v5 TrendOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of BTC 1D MACD 回测对比

KatanaFlow

by 7mertyavuz
3 stars

KatanaFlow is a trend-following overlay indicator that combines a Twin Range Filter with a smoothed moving average line to identify market direction and signal reversals. It calculates adaptive volatility bands using dual-period range smoothing to filter out p

Indicator v6 TrendVolatility & bands
Updated 3 months ago · MIT GitHub repository of KatanaFlow

Cyber HUD XAU

by panzmoravylab
3 stars

Cyber HUD XAU is an overlay indicator designed for XAUUSD that combines trend, momentum, and volatility filters. It calculates fast and slow ATR ratios alongside local price ranges to detect consolidation and chop filter states. The script evaluates candle bod

Indicator v6 Volatility & bandsOscillators & momentum
Updated 4 months ago · None stated GitHub repository of Cyber HUD XAU
3 stars

The Buy/Sell Position Strategy combines a long-term Exponential Moving Average (EMA) with a short-term Relative Strength Index (RSI) to capture pullbacks in an uptrend. It enters a long position on the price chart when the price is above the EMA filter and the

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · None stated GitHub repository of Buy/Sell Position Strategy

MTF Confluence Dashboard

by WiseManAlgo
3 stars

This indicator calculates a multi-timeframe trend and momentum score across five configurable timeframes for up to three symbols. It evaluates price relative to a fast EMA along with RSI momentum, weighting each timeframe to generate a normalized confluence sc

Indicator v5 Screeners & dashboardsTrend
Updated 4 months ago · None stated GitHub repository of MTF Confluence Dashboard

GainzAlgo EA

by saadkhan371
3 stars

GainzAlgo EA is a trend-following strategy designed for scalping and intraday trading, optimized for gold and liquid assets. It establishes trend direction using a three-EMA alignment alongside RSI momentum filters and an optional higher-timeframe trend confir

Strategy v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of GainzAlgo EA

RitstaR-Algo

by ritstar
3 stars

This overlay indicator scores each confirmed bar from zero to six using fast, slow, and trend EMAs, higher-timeframe bias, RSI, MACD, ATR, and volume. It plots buy and sell labels when the score meets the minimum entry threshold and exit labels when the opposi

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of RitstaR-Algo
3 stars

%R Trend Exhaustion is a momentum and trend exhaustion indicator based on dual-period Williams %R calculations. It combines a standard fast %R with a slow-period %R to identify extended trends and subsequent exhaustion breaks around overbought and oversold thr

Indicator v6 Oscillators & momentumTrend Repaints
Updated 12 months ago · None stated GitHub repository of %R Trend Exhaustion [upslidedown]

Supertrend Strategy

by dharaarpan7
3 stars

This strategy executes long trades based on the Supertrend indicator and candle color confirmation. It enters when a fresh bullish Supertrend flip occurs on a green candle and exits when the trend flips bearish on a red candle. It also places bracket orders wi

Strategy v6 TrendVolatility & bands
Updated 1 year ago · MIT GitHub repository of Supertrend Strategy

Crypto Bull Market Strategy

by EngineeredSuccess
3 stars

Crypto Bull Market Strategy is a long-term Bitcoin cycle indicator overlaying price targets and trend phase tracking on the price chart. It calculates a 50-week simple moving average to evaluate long-term market trends and monitors progress toward user-defined

Indicator v6 TrendMoving averages
Updated 1 year ago · Custom licence GitHub repository of Crypto Bull Market Strategy
3 stars

This indicator plots a fast and a slow exponential moving average on the price chart and marks buy and sell signals for Bitcoin scalping. A buy appears when the fast EMA crosses above the slow EMA, RSI is above its buy threshold, the MACD line is above its sig

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · MIT GitHub repository of BTC 1–5 min Scalping Signals

ATR-SB Algo

by TheMikerik
3 stars

This indicator tracks market trends using an ATR trailing line derived from close prices and a risk multiplier, inspired by the UT Bot algorithm. It plots the trailing line directly on the price chart, identifies bullish and bearish regime flips, highlights si

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of ATR-SB Algo

Golden Strategy

by AliAhmadi-Software
3 stars

The Golden Strategy is a Pine Script v6 strategy that overlays EMA and SMA on the price chart to detect crossovers for trend direction. It adds MACD for momentum confirmation and RSI to identify overbought and oversold conditions. Volume average filters out lo

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Golden Strategy

Cipher A

by diehardyearone
3 stars

Cipher A is a trend-following overlay indicator that plots a multi-line moving average ribbon alongside long-term moving averages, VWAP, and higher-timeframe weekly and monthly key levels directly on the price chart. It incorporates underlying WaveTrend, RSI,

Indicator v6 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Cipher A

This strategy combines volume surge detection, Fibonacci retracements, moving averages, and ATR volatility for trade execution. Long positions trigger when price exceeds the 0.618 Fibonacci level, price stays above a 200-period SMA, a fast EMA crosses above a

Strategy v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of Optimized Volume + Fibonacci + Trend + ATR Strategy

Pivot Points

by roshaneforde
3 stars

The Pivot Points indicator plots horizontal lines on the price chart to mark bullish and bearish pivot points. It identifies shifts from bullish to bearish or vice versa by scanning the last 100 candles by default. Buy lines appear in blue and sell lines in re

Indicator v6 Support & resistanceTrend
Updated 1 year ago · MIT GitHub repository of Pivot Points

200DMA Entry

by FinDeckDao
3 stars

The 200DMA Entry strategy plots the 200-day simple moving average on the price chart. It generates long signals when the close crosses above the 200 MA on the prior bar. Positions are sized at 1 percent of account equity. The strategy exits at a 2.5 times take

Strategy v5 Moving averagesTrend
Updated 1 year ago · MIT GitHub repository of 200DMA Entry

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