Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 54)

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

Super Alligator Strategy

by eltonaguiar
4 stars

This strategy plots the Alligator indicator with customizable Jaw, Teeth, and Lips lines on the price chart. It generates buy and sell signals when the close price moves beyond the Lips line by a minimum gap percentage. The strategy includes optional SMA and V

Strategy v5 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Super Alligator Strategy
4 stars

This strategy combines a standard Moving Average Convergence Divergence (MACD) crossover signal with an exponential moving average (EMA) trend filter. Long positions are entered when the MACD crosses above its signal line while price is above the trend EMA. Sh

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of MACD Strategy [trugurpala]

v2

by jash-git
3 stars

This indicator plots five Exponential Moving Averages (EMA 3, 13, 34, 55, and 144) on the price chart to determine market trend structure. It identifies entry confluence signals by detecting when an EMA 3 and 13 crossover coincides with a MACD crossover within

Indicator v5 TrendMoving averages
Updated 4 weeks ago · None stated GitHub repository of v2
3 stars

This indicator overlays a dynamic trend ribbon or cloud on the price chart to visualize market direction and strength. It generates long and short signals based on selected strategy modes such as Default, Scalping, Intraday or Swing, using adjustable period, s

Indicator v5 TrendSMC / ICT / price action Repaints
Updated 12 months ago · None stated GitHub repository of Money Moves [Premium Algo V2]

Ichimoku Kinko Hyo

by TamTH-Dev
2 stars

Plots the classic Ichimoku Kinko Hyo system directly on the price chart. It calculates the Tenkan-Sen, Kijun-Sen, Senkou Span A, Senkou Span B, and Chikou Span based on midpoints of highest highs and lowest lows over user-defined lookback periods. The Kumo clo

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Ichimoku Kinko Hyo

Signal Forge

by jayadevrana
1 stars

This indicator calculates an ATR-based trailing stop and combines it with a 200-period baseline EMA to identify trend reversals on closed candles. To eliminate false breakouts, it filters signals through an ADX chop detector, a relative volume threshold, and a

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Signal Forge

Input Source Runtime Override

by pineforge-4pass
1 stars

This strategy computes two simple moving averages on a selectable price source and plots them on the price chart. The source defaults to close but can be overridden at runtime via the input panel, for example to high. It signals long entries on fast SMA crossi

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Input Source Runtime Override
1 stars

A strategy for MNQ futures that trades with the trend only when a regime score allows it. The score blends higher-timeframe EMA bias, ADX, choppiness, efficiency ratio and persistence, with separate enter and hold thresholds. Four switchable triggers can open

Strategy v6 TrendSessions & time Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of MNQ Multi-Trigger Trend Continuation

DEPV2 DEBUG S13

by YuceSezar89
1 stars

This multi-symbol indicator monitors up to twenty cryptocurrency pairs and evaluates signals across four core dimensions: trend, momentum, volatility, and volume. It allows traders to configure signal generation through individual dimensions, simultaneous mult

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

A strategy that switches logic by volatility regime, measured as the percentile rank of ATR as a percent of price over 200 bars. In low volatility it buys RSI below 30 and sells above 70. In the middle regime it follows a 20 and 50 EMA crossover, with longs al

Strategy v6 Volatility & bandsMean reversion
Updated 2 months ago · None stated GitHub repository of TN Adaptive Vol Regime

The Farey Sequence Weighted Moving Average calculates a smoothed trend line by weighting historical price values according to terms from a Farey sequence of a selected mathematical order. The line plots directly on the price chart and updates dynamically based

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Farey Sequence Weighted Moving Average
257 stars

Snag - Auto Trade Futures is an overlay indicator designed for trend tracking using weighted moving averages (WMAs). It plots 13-period, 48-period, and 200-period WMAs directly on the price chart and identifies momentum shifts when these averages cross. When f

Indicator v5 TrendMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of Snag - Auto Trade Futures

This strategy overlays the price chart and looks for VWAP pullbacks. It goes long when a short SMA crosses above VWAP after RSI has been oversold within ten bars, and short on the opposite cross after RSI has been overbought. Optional Minervini-style moving-av

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced VWAP-Momentum Pullback Trend Qualifier
16 stars

This price-chart strategy enters long when close breaks the prior Donchian high and short when it breaks the prior low, after a volume check and an optional moving-average regime filter. The first unit risks a percent of price against an ATR stop. Later units

Strategy v6 TrendBreakout Repaints
Updated 12 months ago · None stated GitHub repository of Seykota Alt 35: Fract + Time
5 stars

A short-only trading strategy combining three technical indicators: Kijun-Sen, SSL Channel, and Waddah Attar Explosion (WAE). It opens short positions when price is below the Kijun-Sen baseline, the SSL Channel crosses down, and WAE signals downside momentum e

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of Kijun-Sen + SSL + WAE Short Strategy

Triple_EMA_STEPFUN

by eltonaguiar
4 stars

This trend-following strategy generates long and short entries based on the alignment of three exponential moving averages and price position relative to the fastest EMA. An optional RSI momentum filter can confirm directional bias. By default, exits occur on

Strategy v5 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Triple_EMA_STEPFUN

MTF EMA [trugurpala]

by trugurpala
4 stars

This indicator plots exponential moving averages of close from the daily, weekly, and monthly timeframes on the price chart. Each series uses the same user-set length and is requested with a one-bar historical offset. Toggles show or hide the daily, weekly, an

Indicator v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of MTF EMA [trugurpala]

OT Algo Toolkit

by IAMATOMIC001
3 stars

OT Algo Toolkit is a Smart Money Concepts market structure indicator that plots swing and internal structure transitions, including Break of Structure (BOS) and Change of Character (CHoCH) labels directly on the price chart. It highlights equal highs and lows,

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 12 months ago · None stated GitHub repository of OT Algo Toolkit

Ichimoku Raiden

by TamTH-Dev
2 stars

This indicator plots dual Ichimoku Kumo clouds, designated as Lightning and Thunder, directly on the price chart. It calculates Donchian midpoints across two distinct parameter sets to generate fast and slow Senkou Span A and B boundary lines. The script fills

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Ichimoku Raiden

Simple Trend Painter

by jayadevrana
1 stars

Simple Trend Painter is an overlay indicator that colors chart candles based on their position relative to a simple moving average. Candles are painted green when closing above the moving average and red when closing below it. The script plots the SMA line on

Indicator v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of Simple Trend Painter

DEPV2 Debug S14

by YuceSezar89
1 stars

DEPV2 Debug S14 is a multi-symbol quantitative signal generator that evaluates up to 20 cryptocurrency tickers using four analytical dimensions: trend, momentum, volatility, and volume. Traders can select different signal generation modes, including single met

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 Debug S14
1 stars

Plots seven mirrored price lines on the price chart. Each is twice a moving average minus the close, using Fibonacci lengths from 8 to 144 and a selectable EMA, SMA or WMA type, with coloured fills between neighbouring lines that can be switched off. It also m

Indicator v6 Moving averagesVolume
Updated 7 weeks ago · None stated GitHub repository of Symmetric Fib Volume Dashboard

Volume MAs Cloud Trend

by vedkanani123
1 stars

An overlay indicator that draws a cloud around a selectable volume-based moving average, with positive and negative band multipliers setting the upper and lower edges. The signal type setting chooses how the trend is read, with the cloud as the default, and th

Indicator v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Volume MAs Cloud Trend

Anish TB Foster Fix

by nishpa800
1 stars

Overlay indicator for stock-style charts that flags pocket pivot candles: a large percentage body whose volume beats the highest opposite-colour volume over a lookback. It also tests trend stages using 50, 150 and 200 period EMAs plus distance from the 52-week

Indicator v5 TrendVolume
Updated 2 months ago · None stated GitHub repository of Anish TB Foster Fix
1 stars

This strategy draws on the price chart and combines optional long and short signals from a 9/21 EMA crossover, a breakout of the prior 20-bar high or low, RSI momentum, and a MACD histogram flip. A toggleable 200-period simple moving average allows longs only

Strategy v6 TrendOscillators & momentum Repaints
Updated 2 months ago · None stated GitHub repository of TN Asymmetric Swing Sovereign
1 stars

The strategy combines the Moving Average Convergence Divergence (MACD) oscillator with Bollinger Bands to generate trading signals on the main price chart. A long signal occurs when the MACD line crosses above its signal line while the closing price is above t

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Tuple Visual MACD BB
1 stars

Draws a linear regression line over the last chosen number of bars on the price chart, with upper and lower channel lines offset by a standard deviation multiple or by the largest deviation of highs and lows. Inputs set length, source, deviation multipliers, l

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

The MACD Fast W Shorts Add Long strategy generates trading signals using a standard Moving Average Convergence Divergence (12, 26, 9) calculation and VWAP filtering. It enters long trades when MACD is below zero, rising, and under the signal line, or reopens a

Strategy v4 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of MACD Fast W Shorts Add Long

The Finite Impulse Response (FIR) Filter is a smoothed technical indicator plotted directly on the main price chart. It calculates a weighted moving average using seven configurable coefficient inputs applied to current and historical price values. The filter

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Finite Impulse Response (FIR) Filter

FunctionLinearRegression

by ricardosantos79
261 stars

This Pine Script v5 library provides functions to calculate and plot linear regression channels using sample point arrays. It evaluates paired X and Y arrays to calculate the regression slope, intercept, fitted values, maximum deviation, minimum deviation, and

Library v5 Trend
Updated 4 years ago · None stated GitHub repository of FunctionLinearRegression
257 stars

This overlay indicator rebuilds a synthetic candle from the current open and the previous three opens. It treats the highest and lowest of those earlier opens as the range, the prior open as the synthetic open, and the current open as the synthetic close. From

Indicator v5 TrendCandlestick patterns
Updated 7 weeks ago · None stated GitHub repository of Snag - Best Futures Color Trend

This indicator combines a dynamic Seasonal Random Index (SRI) with a dynamic Karobein Oscillator and a pattern-similarity search algorithm in a separate pane. It normalizes SRI into seasoned and deseasoned series, shading the area green or red to signal trend

Indicator v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Similarity Search, Karobein and Seasonal Random Index

This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups

Indicator v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of AI SuperTrend Clustering Oscillator [LuxAlgo]

This indicator calculates and plots a Fibonacci-weighted moving average directly on the main price chart. It assigns weights based on the Fibonacci sequence, giving greater importance to recent bars while factoring in historical price points. Users can adjust

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Fibonacci Weighted Moving Average (FWMA)

Consecutive Up/Down Strategy

by TWODS-CAPITAL
37 stars

This strategy tracks consecutive bullish and bearish candlestick closes relative to the preceding bar. It enters a long position when price closes higher for a specified number of consecutive bars, and enters a short position when price closes lower for a desi

Strategy v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Consecutive Up/Down Strategy
16 stars

This trend-following strategy initiates long or short trades on Donchian channel breakouts. Position sizing is calculated from an Average True Range (ATR) volatility model. The script scales into winning trades up to a user-defined unit limit only when RSI con

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 36: BE + Momentum

MTF Heiken Ashi

by jerryinyang
5 stars

This indicator evaluates Heikin Ashi trend direction across three user-defined higher timeframes. It determines directional bias using either manual Heikin Ashi calculations or imported Heikin Ashi ticker data, with an optional wick filter to assess wick perce

Indicator v4 TrendCandlestick patterns
Updated 2 years ago · None stated GitHub repository of MTF Heiken Ashi
5 stars

This indicator combines pivot-based support and resistance levels with multi-timeframe MACD crossovers and a higher-timeframe exponential moving average trend filter. It identifies support and resistance touches using pivot highs and lows within a user-defined

Indicator v4 Oscillators & momentumSupport & resistance Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of MACD + Support / Resistance

MTF Trend Strategy

by trugurpala
4 stars

This strategy trades a chart-timeframe exponential moving average crossover only when a higher-timeframe close agrees with a higher-timeframe exponential moving average. A bullish cross opens a long and a bearish cross opens a short. Each entry places an avera

Strategy v6 TrendMoving averages Repaints
Updated 2 months ago · MIT GitHub repository of MTF Trend Strategy
3 stars

Pieki Algo is an all-in-one technical analysis indicator that overlays trading signals, trend visualizers, and Smart Money Concepts onto the main price chart. It plots buy and sell signals based on configurable sensitivity settings, colors candles by trend or

Indicator v5 SMC / ICT / price actionTrend Repaints
Updated 12 months ago · None stated GitHub repository of Pieki Algo Signals & Overlays

IMBA Algo

by TamTH-Dev
2 stars

IMBA Algo is a price chart overlay indicator designed to simulate trading setups with detailed position visualisations. It calculates entry points, automatic or fixed percentage stop losses, break-even levels, and four distinct take profit targets with customi

Indicator v5 TrendScreeners & dashboards
Updated 6 weeks ago · None stated GitHub repository of IMBA Algo

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