Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 72)

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

Sergdi D002

by ruckard
13 stars

This strategy detects trend reversals on the 4H timeframe using ADX crossover signals. Long entries occur when +DI crosses above -DI, and short entries when +DI crosses below -DI. Built-in risk management includes ATR-based stop loss, optional take profit, tra

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Sergdi D002

Combines an upgraded WaveTrend oscillator engine with market structure swing pivots, volume profile point of control (POC), and multi-timeframe trend alignment scoring. Trades are triggered by WaveTrend reversal or pullback continuation signals that pass conte

Strategy v6 Oscillators & momentumTrend
Updated 3 days ago · MIT GitHub repository of WaveTrend v3 [WavesUnchained] — Strategy

Tn Sovereign SMC v6

by raybird
1 stars

Tn Sovereign SMC v6 is a Smart Money Concepts strategy that overlays trade entries and an status HUD table directly on the price chart. It identifies liquidity sweeps by checking if price pierces recent swing highs or lows before closing back within range, fil

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of Tn Sovereign SMC v6
37 stars

This overlay indicator detects the bullish Rising Three Methods continuation pattern on the price chart. It looks for a long white candle, three small black candles whose bodies stay inside the first candle’s range, and a long white candle that closes above th

Indicator v5 Candlestick patternsTrend Repaints
Updated 3 years ago · MIT GitHub repository of Rising Three Methods - Bullish

Sergdi E002

by ruckard
13 stars

Sergdi E002 is a directional trading strategy based on higher-timeframe Directional Movement Index crossovers. It enters long when the 4-hour DI+ crosses above DI- and short when DI+ crosses below DI-. The strategy features extensive risk management options in

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Sergdi E002

The WaveTrend v4 Strategy generates trading signals when the WaveTrend oscillator crosses at oversold or overbought levels. Long positions enter on bullish crosses in oversold territory, while short positions enter on bearish crosses in overbought territory. I

Strategy v6 Oscillators & momentumTrend Repaints
Updated 3 days ago · MIT GitHub repository of WaveTrend v4 [WavesUnchained] Strategy

This indicator plots linear regression bands on the price chart for multiple timeframes. It calculates regression lines with standard deviation bands for up to three timeframes, each configurable with length, deviation, color, width, and background transparenc

Indicator v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Linear Regression MTF + Bands

This indicator fits a trigonometric series to historical prices and projects future price movement directly on the price chart. Using the Quinn and Fernandes algorithm alongside least-squares fitting, it identifies dominant cycle frequencies across a user-defi

Indicator v5 Trend
Updated 8 months ago · None stated GitHub repository of Fourier Extrapolator of Price w/ Projection Forecast [Loxx]

Tn Sovereign STC v6

by raybird
1 stars

Tn Sovereign STC v6 is an overlay strategy that combines the Schaff Trend Cycle oscillator with a 200-period Exponential Moving Average trend filter. It triggers long entries when the Schaff Trend Cycle crosses above the oversold boundary during a general uptr

Strategy v6 Oscillators & momentumTrend
Updated 2 months ago · None stated GitHub repository of Tn Sovereign STC v6

Mov Avg Speed Strategy

by hasnocool
106 stars

This strategy evaluates market trend and momentum by combining moving average rate of change, Stochastic Oscillator levels, and MACD signal line directions on the main chart overlay. It calculates a directional signal from each of the three indicators and requ

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Mov Avg Speed Strategy

Rising Window - Bullish

by TWODS-CAPITAL
37 stars

This indicator detects a bullish Rising Window, a two-candle pattern in which the current low is above the previous high during an uptrend. It plots an RW label below price, tints the background, and fires an alert when the pattern appears. Trend context can u

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Rising Window - Bullish
3 stars

Linear Regression Slope is a momentum and trend strength indicator that calculates the mathematical slope of a linear regression line using weighted and simple moving averages. It plots the resulting slope oscillator alongside a reference zero line in a separa

Indicator v5 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of Linear Regression Slope

My Strategy

by hasnocool
106 stars

This overlay strategy combines a Schaff Trend Cycle, an ATR trailing stop, and a fixed 200-period simple moving average. It enters long when the cycle turns upward, the ATR bias is bullish, and price is at or above the average, and short on the opposite alignm

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of My Strategy

DX with Price-Aligned Color

by eddiebelaval
7 stars

This indicator calculates the Directional Index from plus and minus directional movement and true range, then plots the DX line in a separate pane. Line color is lime when DX is rising and price is up, red when DX is rising while price is down or when DX is fa

Indicator v5 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of DX with Price-Aligned Color

LinReg Bands

by g-moe
3 stars

LinReg Bands calculates a linear regression channel and multiple deviation bands over a user-defined length directly on the price chart. It determines the linear regression slope using weighted and simple moving averages, then projects three configurable upper

Indicator v5 TrendVolatility & bands Repaints
Updated 5 months ago · None stated GitHub repository of LinReg Bands

Gann Square of 144

by regalouisei
2 stars

This indicator overlays a Gann Square of 144 grid on the price chart for technical analysis. Users define a starting date, manual min and max price levels, and can enable automatic price and bar adjustments. The grid features vertical divisions, optional extra

Indicator v5 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of Gann Square of 144
1 stars

A price-chart indicator that tracks market structure at two swing scales, internal and external, with an EMA trend ribbon and optional structure-shift arrows. A dashboard lists modules such as trend strength, swing direction, internal and external structure, p

Indicator v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of Smart Market Structure Matrix Pro
1 stars

This strategy computes a Stochastic Oscillator K and D lines with customizable length, smooth periods, and overbought/oversold thresholds. It generates long signals on K/D crossover below the oversold level in a bullish regime defined by price above a 200 EMA,

Strategy v6 Oscillators & momentumMean reversion
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Stoch v6

Test 026 Lvl2

by ricardosantos79
261 stars

Test 026 Lvl2 is an experimental overlay indicator designed to plot dynamic structural trend lines. It tracks local extreme high and low price points based on candle relationships and direction shifts, dynamically updating pre-allocated line drawings on the ma

Indicator v4 Support & resistanceTrend
Updated 4 years ago · None stated GitHub repository of Test 026 Lvl2

My strategyP

by hasnocool
106 stars

This strategy draws on the price chart and opens a long when a five-period exponential moving average crosses above a ten-period exponential moving average. It opens a short when a six-period exponential moving average crosses below an eleven-period exponentia

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of My strategyP

My Script

by be-thomas
65 stars

Calculates a simple moving average with a dynamic period based on the location of recent highs and lows. It measures the relative distance of the highest high and lowest low bars within a lookback period, uses that distance to adjust the smoothing length dynam

Indicator v4 Moving averagesTrend
Updated 6 days ago · GPL-3.0 GitHub repository of My Script

Shooting Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator marks a bearish shooting star on the price chart. It looks for a small real body near the low, an upper shadow at least twice the body, and no meaningful lower shadow, and it only confirms the pattern while price is in an uptrend. The trend filt

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Shooting Star - Bearish

Sergiosqueeze B002

by ruckard
13 stars

Sergiosqueeze B002 is an automated trading strategy based on Squeeze Momentum and moving average closing lines designed to work with Zignaly copy trading webhooks. It executes long or short positions based on momentum direction and exits when momentum weakens.

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Sergiosqueeze B002

Fisher Transformator Index

by eddiebelaval
7 stars

This indicator plots a modified Fisher Transform oscillator alongside an adjustable trigger line in a separate pane. It calculates normalized median price values, applies smoothing and clipping, and transforms the result into Gaussian probability distribution

Indicator v5 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Fisher Transformator Index

LinReg MTF

by g-moe
3 stars

LinReg MTF plots up to three linear regression channels on the price chart, each from its own timeframe. For every enabled timeframe it draws an upper band, lower band, and midline from a chosen price source, regression length, and deviation. Users can show or

Indicator v5 Trend
Updated 5 months ago · None stated GitHub repository of LinReg MTF

SmartTrend Pro

by vedkanani123
1 stars

A trend indicator on the price chart with an adaptive volatility trend engine controlled by a sensitivity and an ATR period. Signals get a score from 0 to 100, with a minimum score and a strong-only option, and pullback signals can be added. A trend cloud, an

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of SmartTrend Pro
1 stars

This strategy executes trend-following trades based on Supertrend reversals filtered by exponential moving averages. Long trades enter when the Supertrend turns bullish while the close is above the 50 and 200 EMAs. Short trades enter when the Supertrend turns

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Supertrend v6
106 stars

This strategy backtests hammer and star candlestick patterns on the price chart. It filters setups with an exponential moving average slope angle, optional swing high and low checks, and entry-candle size versus ATR. It opens one position at a time inside a us

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of NoSKi Hammer Star Backtester %

Sergiosqueeze D004

by ruckard
13 stars

Sergiosqueeze D004 is a trading strategy designed for automated execution via Zignaly alerts. It utilizes squeeze momentum logic to open long positions when momentum expands positively and short positions when momentum expands negatively, exiting when the sign

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Sergiosqueeze D004
3 stars

Calculates and plots multi-timeframe linear regression channels with customizable deviation bands directly on the price chart. The indicator overlays channels from multiple higher timeframes, ranging from intraday minutes to daily charts. Users can independent

Indicator v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of LinReg MTF More TFs

Statistical Trailing Stop

by vedkanani123
1 stars

An overlay indicator that draws a trailing stop whose distance comes from a statistical distribution of recent price movement. Data length sets the sample window, distribution length sets how much history is normalised, and a base level setting picks one of fo

Indicator v6 Volatility & bandsTrend
Updated 2 months ago · None stated GitHub repository of Statistical Trailing Stop
1 stars

This strategy plots three exponential moving averages on the price chart and trades when they stack in order. It opens a long when the fast average rises above the middle and the middle rises above the slow, the close is above an optional regime average, and v

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Triple EMA v6

This indicator calculates and plots a linear regression channel directly on the price chart using a combination of Weighted Moving Average (WMA) and Simple Moving Average (SMA) values to derive slope and intercept. It projects a center regression line along wi

Indicator v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of LinReg MTF More TFs EXPORT ONLY

This indicator detects harmonic patterns using a Zigzag pivot engine and derives trend-following entry and stop levels relative to key pattern legs. It overlays dynamic trailing levels on the price chart to assist in tracking market direction following pattern

Indicator v5 TrendSupport & resistance Repaints
Updated 8 months ago · None stated GitHub repository of Harmonic Patterns Based Trend Follower

StealthTrail SuperTrend

by vedkanani123
1 stars

An ATR SuperTrend indicator on the price chart with an adaptive multiplier that scales with volatility relative to its average. Flips use a cushion measured in ATR and a signal cooldown, and can require an RSI threshold and optional volume. Risk presets draw a

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of StealthTrail SuperTrend

KC Combo v2

by nishpa800
1 stars

Draws a Keltner Channel and ATR supertrend on the price chart and marks candles where gated combinations of pullback, displacement and volume detectors fire together. Inputs set the base moving average, channel length, ATR multiplier and displacement threshold

Indicator v5 Volatility & bandsTrend
Updated 2 months ago · None stated GitHub repository of KC Combo v2

Relative Vigor Index

by hasnocool
106 stars

This strategy overlays two exponential moving averages and ATR-based price targets directly on the price chart while calculating the Relative Vigor Index internally. It enters long positions when the RVI line crosses above its signal line during an established

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Relative Vigor Index

Smoothed Moving Average

by TWODS-CAPITAL
37 stars

The Smoothed Moving Average indicator calculates and plots a smoothed moving average directly on the price chart. It initializes using a simple moving average over the user-defined length and recursively updates using previous average values to reduce noise an

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of Smoothed Moving Average
9 stars

ZigZag Core calculates and overlays market structure swing high and low points using customizable pivot depth, minimum pivot spacing, and flexible reversal filtering modes such as Percentage, ATR, or Hybrid. It plots connecting swing legs, developing legs, mar

Indicator v6 Support & resistanceTrend Repaints
Updated 3 days ago · MIT GitHub repository of ZigZag Core [WavesUnchained]
1 stars

A SuperTrend-style indicator on the price chart that can tune its ATR length and multiplier automatically from a profile of the instrument over a lookback window. It adds multi-timeframe confluence with selectable strictness and an optional machine-learning si

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of StealthTrail SuperTrend ML Pro

KC Combo v3

by nishpa800
1 stars

Draws a Keltner Channel and ATR supertrend on the price chart and marks candles where gated combinations of pullback, displacement and volume detectors fire together. Inputs set the base moving average, channel length, ATR multiplier and displacement threshold

Indicator v5 Volatility & bandsTrend
Updated 2 months ago · None stated GitHub repository of KC Combo v3
1 stars

Tn Sovereign VIOP Session v6 is an intraday session-filtered trend-following strategy. It generates buy and sell signals based on fast and slow Exponential Moving Average (EMA) crossovers strictly within specified session hours. Trade risk is managed using ATR

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign VIOP Session v6

This indicator calculates a custom ZigZag engine directly on the price chart to identify market structure and classic chart patterns. It automatically detects ABC corrections, symmetrical and sloped triangles, Wolfe waves, and Sperandeo 1-2-3 reversal patterns

Indicator v6 Support & resistanceTrend Repaints
Updated 3 days ago · MIT GitHub repository of ZigZag Patterns [WavesUnchained]
7 stars

The MACD RSI EMA Aggressive indicator generates momentum and trend-following signals on the price chart. It combines a MACD crossover or crossunder with an RSI threshold filter, price location relative to an Exponential Moving Average, volume expansion above a

Indicator v5 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of MACD RSI EMA Aggressive + ATR SLTP

Heat Map Seasons

by regalouisei
2 stars

Heat Map Seasons plots a linear regression of typical price and colors each price bar by how far close sits from that line. It normalizes the gap with standard deviation, clamps extreme values, and maps them from aqua through yellow to red using a heat-sensiti

Indicator v5 TrendVolatility & bands
Updated 8 months ago · None stated GitHub repository of Heat Map Seasons

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