Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 42)

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

Bollinger Bands Force

by harryguiacorn
220 stars

This indicator modifies standard Bollinger Bands to measure directional trend force based on line alignment. It calculates a simple moving average basis along with upper and lower volatility bands. When all three lines move upward or downward simultaneously, i

Indicator v5 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Force

教學範例-回測

by TaichiS
219 stars

This Pine Script strategy demonstrates a basic moving average crossover backtest overlay on the main price chart. It plots a 20-period simple moving average and a 60-period simple moving average. The script enters a long position of 1,000 units when the faster

Strategy v4 Moving averagesTrend
Updated 5 years ago · None stated GitHub repository of 教學範例-回測

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

SMC Swings

by iamc1oud
56 stars

This indicator detects Smart Money Concepts market structure elements directly on the price chart. It tracks real-time and historical internal and swing market structure, identifying Break of Structure and Change of Character events. The script also highlights

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of SMC Swings
47 stars

The Chande Forecast Oscillator measures the percentage difference between the actual price and its linear regression forecast. It calculates an incremental linear regression slope and intercept over a specified period to estimate expected price levels. The ind

Indicator v6 Oscillators & momentumTrend
Updated 8 months ago · MIT GitHub repository of Chande Forecast Oscillator

Super SuperTrend

by Zettt
43 stars

Super SuperTrend calculates three SuperTrend values with separate lengths and multipliers and overlays them on the price chart. Each line can be drawn as maroon resistance or green support according to its direction, but those plots are hidden by default. It c

Indicator v4 Trend
Updated 1 year ago · None stated GitHub repository of Super SuperTrend

This strategy identifies breakout entries on low-timeframe cryptocurrency charts by combining rolling pivot support and resistance levels with a smoothed trend filter and a 3-period exponential moving average. Long and short entries trigger when price momentum

Strategy v5 TrendBreakout Repaints
Updated 2 years ago · None stated GitHub repository of V1 Binancash - Futures Strategy Futures 1M Candles

Average Directional Index

by TWODS-CAPITAL
37 stars

This indicator calculates the Average Directional Index (ADX) to measure market trend strength. It computes directional movement and true range smoothed by a Wilder's moving average (RMA) over configurable lengths. The resulting ADX value plots as a single red

Indicator v5 Trend
Updated 3 years ago · MIT GitHub repository of Average Directional Index

Ichimoku Bands

by benso87
24 stars

This indicator plots Ichimoku-style conversion and base lines as Donchian midpoints on the price chart, then surrounds each line with upper and lower bands derived from the standard deviation of that line. The conversion and base lengths set the lookback for e

Indicator v5 TrendVolatility & bands
Updated 4 years ago · MPL-2.0 GitHub repository of Ichimoku Bands
16 stars

This strategy implements the classic Turtle System 1 fast breakout model on the price chart. It calculates 20-bar Donchian channel highs and lows for trade entries and 10-bar bands for exits, utilizing ATR for position sizing and trailing stops. The strategy e

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

Trend Compass Daily

by chris-c-thomas
14 stars

Trend Compass Daily is a chart overlay indicator designed to evaluate market trend structure, momentum, and volatility. It calculates a multi-EMA ribbon with an anchor level, higher-timeframe reference lines, RSI and MACD divergences, OBV volume context, and A

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

WE-Indicator

by davro
10 stars

WE-Indicator is an overlay study that plots Tom DeMark buy and sell counts, optional counts from 1 to 8, and TD trend lines on the price chart. It also draws logarithmic growth curves and projection curves whose intercepts and slopes are user inputs. A vertica

Indicator v4 Oscillators & momentumSupport & resistance
Updated 5 years ago · None stated GitHub repository of WE-Indicator

Double MACD

by PipC
8 stars

This indicator plots a customized Moving Average Convergence Divergence oscillator in a separate pane. It calculates MACD, signal line, and histogram values from exponential moving averages, alongside a secondary Hull Moving Average calculation. The script plo

Indicator v4 Oscillators & momentumMoving averages
Updated 4 years ago · None stated GitHub repository of Double MACD

This indicator calculates a price efficiency ratio by dividing the net close change over a lookback by the sum of absolute bar-to-bar moves, then scales the result from 0 to 100. An optional volume weight and a simple moving average can smooth or reweight the

Indicator v6 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Price Efficiency Ratio (PER) [SharpStrat]
7 stars

This strategy combines the Moving Average Convergence Divergence oscillator with an Exponential Moving Average trend filter. It enters long positions when the MACD histogram crosses above zero while price stays above the long-term EMA filter. Long trades close

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · MPL-2.0 GitHub repository of MACD EMA Filter Strategy
5 stars

This indicator calculates and plots a customizable weighted moving average directly on the price chart. Users can configure the anchor period across fixed lengths, daily sessions, cumulative bars, or custom session intervals. Weighting options allow adjustment

Indicator v6 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Universal Moving Average

Triangular Moving Average

by SiegerTerpstra
5 stars

The Triangular Moving Average (TMA) indicator calculates a double-smoothed moving average by applying a simple moving average to an existing simple moving average. It plots the resulting line directly on the price chart with dynamic coloring to indicate whethe

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Triangular Moving Average

This strategy seeks long entries by combining moving average trend filters with VMC Cipher momentum and money flow indicators. It identifies bullish trend alignment when price trades above the 200 EMA and records recent pullbacks to the 50 EMA, confirmed by po

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA + VMC Cipher Long Strategy

EMA Cross [trugurpala]

by trugurpala
4 stars

This indicator calculates fast and slow exponential moving averages (EMAs) and plots them directly on the price chart. It detects bullish crossovers and bearish crossunders, marking them with colored triangles above or below price bars. The background dynamica

Indicator v6 Moving averagesTrend Repaints
Updated 2 months ago · MIT GitHub repository of EMA Cross [trugurpala]

SOKE OVASI

by Kalumur
4 stars

SOKE OVASI is an overlay indicator that combines an Arnaud Legoux Moving Average (ALMA), a Kaufman Adaptive Moving Average (KAMA), and a suite of multiple exponential moving averages (EMAs). It calculates moving averages across higher timeframes, defaulting to

Indicator v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of SOKE OVASI
4 stars

This indicator plots dynamic fractal-based trend lines directly on the price chart. It calculates local highs and lows using a configurable fractal period, derives angle slopes between swing points, and draws projected ray lines across recent segments. The scr

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Snagprofit Trend Line

jash GGMA Granville

by jash-git
3 stars

This indicator overlays five Fibonacci Exponential Moving Averages (EMA 3, 13, 34, 55, and 144) on the price chart, combining Guppy Multiple Moving Average concepts with Granville's rules. Fast EMAs track short-term momentum, slow EMAs reflect medium-term tren

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of jash GGMA Granville

This indicator identifies Shooting Star and Inverted Hammer candlestick patterns overlayed directly on the price chart. It evaluates candle body weakness, upper shadow length, and lower shadow proportions in combination with a trend lookback calculation. A Sho

Indicator v5 Candlestick patternsTrend
Updated 2 years ago · None stated GitHub repository of Shooting Star and Inverted Hammer Pattern

My First Indicator

by wynnforthework
2 stars

This strategy plots EMA 25 in yellow and EMA 100 in green on the price chart. It generates buy signals on EMA 25 crossing above EMA 100 when ATR length 14 rises over two prior bars and volume exceeds prior bar. It opens a long position of 1 unit on signal. It

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of My First Indicator

MACD Cross Strategy

by Web3Degenerate
2 stars

This strategy executes trades based on the initial MACD line crossover in the direction of the long-term trend defined by a 200 EMA filter. Position risk is calculated using a lookback swing high or low padded by an ATR multiple. The trade features a dual take

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

Zigzag S/R MT [LM]

by WISEPLAT
2 stars

The script calculates a custom ZigZag for support and resistance levels on the current timeframe and three additional timeframes: weekly, daily, and 240 minutes. It plots these levels as lines on the price chart, with options to show or hide up to four levels

Indicator v5 Support & resistanceTrend
Updated 3 years ago · None stated GitHub repository of Zigzag S/R MT [LM]

This strategy overlays Parabolic SAR, linear regression channels, and Supertrend directly on the price chart. It identifies directional momentum shifts when Parabolic SAR flips, issuing buy and sell signals. Position exits are controlled using customizable per

Strategy v4 TrendSupport & resistance
Updated 4 years ago · MIT GitHub repository of Paraboic SAR + Regression Channels + Supertrend

kNN Classifier

by jayadevrana
1 stars

This indicator implements a k-nearest neighbours classification model to forecast price direction several bars ahead. It extracts three normalized technical features: RSI, an EMA spread scaled by ATR, and normalized candle range volatility. Historical samples

Indicator v6 AI / machine learningTrend
Updated 4 days ago · MPL-2.0 GitHub repository of kNN Classifier

Donchian Channel Breakout

by pineforge-4pass
1 stars

This strategy tracks price breakouts using Donchian Channels calculated from the highest highs and lowest lows over configurable lookback periods. It plots the upper, lower, and mid entry channels directly on the price chart. A long entry triggers when the bar

Strategy v6 TrendBreakout
Updated 7 days ago · Apache-2.0 GitHub repository of Donchian Channel Breakout

P Err Strategy In Indicator

by GammaExpansion
1 stars

This script is an indicator that plots the close price on the price chart. It checks if close is greater than open and enters a long position using strategy.entry if true. However, as an indicator, strategy functions may not execute properly and could cause er

Indicator v6 Trend
Updated 7 days ago · MIT GitHub repository of P Err Strategy In Indicator

An indicator that plots two context reads on the price chart without trading logic. A 4-hour bias comes from swing structure agreeing with the close versus a 50 EMA and its slope, and a 1-hour trend check requires ADX, stacked fast and slow EMAs and an efficie

Indicator v6 Trend Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Delta Break and Retest Stage 4 MTF Bias Stack

DEPV2 C1a Temel Skor

by YuceSezar89
1 stars

This indicator calculates a composite base score using trend, momentum, volatility, and volume components. It computes HLC3 SMA trend levels, ROC momentum z-scores, ATR-based volatility expansion ratios, and volume participation rates. Additional MTF Heikin As

Indicator v6 TrendOscillators & momentum
Updated 13 days ago · None stated GitHub repository of DEPV2 C1a Temel Skor
1 stars

This indicator detects fractal patterns in price action using a customizable number of periods. It identifies up and down fractals and draws symmetry zones between consecutive fractals of opposite types on the price chart. Zones incorporate slope multipliers a

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

Mean Deviation Trail

by vedkanani123
1 stars

An overlay indicator that measures how far price sits from a central EMA, smooths that signed deviation with a selectable moving average, and uses a mean absolute deviation measure to scale a trailing band. The multiplier is tight when deviation is strong and

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Mean Deviation Trail

SCDTM Indicator

by GreyssonEnterprises
1 stars

An indicator that applies a multi-step checklist on the price chart. The first step compares 9 and 18 period EMAs on the daily, four-hour and one-hour timeframes and requires all three to agree. The second uses Bollinger %B thresholds and a Stochastic RSI, wit

Indicator v5 TrendOscillators & momentum Repaints
Updated 3 months ago · MIT GitHub repository of SCDTM Indicator

Over Buy Sell Strategy

by tthanhvu002sgu
1 stars

A momentum strategy on the price chart that combines RSI, MACD histogram, ADX with directional lines and a large-candle test against ATR. Bullish and bearish momentum states require all of these to agree and exclude overbought or oversold readings. It also rea

Strategy v5 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Over Buy Sell Strategy
1 stars

Pro Quant Desk (US) v1 is a comprehensive market analysis dashboard overlaid directly on the price chart for US equities. It calculates market regime metrics including macro risk gauges using SPY, QQQ, and equal-weight RSP breadth proxies, two-layer relative s

Indicator v5 Screeners & dashboardsTrend
Updated 4 months ago · None stated GitHub repository of Pro Quant Desk (US) v1
1 stars

This strategy combines trend, volatility, and multi-oscillator filters to generate directional trades. It calculates an Arnaud Legoux Moving Average (ALMA), Keltner Channels, Bollinger Band width, the Chande Momentum Oscillator (CMO), Money Flow Index (MFI), a

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Channel Momentum Suite
1 stars

This indicator toolkit analyzes cryptocurrency price action on TradingView charts. It computes and plots Volume Profile with user-adjustable lookback bars, row count, and value area percentage; VWAP lines anchored to daily/weekly/monthly sessions plus optional

Indicator v6 VolumeSupport & resistance
Updated 5 months ago · MIT GitHub repository of Crypto AMT v7.2 Spec Watch

Smooth Trail V2

by dtheran1
1 stars

Draws a SuperTrend-style trailing line on the price chart, blended from a SuperTrend, Hull moving average bands and recent highest and lowest closes, with an ATR-based zone around it. The line and zone are blue above price and pink below. Inputs set the multip

Indicator v5 TrendVolatility & bands
Updated 6 months ago · None stated GitHub repository of Smooth Trail V2
1 stars

This strategy combines two Supertrend indicators with different factors and periods to identify trend direction on the price chart. The primary Supertrend (factor 3, period 10) signals flips for entries, confirmed optionally by a faster Supertrend (factor 2, p

Strategy v5 TrendVolatility & bands
Updated 8 months ago · None stated GitHub repository of Supertrend - Dynamic Trend Follower
1 stars

The HybridAlgo Multi-Indicator Strategy calculates signals from moving average crossovers, RSI, MACD, and Bollinger Bands. Long and short entries trigger when at least three signals align for confluence. It sets stop loss at three times ATR below entry and tak

Indicator v5 TrendOscillators & momentum Repaints
Updated 8 months ago · None stated GitHub repository of HybridAlgo Multi-Indicator 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