Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 26)

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

TrendGlow

by RobACurtis
1 stars

TrendGlow is a price-chart indicator that recolors candles according to a bullish, bearish, or sideways trend. It imports a BullBear library and can combine Stochastic RSI, MACD, and SMA checks on a user-selected timeframe through request.security. Users toggl

Indicator v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of TrendGlow
1 stars

Calculates and plots customizable Ichimoku Kinko Hyo components directly on the price chart. It provides options to display standard Ichimoku lines including Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span, as well as an overlay for the Ic

Indicator v5 TrendSupport & resistance
Updated 3 years ago · MIT GitHub repository of Woverine - Ichimou & Cloud
1 stars

A long-only strategy designed for the 4-hour chart. It averages open, high, low and close, smooths that with a mid-term SMA and builds a relative strength line from the gap between price and the SMA. When the slope of that line turns positive it places a limit

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · GPL-3.0 GitHub repository of Relative Strength Strategy (4h)

Money Printer Go BRRR 2.0

by sourdiesel1202
1 stars

A separate-pane indicator that calls an imported helper library to test SMA, MACD, RSI and DMI conditions for long and short setups, plus an ADX check. It plots a green line at 1 when all four long conditions are true and a red line at minus 1 when all four sh

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · None stated GitHub repository of Money Printer Go BRRR 2.0

MA Cross

by jubayernil
1 stars

This indicator calculates three Simple Moving Averages with periods of 55, 89, and 233 on closing prices and overlays them directly on the price chart. It evaluates a specific bearish crossover pattern where the 55-period fast moving average drops below the 89

Indicator v4 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of MA Cross

Combo2

by 0xfffangel
1 stars

A combined overlay that bundles several tools in one script. It draws three median-based high/low lines that flip between green and red as price crosses them, support and resistance levels from pivot bars with an optional higher timeframe, Fibonacci levels ove

Indicator v4 TrendSupport & resistance Repaints
Updated 4 years ago · None stated GitHub repository of Combo2
1 stars

A Pine v4 strategy that plots a 30-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 ADABTC EMA Cross Strategy

Generic Strategy

by rocketbrainsurgeon
1 stars

This strategy is a bare template that crosses a fast 15-period and a slow 45-period exponential moving average of the bar midpoint. It enters long on an upward cross and short on a downward cross, reversing between the two, and starts trading from a date set b

Strategy v4 Moving averagesTrend
Updated 5 years ago · GPL-3.0 GitHub repository of Generic Strategy

Chop Zone

by DT021
1 stars

Chop Zone measures the slope of a 34-period exponential moving average of the close. It scales the one-bar EMA change by the average price and a 30-bar high-low range, converts that slope into degrees, and paints a single column in a separate pane. Turquoise t

Indicator v4 TrendMoving averages
Updated 6 years ago · GPL-3.0 GitHub repository of Chop Zone
947 stars

The Henderson Weighted Moving Average indicator calculates a smoothed moving average line using Henderson's symmetric weight kernel formula applied to the chosen source series over a specified period length. It plots directly on the main price chart pane. The

Indicator v6 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Henderson Weighted Moving Average
318 stars

This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss
257 stars

This indicator overlays an intraday SPX and ES chart with a midnight session range, regular-trading-hours opening levels, and a VWAP projection box. It draws the midnight high, mid, and low, flags edge rejections within an absolute tolerance, and plots optiona

Indicator v6 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of SPX Midnight Box + Snag Logic
147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe
114 stars

This indicator classifies the next market direction with a two-feature k-nearest neighbours model. It stores normalized historic indicator values and past directions, then compares the current point to the nearest neighbours using Euclidean or Chebyshev distan

Indicator v5 AI / machine learningOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Machine Learning: kNN-based Strategy
105 stars

This strategy plots a fast and a slow simple moving average on the price chart. It enters a long position when the fast average crosses above the slow average and closes that long when the fast average crosses below the slow average. Percentage take profit and

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Simple Moving Average Crossover
99 stars

Calculates J. Welles Wilder's Accumulation Swing Index (ASI) to evaluate underlying price momentum and market trend strength. It computes the individual bar Swing Index based on current and previous open, high, low, and close prices relative to a maximum daily

Indicator v6 Oscillators & momentumTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Accumulation Swing Index (ASI)

Moon Dev Lunar Sniper

by moondevonyt
92 stars

Moon Dev Lunar Sniper is a multi-indicator overlay that scores confluence across fast and slow EMAs, RSI, MACD, DMI, and BB width to fire signals only when score meets the minimum threshold. It plots buy and sell signals on the price chart, highlights cosmic b

Indicator v6 TrendOscillators & momentum Repaints
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Lunar Sniper

Donchian Pullback Strategy

by Ahmed-GoCode
53 stars

This strategy identifies trend direction from Donchian Channel breakouts and executes trades on pullbacks toward the channel midpoint. A new breakout beyond the previous channel bands sets a bullish or bearish trend state. When price retraces to or across the

Strategy v6 TrendBreakout
Updated 2 months ago · MPL-2.0 GitHub repository of Donchian Pullback Strategy

RSC Trend Trading Study

by readysetcryptocodes
43 stars

This indicator plots Donchian Channels alongside fast and slow simple moving averages directly on the price chart. It generates bullish breakout signals when the high reaches the upper channel while the close is above the 50 SMA (and optionally the 200 SMA). B

Indicator v4 TrendBreakout
Updated 2 years ago · None stated GitHub repository of RSC Trend Trading Study

This strategy overlays the price chart to execute long and short trades on BTCUSDT. It requests multi-timeframe data across daily, 3-minute, 5-minute, 8-minute, and 10-minute periods to generate signals alongside VWMA volatility bands and smoothed moving avera

Strategy v5 Volatility & bandsMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of BTCUSDT 10M - No Repaint v1.1 2023

OTT + EMA20 分批出場策略

by skywalker0803r
42 stars

This strategy draws on the price chart and trades both directions. It enters long when a variable moving average crosses above the Optimized Trend Tracker while price is above a fast EMA, and short on the opposite cross below a slower EMA. Entries are blocked

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of OTT + EMA20 分批出場策略

Advance Decline Line

by TWODS-CAPITAL
37 stars

This indicator plots an Advance Decline Line in a separate pane. It requests a combined NYSE series of advancing issues minus declining issues, divided by unchanged issues plus one. A cumulative function adds the square root of a positive difference and subtra

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · MIT GitHub repository of Advance Decline Line

[Pirate] Triple EMA

by hiPirate
33 stars

The [Pirate] Triple EMA indicator plots up to three independent exponential moving averages directly on the main price chart to assist with trend identification. It calculates fast, mid, and slow EMAs using standard periods of 50, 100, and 200 by default. User

Indicator v4 Moving averagesTrend
Updated 5 years ago · Unlicense GitHub repository of [Pirate] Triple EMA
29 stars

The Supertrended RSI [AlgoAlpha] indicator plots the Relative Strength Index combined with a Supertrend overlay in a separate indicator pane. It first computes standard RSI, with an optional Hull Moving Average smoothing step, and computes a secondary moving a

Indicator v5 Oscillators & momentumTrend
Updated 11 months ago · Custom licence GitHub repository of Supertrended RSI [AlgoAlpha]
24 stars

This indicator maps Smart Money Concepts (SMC) market structure directly onto the price chart. It detects internal and swing structure breaks (BOS and CHoCH), tracks bullish and bearish order blocks, identifies fair value gaps (FVG), highlights equal highs and

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 12 days ago · Custom licence GitHub repository of Smart Money Concepts [LuxAlgo] Test B

John F. Ehlers - Convolution

by palitojendthen
20 stars

Implements John F. Ehlers' convolution algorithm to detect cyclic components across multiple periods. The script processes price data using a SuperSmoother filter with an optional high-pass filter to remove low-frequency trends. It computes cross-correlations

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of John F. Ehlers - Convolution

This trend-following strategy plots Donchian channels and trade signals directly on the price chart. It enters long or short positions upon Donchian channel breakouts and scales in with accelerated pyramiding every fraction of the Average True Range. Position

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

Alighten Pattern C

by alighten-dev
14 stars

Calculates and plots market structure pivots and Pattern C signal setups directly on the price chart. It constructs a visual ZigZag structure to track high and low pivot points, drawing level rays from confirmed origin pivots. The script scans stored pivot pai

Indicator v6 Support & resistanceSMC / ICT / price action
Updated 2 weeks ago · None stated GitHub repository of Alighten Pattern C

Market Monitor - 1m

by chris-c-thomas
14 stars

Market Monitor - 1m is an overlay indicator designed for multi-chart monitoring and directional bias assessment. It plots a fast, mid, and slow EMA ribbon with a fill cloud, session VWAP with standard deviation bands, and previous day key levels. It evaluates

Indicator v6 TrendMoving averages Repaints
Updated 6 months ago · MIT GitHub repository of Market Monitor - 1m

Crossing EMAs A

by ruckard
13 stars

Crossing EMAs A is an automated strategy that overlays directly on the price chart. Despite its title referencing exponential moving averages, the script calculates fourteen-period and twenty-eight-period simple moving averages. It enters a long position when

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Crossing EMAs A

NFI v7.2

by koradiyakaushal
12 stars

NFI v7.2 is a Pine Script adaptation of the popular NostalgiaForInfinity algorithmic trading strategy originally built for Freqtrade. It analyzes price action and exponential moving average metrics across both base and higher informative timeframes, incorporat

Strategy v4 TrendMoving averages Repaints
Updated 5 years ago · MIT GitHub repository of NFI v7.2

BTE AO

by f-cksociety
11 stars

BTE AO is a Pine Script indicator based on the PineCoders Backtesting and Trading Engine framework. It simulates long and short trade entries, filters, stop losses, and take-profit targets directly on the price chart to evaluate trading strategies without nati

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of BTE AO
9 stars

ADX Advanced calculates Directional Indicators (DI+ and DI-) alongside the Average Directional Index (ADX) to gauge trend strength and direction. The script features selectable smoothing methods for the ADX curve, including EMA, SMA, RMA, WMA, SuperSmoother, T

Indicator v6 TrendOscillators & momentum
Updated 3 days ago · MIT GitHub repository of ADX Advanced [WavesUnchained]

CE 1M + 3M Buy, Sell, Hold

by MeridianAlgo
9 stars

This indicator evaluates trend direction using Chandelier Exit calculations across two timeframes: the current chart and a requested 3-minute timeframe. A custom Chandelier Exit function calculates ATR-based trailing stop bands to determine directional bias. W

Indicator v6 TrendVolatility & bands
Updated 4 months ago · MIT GitHub repository of CE 1M + 3M Buy, Sell, Hold

Chandelier Exit - Eterna

by EternaHybridExchange
9 stars

This strategy calculates volatility-based Chandelier Exit bands using the Average True Range and high/low extremes, paired with an optional exponential moving average trend filter. It enters long when the close crosses above the long Chandelier line while abov

Strategy v5 TrendVolatility & bands
Updated 7 months ago · MIT GitHub repository of Chandelier Exit - Eterna

AutoCorrelation Function

by Anderson-ALGO
9 stars

This indicator calculates sample autocorrelation across multiple lag intervals for a selected price series. It computes correlation values over a user-specified lookback period using raw prices, log returns, absolute log returns, or squared log returns. Plotte

Indicator v4 TrendMean reversion
Updated 5 years ago · None stated GitHub repository of AutoCorrelation Function

This strategy calculates a Supertrend line based on Average True Range parameters to identify market trends. It combines Supertrend trend reversals with an initial percentage-based stop loss and a dynamic trailing stop loss. Trades are taken according to the s

Strategy v4 TrendVolatility & bands Repaints
Updated 7 years ago · MIT GitHub repository of Supertrend ATR with Trailing Stop Loss
8 stars

This overlay strategy combines three distinct SuperTrend levels with multiple moving averages and volume profile analytics on the main price chart. It calculates trend directions using three configurable ATR periods and multipliers alongside SMA, EMA, and HMA

Strategy v5 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of ATR 3Lvls VP Strategy

FVG Strategy

by muammeryldrm42
7 stars

Calculates three-bar Fair Value Gaps (FVG) and filters them using Average True Range. When price mitigates the FVG midpoint, the strategy enters a position in the direction of the gap, provided an optional EMA trend filter is satisfied. Exits are defined by an

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of FVG Strategy
7 stars

Lorentzian Classification is a machine learning indicator that applies a k-nearest neighbors algorithm using Lorentzian distance to analyze market patterns. It processes configurable technical indicators, including RSI, WaveTrend, CCI, and ADX, as feature vect

Indicator v6 AI / machine learningOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of Lorentzian Classification
7 stars

This strategy plots a daily VWAP, a 90-period simple moving average from the one-hour chart, and a 50-period EMA plus a 90-period SMA from the 15-minute chart on the price chart. It enters long when VWAP crosses above the one-hour average, or while VWAP remain

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 1h Bullish Buy 15min Bearish Sell
5 stars

RG Structure is a pivot-constrained break-and-retest strategy that calculates dynamic trendlines, market structure changes, and regime states on the price chart. It identifies support and resistance lines through pivot points and evaluates break-and-retest sig

Strategy v6 TrendSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of RG Structure Visual Edition

Cerebr Centauri Demo

by jerryinyang
5 stars

Cerebr Centauri Demo is a multi-indicator trading strategy overlaying conditions directly on the price chart. It combines lower-timeframe and higher-timeframe inputs across moving averages, Stochastic oscillators, RSI, and MACD to generate trade signals. Trade

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Cerebr Centauri Demo

This long-only trend-following strategy plots a 20-period short EMA and a 50-period long EMA directly on the price chart. It triggers long entries when the short EMA is above the long EMA, price breaks above a recent pivot high, and specific price action condi

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 20 EMA + 50 EMA + Breakout Long Strategy (H)
4 stars

Elton's Predictions Decision Engine synthesizes thirty selectable strategy algorithms or an auto-detect mode into unified buy, sell, or wait verdicts directly on the price chart. It calculates higher-timeframe trend alignment, confidence scores, and ATR-based

Indicator v6 TrendOscillators & momentum Repaints
Updated 2 days ago · None stated GitHub repository of Elton's Predictions Decision Engine

Ultimate Combo v1

by DexWilder
4 stars

This overlay strategy is written for MES and ES five-minute charts. It calculates a fast and slow EMA, a 200-period trend EMA, session VWAP, RSI, ATR, and a volume moving average, and it can restrict trading to an exchange-time session. Inputs set RSI extremes

Strategy v6 TrendOscillators & momentum
Updated 3 days ago · None stated GitHub repository of Ultimate Combo v1

MACD Signal Cross

by latentwill
4 stars

This strategy evaluates EMA momentum crossovers filtered by an RSI oscillator. It enters a long position when a fast EMA crosses above a slow EMA while RSI remains above 40. Conversely, it enters a short position when the fast EMA crosses below the slow EMA wh

Strategy v5 Moving averagesOscillators & momentum
Updated 8 days ago · None stated GitHub repository of MACD Signal Cross

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