Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 73)

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

1 stars

This strategy estimates intrabar volume delta using bar ranges and volume, smoothing it with a moving average to detect divergence against price action. Trades are taken when bullish or bearish divergences align with a long-term EMA trend filter. Position exit

Strategy v6 VolumeDivergence
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Volume Delta
99 stars

Gann High-Low Activator plots a trend line on the price chart from simple moving averages of highs and lows. Close above the high average sets a bullish trend and the line follows the low average; close below the low average sets a bearish trend and the line f

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Gann High-Low Activator

Lower Labels

by g-moe
3 stars

Lower Labels is a cross-asset market structure indicator that plots candles and swing structure labels for a selected secondary symbol in a separate pane. It calculates pivot highs and pivot lows to classify market structure patterns including higher highs, hi

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 5 months ago · None stated GitHub repository of Lower Labels
1 stars

This strategy pairs the Vortex Indicator with an exponential moving average trend filter to execute trend-following trades. It initiates a long entry when VI+ crosses above VI- while price trades above the 200 EMA, and a short entry when VI- crosses above VI+

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Vortex v6
99 stars

This indicator plots a Gaussian filter of a chosen price source on the price chart. It builds a normalized Gaussian kernel whose width follows the sigma setting, then convolves that kernel with recent bars to produce a smoothed value. Sigma controls how wide t

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Gaussian Filter (GAUSS)

Trailering A004

by ruckard
13 stars

Trailering A004 is an automated trading strategy designed to optimize entry and exit points while minimizing stop loss and maximizing take profit. It calculates signals using high and low closing moving averages and supports strict long or short filtering. The

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering A004

M&M Trading

by g-moe
3 stars

M&M Trading is an overlay indicator that combines momentum calculations with moving averages and a visual dashboard. It calculates a modified Chande Momentum Oscillator with adjustable multipliers to identify bullish and bearish momentum triggers, optionally c

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of M&M Trading

Trailering B001

by ruckard
13 stars

Trailering B001 is an automated trading strategy designed to generate trade alerts and integrate with Zignaly copy-trading platforms. It utilizes custom moving average bounds (Curie High and Low closing MAs) to gauge price excursions and trigger long or short

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trailering B001

ORION: Hybrid Strategy

by eddiebelaval
7 stars

This strategy identifies volatility breakout opportunities by constructing dynamic ATR-based price boxes and detecting volatility squeezes. Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger up

Strategy v5 Volatility & bandsBreakout
Updated 3 months ago · None stated GitHub repository of ORION: Hybrid Strategy

MA Trend Percent Target Strategy is a trend-following overlay strategy that executes trades based on price crossovers with a moving average. It supports multiple moving average types, including SMA, EMA, WMA, VWMA, and HMA. Trades enter when price crosses abov

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of MA Trend Percent Target Strategy

SuperTrend Recovery

by vedkanani123
1 stars

A SuperTrend variant for the price chart using ATR bands around the midpoint of each bar. When price moves against the level where the trend last switched by more than a threshold in ATRs, the band moves toward price by a small percentage weight, so the trend

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

The ORB + Fib + MACD Indicator combines Opening Range Breakout mechanics with Fibonacci retracement levels and MACD momentum filtering. It determines the high and low bounds of a user-defined initial session window, projects Fibonacci entry zones, and calculat

Indicator v5 Sessions & timeSupport & resistance
Updated 7 months ago · None stated GitHub repository of ORB + Fib + MACD Indicator

How To Set Time Ranges

by regalouisei
2 stars

How To Set Time Ranges is a strategy template designed to demonstrate date and time filtering for backtesting. It calculates fast and slow simple moving averages to trigger long entries on bullish crossovers and close positions on bearish crossunders. Trades a

Strategy v5 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of How To Set Time Ranges

Synapse Trail Pro

by vedkanani123
1 stars

A trailing-stop trend indicator on the price chart. The trail is based on an EMA with an ATR band whose multiplier can adapt to volatility, and a ratchet option stops the trail from loosening. Signals receive a quality score and can be filtered by a minimum sc

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

The strategy calculates the Stochastic oscillator using specified K and D periods, then detects bullish and bearish divergences between price pivots and the D line. Bullish signals occur when price forms lower lows while Stochastic forms higher lows within the

Strategy v6 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of TN Stochastic Causal Divergence

HA: Heikin-Ashi

by mihakralj
99 stars

This indicator calculates and plots Heikin-Ashi smoothed candlesticks directly on the price chart. It derives the smoothed close from standard price averages and recursively computes the open, high, and low values. The script does not issue trade signals or al

Indicator v6 Candlestick patternsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of HA: Heikin-Ashi

Supertrend

by TWODS-CAPITAL
37 stars

This indicator plots the Supertrend line on the price chart using TradingView's built-in Supertrend calculation. It derives the line from the average true range and a multiplier, then colors an uptrend green and a downtrend red. A light fill sits between the c

Indicator v5 TrendVolatility & bands
Updated 3 years ago · MIT GitHub repository of Supertrend

Trailering C002

by ruckard
13 stars

This strategy evaluates price excursion using Curie closing moving averages on the price chart to trigger trades and manage positions. It supports both long and short positions with configurable strategy date ranges and strict mode conditions. Built as an auto

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering C002

MACD Signals

by g-moe
3 stars

The MACD Signals indicator plots dual Exponential Moving Averages (EMAs) and generates buy and sell signals directly on the price chart based on MACD crossovers filtered by trend context. Users can configure independent EMA and MACD parameter settings for long

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of MACD Signals
1 stars

A short price-chart indicator that plots a 20 and a 50 period EMA and waits for a pullback after each crossover. After the 20 crosses above the 50, it looks for price to touch the 50 and then prints a buy triangle on the next green-closing candle. After a down

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of Terilss EMA20-EMA50 Pullback Alert

Hann FIR Filter (HANN)

by mihakralj
99 stars

This indicator calculates a finite impulse response filter using Hann window coefficients and plots the smoothed series on the price chart. It weights the selected source with a raised-cosine window over the chosen length and divides by the sum of the weights.

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Hann FIR Filter (HANN)

Supertrend Strategy

by TWODS-CAPITAL
37 stars

This strategy uses the built-in Supertrend calculation to generate long and short trade entries based on trend reversals. It triggers a long position when the Supertrend direction flips to indicate an uptrend and a short position when it flips to indicate a do

Strategy v5 TrendVolatility & bands
Updated 3 years ago · MIT GitHub repository of Supertrend Strategy

The Bear Crossover

by vedkanani123
1 stars

A simple moving average crossover indicator drawn on the price chart. It plots an 11-period and a 51-period exponential moving average. A BUY label appears when the fast line crosses above the slow line on a bullish candle, and a SELL label appears when it cro

Indicator v6 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of The Bear Crossover

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy

Trailering E002

by ruckard
13 stars

Trailering E002 is a trading strategy that uses moving average closing lines to optimize entries, take profit levels, and stop loss execution. Applied directly on the main price chart, it tracks price excursion to refine trades and includes date filtering for

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trailering E002

Ichimoku Kinkō Hyō

by regalouisei
2 stars

This indicator plots an enhanced version of the traditional Ichimoku Kinkō Hyō on the main price chart. It calculates adaptive Tenkan-Sen and Kijun-Sen lines using dynamic lookback periods adjusted by volume, ATR volatility, and Chikou trend filters. Users can

Indicator v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Ichimoku Kinkō Hyō
106 stars

This overlay strategy plots a two-timeframe Ichimoku setup on the price chart, with Tenkan, Kijun, Chikou, and Kumo from a base higher timeframe and an optional highest-timeframe cloud. It allows two entries in the same direction and uses ATR-based trailing st

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of 2Tier Ichimoku Pyramiding [Takazudo]

Technical Ratings Strategy

by TWODS-CAPITAL
37 stars

A multi-indicator consensus strategy that computes combined rating signals from various moving averages and technical oscillators, including RSI, Stochastic, MACD, CCI, ADX, and Ichimoku Cloud. Depending on user configuration, trades are triggered by overall c

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of Technical Ratings Strategy

Trailering F008

by ruckard
13 stars

Trailering F008 is a reversal strategy and execution template designed to send automated trade signals to Zignaly copy-trading platforms. It generates entry conditions using custom moving average envelopes known as Curie closing lines, aiming to optimize posit

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering F008

This indicator overlays a Hull Moving Average and three Exponential Moving Averages on the price chart while monitoring signals from MACD, Stochastic Oscillator, and Time Segmented Volume. It tracks trend direction changes, MACD histogram color shifts from bri

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MACD Signals with Alert System

Ichimoku Oscillator

by regalouisei
2 stars

The Ichimoku Oscillator indicator calculates conversion line, base line, leading span, and lagging span using specified periods. It plots these values in a separate pane along with an optional EMA overlay. Main settings allow customization of line lengths, ATR

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Ichimoku Oscillator

The Morindok Dynamic Gann Spiral Ratio indicator computes time and price angles derived from a dynamic N value based on volatility and a selected price source. It calculates a ratio between these angles and generates buy or sell signals when the ratio approach

Indicator v5 Support & resistanceTrend
Updated 7 weeks ago · None stated GitHub repository of Morindok Dynamic Gann Spiral Ratio

Trend Context

by vedkanani123
1 stars

A price-chart indicator that classifies the market as up, down or neutral using an adaptive baseline whose smoothing speed follows price efficiency. A weighted score combines price location against ATR zones, baseline slope, momentum and position within the re

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

A strategy on the price chart that builds a four-point audit score from a higher-timeframe EMA, fast versus slow moving average, volume against its average, and bar movement against ATR. When the score reaches a minimum, it logs a message and moves through enu

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of TN Universal Sovereign

Target Radar

by eddiebelaval
7 stars

Target Radar is a multi-factor forecasting indicator that plots projection bands, forward boxes, and dynamic target zones directly on the main price chart. It calculates a forecast score by combining z-scores for trend, momentum, volume pressure, and volatilit

Indicator v5 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Target Radar

This strategy combines MACD histogram crossovers with a dual moving average cloud to generate long and short trading signals directly on the price chart. It evaluates histogram crossings relative to zero while filtering entries using overall MACD positioning a

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MACD Signals with Trading Dashboard Strategy

Uptrick Vector Trail Trend

by vedkanani123
1 stars

A price-chart indicator that estimates trend with a smoothed velocity and a projected vector, then draws an ATR-based trailing line coloured by direction. Up and down signals appear on trend changes. Optional dynamic take-profit markers use momentum and a Z-sc

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Uptrick Vector Trail Trend
106 stars

This Pine Script strategy identifies potential Buy Today, Sell Tomorrow (BTST) opportunities based on price action and volume patterns. It calculates a 20-period simple moving average of volume and checks for three consecutive bullish candles with higher highs

Strategy v4 TrendVolume
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Higher High Price & Vol
1 stars

A price-chart indicator by BigBeluga that draws a custom volatility-based Supertrend with an optional shaded trend cloud, and marks order blocks at confirmed swing pivots. Each block shows its buy and sell volume percentage. Blocks can be removed once price br

Indicator v6 SMC / ICT / price actionTrend
Updated 2 months ago · None stated GitHub repository of Volume-Trend Order Block Engine
1 stars

A strategy that sorts the market into quiet, active and extreme regimes using ATR as a percentage of price against two thresholds. Position size is 15 percent of equity in quiet markets, 25 percent in active ones, and zero in extreme ones. Entries are long onl

Strategy v6 Volatility & bandsTrend
Updated 2 months ago · None stated GitHub repository of TN Volatility Regime Sovereign
106 stars

This Pine Script strategy calculates three RSI indicators with periods 50, 75 and 100 on the chosen source. It computes multiple simple and exponential moving averages on the fast RSI and assigns colors based on changes relative to the slow RSI. Long entries t

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 3 RSI MA movement crypto strategy
99 stars

This indicator calculates a causal approximation of the Hodrick-Prescott filter. It plots a smoothed trend of the selected source and a cycle equal to the source minus that trend. Lambda controls smoothing; the source defaults to close. The trend is drawn on t

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Hodrick-Prescott Filter (HP)

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