Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 52)

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

47 stars

Ehlers Phasor Analysis calculates the phasor angle, derived cycle period, and market trend state using John Ehlers' cycle analysis techniques. It uses correlation against cosine and sine waveforms over a customizable lookback period to extract in-phase and qua

Indicator v6 TrendOscillators & momentum
Updated 8 months ago · MIT GitHub repository of Ehlers Phasor Analysis (PHASOR)
16 stars

This strategy enters long or short on Donchian channel breakouts and adds units only while RSI remains beyond its momentum thresholds. Size is based on a percentage of equity per unit, up to a set maximum. An ATR initial stop and a chandelier trail manage open

Strategy v6 TrendOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Seykota Alt 30: Momentum Pyramid

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX
7 stars

The RSI + BB Oscillator combines Relative Strength Index (RSI) and Bollinger Bands %B calculations across two timeframes into a single separate pane plot. It shifts RSI values around zero and measures %B bandwidth using selectable moving average types includin

Indicator v5 Oscillators & momentumVolatility & bands Repaints
Updated 4 months ago · None stated GitHub repository of RSI + BB Oscillator

MACD Breakout

by jerryinyang
5 stars

Calculates multi-timeframe Moving Average Convergence Divergence (MACD) alongside a Money Flow filter to identify potential market breakouts. It evaluates higher-timeframe MACD calculations using exponential or simple moving averages combined with Money Flow o

Indicator v4 TrendOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of MACD Breakout
4 stars

This strategy evaluates EMA crossovers filtered by a long-term 200-period EMA trend filter designed for Gold futures and XAUUSD. It enters a long position when a fast EMA crosses above a slow EMA while price is above the 200 EMA. If long-only mode is turned of

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Gold GC/XAUUSD Strategy [trugurpala]
3 stars

This indicator calculates 3-period and 13-period exponential moving averages (EMAs) and plots them on the main price chart. It checks whether a single candlestick's real body—the space between its open and close prices—intersects both EMAs on the same bar. Whe

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of K-bar and EMA Crossover
3 stars

This indicator measures buyer and seller strength over a fixed twenty-bar lookback window and plots the result in a separate pane. It calculates bull force based on the distance from the lowest close and bear force from the highest close, incorporating the bar

Indicator v5 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of CSW Bull/Bear Force
3 stars

This indicator plots trading signals, swing levels, a trend cloud, and optional take-profit and stop-loss targets directly on the price chart. It calculates advanced historical volatility metrics, including Garman-Klass and Yang-Zhang estimators, to evaluate m

Indicator v5 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Elite Algo Modded By AlgoPoint

Stops & Targets

by Web3Degenerate
2 stars

This script demonstrates how to calculate and display ATR-based stop loss and take profit levels directly on the price chart. It detects hammer and shooting star candlestick patterns filtered by a 50-period EMA trend. When a setup occurs and no active trade is

Strategy v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Stops & Targets

Double Mm With Hhll

by WISEPLAT
2 stars

Double Mm With Hhll is an indicator that plots two separate ZigZag lines on the price chart using different periods. It calculates swing highs and lows for each period and connects them into trend lines with customizable colors for up and down moves, line styl

Indicator v4 TrendSupport & resistance
Updated 3 years ago · None stated GitHub repository of Double Mm With Hhll
1 stars

An extended strategy version that adds a strategy preset, a risk aggression choice and a pattern type filter to an AlphaTrend style core with MACD. It includes three consolidation layers with volume profile, candlestick and macro pattern drawings, a kinematic

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended

Session Filter

by jayadevrana
1 stars

Session Filter is an overlay indicator that plots a fast and a slow exponential moving average on the price chart. It marks a buy when the fast average crosses above the slow average only during a user-defined trading session, and it marks crossovers outside t

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Session Filter

Gyroscope CMO Median

by pineforge-4pass
1 stars

A long-only strategy that pairs a rolling median line with the Chande Momentum Oscillator. It enters long when price crosses above the median while the oscillator is above an entry level. It exits when price drops below the median, the oscillator falls under a

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Gyroscope CMO Median

DEPV2 DEBUG S1

by YuceSezar89
1 stars

This multi-asset crypto indicator monitors up to twenty symbols using four distinct analytical pillars: trend, momentum, volatility, and volume. It generates trade signals based on configurable modes including single-pillar execution, simultaneous confluence,

Indicator v6 Screeners & dashboardsTrend Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S1
1 stars

This indicator plots a dynamic trend level on the main price chart based on an interactively chosen anchor time and price level. It calculates the vertical offset between the selected price level and a moving average at the anchor time, projecting this dynamic

Indicator v6 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Moving Average Trend Line
1 stars

A simple exponential moving average crossover indicator drawn on the price chart. It plots a fast EMA and a slow EMA, 20 and 50 periods by default, and colors the fast line green when it is above the slow one and red when below. BUY and SELL labels mark the cr

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of Trend Direction Buy/Sell Signals

Swing Trade ATR

by rubbermetal
1 stars

Swing Trade ATR is an indicator that marks Swing L and Swing S labels when a 9-period EMA crosses a 21-period EMA, with a fill between them. After each signal it draws stop loss and take profit lines at ATR multiples from the signal close and clears them when

Indicator v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of Swing Trade ATR
1 stars

This strategy evaluates short-term trend momentum by summing price differences across a user-defined lookback period using a for loop. It combines this calculated average momentum with 9-period and 21-period Exponential Moving Average crossovers. A long trade

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of For Loop Accumulator
1 stars

A Supertrend strategy that enters on the trend direction, filtered by a 4-hour Supertrend, relative volume and ADX strength. It exits at a percentage profit target, with an optional trailing offset, and a time-based exit that closes at breakeven after a maximu

Strategy v6 Trend Repaints Archived
Updated 5 months ago · None stated GitHub repository of Supertrend2 Target No-SL Dashboard
1 stars

This strategy runs on the price chart and is titled for a percentile SuperTrend combined with OBV and DI, although the provided excerpt does not show those calculations. It restricts trading to bars after a user-chosen start time and can enable long entries, s

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Percentile_SuperTrend_OBV&DI
1 stars

A Pine v4 strategy that plots a 36-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 LTCBTC EMA Cross Strategy
330 stars

This strategy generates crossover signals using two exponential moving averages calculated from multi-timeframe Heikin Ashi data. It enters long when the fast EMA crosses above the slow EMA and enters short on a crossunder, reversing the open position. Positio

Strategy v5 Moving averagesTrend Repaints
Updated 2 months ago · None stated GitHub repository of Javo v1 [Repaint] [Alorse]

Function Polynomial Regression

by ricardosantos79
261 stars

This indicator fits a quadratic polynomial regression through recent fractal pivot highs and lows and plots the result as a channel on the price chart. A reusable function returns fitted values plus maximum, minimum, and average absolute deviations from the cu

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Function Polynomial Regression
114 stars

This indicator applies Learning Vector Quantization (LVQ), a supervised neural network competitive learning algorithm, to classify normalized market features. It determines winning prototype vectors using Euclidean distance and continuously updates weights acr

Indicator v4 AI / machine learningTrend Repaints
Updated 1 year ago · None stated GitHub repository of Machine Learning: LVQ-based Strategy
106 stars

This script executes long and short trades directly on the price chart by combining signals from multiple indicators, including MACD, RSI, Stochastic RSI, Supertrend, and moving average crosses. It aggregates indicator conditions using weighted scores and ente

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Acrypto - Weighted Strategy
99 stars

The Bilateral Filter indicator calculates an edge-preserving smoothed price line based on bilateral filtering principles. It combines spatial domain distances across past bars with range domain price amplitude differences using dual Gaussian weighting function

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Bilateral Filter (BILATERAL)
55 stars

This indicator draws diagonal trendlines from confirmed swing points on the price chart. It detects pivot highs and pivot lows using a fixed 15-bar lookback on each side. When a new pivot confirms, it connects the last two highs with a solid red line and the l

Indicator v5 TrendSupport & resistance
Updated 6 months ago · Apache-2.0 GitHub repository of Auto Diagonal Trendlines

ChannelBreakOutStrategy

by TWODS-CAPITAL
37 stars

This strategy tracks price channels by calculating the highest high and lowest low over a customizable lookback period. It executes stop orders to enter long positions above the upper channel boundary and short positions below the lower channel boundary. Posit

Strategy v5 BreakoutTrend
Updated 3 years ago · MIT GitHub repository of ChannelBreakOutStrategy

This strategy trades Donchian channel breakouts with ATR-based risk. It allows long and short entries, sizes the first unit from a risk percent, and adds up to four fractional units as price moves in favor. An initial ATR stop moves to breakeven after a set pr

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 31: Fractional + BE Lock
4 stars

This strategy tracks gold price trends using three exponential moving averages with lengths of 8, 21 and 55. It calculates ADX for trend strength filter and ATR for dynamic risk levels. The script enters long positions when the EMAs align bullishly with suffic

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Gold Triple EMA [trugurpala]

CSW Indicators

by g-moe
3 stars

CSW Indicators combines eight technical analysis tools into a single overlay plotted directly on the main price chart. It features automated power support and resistance levels derived from pivot points, distance perimeter bands, a linear regression channel, R

Indicator v5 TrendSupport & resistance Repaints
Updated 5 months ago · None stated GitHub repository of CSW Indicators

Estimations-10min

by IAMATOMIC001
3 stars

This overlay strategy estimates trend with a selectable TEMA, Hull, or ALMA basis and optional higher-timeframe or Heikin Ashi sources. It plots a regression estimator with ATR near and far boundaries, can color bars by trend, and can show order blocks. Entrie

Strategy v5 TrendMoving averages Repaints
Updated 12 months ago · None stated GitHub repository of Estimations-10min

Calculates a Zero Lag Exponential Moving Average (ZLEMA) combined with Average True Range volatility bands to determine market trends. It plots the ZLEMA basis line, volatility bands, trend reversal labels, and entry signals directly on the price chart. Additi

Indicator v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Zero Lag Trend Signals (MTF) [AlgoAlpha]

[SMT] B&S Renko

by wynnforthework
2 stars

This strategy plots Renko open prices on the price chart based on the ATR length setting. It generates buy signals when Renko open crosses under close and sell signals when open crosses over close. The main setting adjusts ATR length used for Renko brick calcu

Strategy v5 TrendScalping
Updated 1 year ago · None stated GitHub repository of [SMT] B&S Renko
2 stars

Trend Direction Helper calculates overall trend direction by combining customized range filters, Williams %R, and multi-period threshold logic to plot directional buy and sell labels. It also features optional percentage-reversal ZigZag lines, pivot-based supp

Indicator v4 TrendSupport & resistance
Updated 3 years ago · None stated GitHub repository of Trend Direction Helper
1 stars

A strategy that builds on the JAT+BSM family: an AlphaTrend style core with MACD, three consolidation layers with volume profile, candlestick and macro pattern drawings, and a kinematic and Bayesian forecast with a feedback learning rate. Inputs include a stra

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v15 Unified

DEPV2 DEBUG S10

by YuceSezar89
1 stars

Calculates and coordinates trading signals across up to twenty cryptocurrency instruments using four core analytical dimensions: trend, momentum, volatility, and volume. Users can configure signals to trigger from single dimensions, simultaneous multi-factor c

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S10

True RSI

by vedkanani123
1 stars

A separate-pane oscillator by MisinkoMaster that rebuilds RSI by weighting each bar's gain and loss with Aroon up and down values over the lookback, then scaling to a 0 to 100 line. Trend turns long when the value crosses above a long threshold and short below

Indicator v6 Oscillators & momentumTrend
Updated 2 months ago · None stated GitHub repository of True RSI
1 stars

This strategy compares a 9-period EMA with a 21-period EMA of the close and uses their difference as a spread. It opens a long when the spread crosses above zero and a short when it crosses below zero, reversing the position through opposite entries. The EMA l

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Generic Type Annotation Tuple
1 stars

This strategy overlays price and combines SuperTrend, ADX, OBV, MACD, directional movement, EMA, and a volatility filter to decide long and short entries. Each filter can be switched on or off, and trading starts only after a chosen date. It can close when ena

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Percentile_SuperTrend_OBV&DI&EMA

V5 Combination by YZZ

by webcrack4
1 stars

This indicator combines multiple script features into a single overlay on the main price chart. It calculates a modified MACD line and signal oscillator with configurable modes including traditional, histogram-based, leader, and source-based variations. The os

Indicator v5 TrendOscillators & momentum
Updated 9 months ago · None stated GitHub repository of V5 Combination by YZZ
1 stars

An indicator that fits a linear regression line over a chosen number of bars and draws upper and lower deviation channels around it on the price chart. Length, source and the deviation multipliers are adjustable, and lines can be extended left or right. It can

Indicator v5 TrendSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of Linear Regression Channel
55 stars

This indicator draws dynamic support and resistance trendlines on the price chart. It finds pivot highs and pivot lows with a fixed 15-bar lookback on each side, keeps the last two of each, and on the latest bar connects those highs with a red line and those l

Indicator v5 Support & resistanceTrend
Updated 6 months ago · Apache-2.0 GitHub repository of Auto Dynamic Trendlines

This indicator calculates the Ehlers Trendflex oscillator and plots it in a separate pane. It applies a two-pole SuperSmoother low-pass filter to the chosen source, sums the cumulative slope over the lookback with a running buffer, and divides that slope by an

Indicator v6 Oscillators & momentumTrend
Updated 8 months ago · MIT GitHub repository of Ehlers Trendflex Indicator (TRENDFLEX)

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