Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 39)

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

A long-biased signal indicator for the price chart built on a Hull moving average. A buy is shown when price is above a rising HMA, provided volume agrees through a price-volume trend filter or a momentum override based on RSI applies. After a buy, a trailing

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of RAPF v21.0 [Balanced Momentum]

Hull Suite by InSilico

by turnupdigital
1 stars

An indicator that plots a Hull moving average on the price chart, with a choice of Hma, Thma or Ehma variants, an adjustable length and multiplier, and an option to take the average from a higher timeframe. The line is coloured by trend direction and can be dr

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Hull Suite by InSilico

TeeLek CDC Action Zone

by theteelek
1 stars

A multi-timeframe overlay indicator that compares an EMA 12 with an EMA 26 on weekly, daily, 6-hour, 4-hour, 2-hour and 1-hour data and shades the area between them on the chart. The fill is green when the fast average is above the slow one and red otherwise.

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TeeLek CDC Action Zone
1 stars

This strategy calculates fast and slow simple moving averages to identify trend direction changes on the price chart. It enters a long position when the fast simple moving average crosses above the slow simple moving average and opens a short position when it

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Two Moving Average Crossover

Trend Histogram

by JoeTonDev
1 stars

A separate-pane indicator that shows two trend states as colored histogram bars, a slow one from 3, 8 and 20 period simple averages and a fast one from 21, 55 and 89 period averages. Green means the averages are stacked bullishly, yellow a pullback, light red

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Trend Histogram

My strategy 11

by akash-yellgetti
1 stars

A strategy-type script for the price chart built around a fast and slow moving average pair, exponential or simple, whose lines and fill change colour with the direction of the gap. It prints B and S labels at crossovers and builds text messages for an externa

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of My strategy 11
1 stars

This indicator plots Stochastic RSI %K and %D lines over the price chart. It detects bullish and bearish divergences by comparing price highs and lows to those of Stochastic RSI within a lookback period. Users set divergence range (short, medium, long), price

Indicator v4 Oscillators & momentumTrend Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Stochastic RSI Divergence+

This indicator combines three tools on the price chart: a Supertrend built from Heikin Ashi data with a one-bar ATR and a multiplier of 1.85, an Ichimoku cloud, and a chop candle colouring based on an arctangent measure of price movement. Each part has its own

Indicator v5 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of Supertrend Ichimoku Chop Combination

EMA Cross Strategy

by tseitz
1 stars

The EMA Cross Strategy calculates an exponential moving average of close prices over a user-defined length. It enters a long position when a green candle opens above the moving average line, simultaneously closing any active short position. Conversely, it open

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of EMA Cross Strategy
257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of Donald - Test Logic Futures

Aroon (AROON)

by mihakralj
99 stars

This indicator calculates Aroon Up and Aroon Down from the bars since the highest high and the lowest low inside a chosen period. It plots both series in a separate pane with horizontal lines at 30, 50 and 70. The period input sets the lookback used for those

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Aroon (AROON)

MS+MACD Basic Tests

by iamrichardD
57 stars

This script implements an automated unit testing suite for a 4-hour swing trading system based on market structure and MACD. Utilizing a custom PineUnit framework with user-defined types, it validates mock functions for change of character, break of structure,

Strategy v6 SMC / ICT / price actionOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of MS+MACD Basic Tests
55 stars

This indicator plots the Parabolic SAR on the price chart as crosses. It computes SAR with a start of 0.02, an increment of 0.02, and a maximum of 0.2, then colors each point green when the SAR value sits below the close and red otherwise. Those acceleration v

Indicator v6 Trend
Updated 6 months ago · Apache-2.0 GitHub repository of Parabolic SAR & ATR/CMF

Calculates and plots a second-order Butterworth low-pass infinite impulse response filter on the price chart. It smooths price series data by attenuating high-frequency market noise according to a specified cutoff period. Users can adjust the length setting an

Indicator v6 Moving averagesTrend
Updated 8 months ago · MIT GitHub repository of Butterworth 2nd Order Filter (BUTTER)

This overlay strategy is written for the SOLUSDT perpetual on the one-minute chart. It tracks confirmed pivot highs and lows as resistance and support circles, then marks strong buy or sell states when close crosses those levels. Long and short conditions comp

Strategy v5 Support & resistanceBreakout Repaints
Updated 2 years ago · None stated GitHub repository of SOLUSDTPERP 1m - Strategy Candle Bar

1-Month RS

by ChartsLector
41 stars

This indicator calculates the relative strength of the current asset compared to a benchmark symbol such as SPY. It stores the price ratio across a configurable lookback window, ranks the current ratio as a percentile from 0 to 100, and plots the result as a c

Indicator v5 Oscillators & momentumTrend
Updated 4 days ago · None stated GitHub repository of 1-Month RS

Zen rEMA

by Zen-Tim
29 stars

Zen rEMA is an overlay indicator that calculates an exponential or simple moving average and an ATR-normalized slope angle over a chosen lookback. Optional markers show an always-in state that turns long after two bull bars close above the average and short af

Indicator v6 Moving averagesTrend
Updated 2 weeks ago · MIT GitHub repository of Zen rEMA

Tri VWMA

by tistaharahap
25 stars

The Tri VWMA indicator calculates and plots three Volume Weighted Moving Averages on the price chart using customizable lookback periods. It displays three distinct moving average lines to help users analyze price trends and relationships across multiple time

Indicator v4 Moving averagesTrend
Updated 6 years ago · None stated GitHub repository of Tri VWMA

Normalize Heatmap Indicator

by palitojendthen
20 stars

The Normalize Heatmap Indicator scales a chosen price source between 0 and 1 over a set lookback period using stochastic-style min-max normalization. It paints price candles on the main chart using configurable Rainbow or RGB color gradients based on the norma

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Normalize Heatmap Indicator
16 stars

This trend-following strategy adapts classic Donchian breakout channels according to market volatility regimes. It calculates an ATR percentile rank across a rolling lookback period, shifting dynamically between tighter breakout channels with smaller stops dur

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 1: Adaptive Volatility
16 stars

Follow Line Indicator X HULL combines a Bollinger Band and ATR-filtered trend line with Hull Moving Average variations (HMA, EHMA, THMA) on the price chart. It plots dynamic trend lines, visual bands, and entry or exit signal shapes on trend flips. Users can t

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Follow Line Indicator X HULL

Trend Compass 1H

by chris-c-thomas
14 stars

Trend Compass 1H provides strategic trend assessment and higher-timeframe context for 1-hour price charts. It plots an exponential moving average ribbon along with key structural reference levels from higher timeframes, including 4-hour, daily, and weekly EMAs

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

Manias, Panics and Crashes

by MeridianAlgo
9 stars

Manias, Panics and Crashes is a separate-pane market regime indicator that quantifies market sentiment and systemic risk. It processes technical metrics including RSI, moving averages, and volume alongside optional intermarket data such as VIX volatility and c

Indicator v6 Oscillators & momentumVolatility & bands
Updated 4 months ago · MIT GitHub repository of Manias, Panics and Crashes

Multi-Trend

by lunarticktrading
7 stars

This indicator draws a combined trend overlay on the price chart. It can enable a SuperTrend based on ATR length and a factor, a fast and slow moving-average cloud using SMA or EMA, and a VIDYA line. Separate switches control whether each component is calculat

Indicator v6 TrendMoving averages
Updated 2 weeks ago · None stated GitHub repository of Multi-Trend

Tiered Exit (Memecoin)

by muammeryldrm42
7 stars

This strategy enters long trades when a fast EMA crosses above a slow EMA. Position risk and profits are managed through tiered exit stages: three custom percentage-based profit targets with partial exits, a hard percentage stop loss, and a trailing drawdown e

Strategy v5 TrendMoving averages Repaints
Updated 3 months ago · MIT GitHub repository of Tiered Exit (Memecoin)

This indicator plots a linear regression channel on the price chart. It fits a regression line to a chosen source over a lookback length, then draws the base line plus optional upper and lower deviation bands scaled by multipliers. Fibonacci ratios mark intern

Indicator v5 TrendSupport & resistance
Updated 4 months ago · None stated GitHub repository of Regression Trend with Fibonacci

An Ichimoku-based trading strategy that plots the complete Ichimoku Kinko Hyo system directly on the price chart. Long signals trigger when Tenkan-Sen is above Kijun-Sen and positioned above the current Kumo cloud, exiting when Tenkan-Sen falls below Kijun-Sen

Strategy v5 TrendSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo: Tenkan Kumo Strategy

SuperTrend

by trsdn
6 stars

The SuperTrend indicator computes upper and lower bands from ATR values using a multiplier on a selected source such as HL2. It maintains adaptive trend lines that shift color from green to red based on price position relative to the bands. The green line func

Indicator v5 TrendVolatility & bands
Updated 7 days ago · MIT GitHub repository of SuperTrend

Capital41 Fusion Scalp

by damianpitt
6 stars

Capital41 Fusion Scalp is an overlay indicator that identifies high-confluence setups by combining four core conditions: EMA trend direction, RSI momentum, Williams %R levels, and ATR with volume expansion. Bullish and bearish signals are plotted on the chart

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Capital41 Fusion Scalp

CB LinReg

by jerryinyang
5 stars

CB LinReg calculates linear regression channels across primary and multi-timeframe periods. It computes linear regression lines along with standard deviation channel bands to analyze price trends and potential reversal zones. Settings allow users to adjust pri

Indicator v4 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of CB LinReg

50 EMA + 200 EMA

by krosenfeld7
5 stars

This indicator plots a short-term 50-period exponential moving average (EMA) and a long-term 200-period EMA directly on the main price chart. It generates long and short signals when price crosses the 50 EMA in alignment with the broader trend defined by the r

Indicator v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 50 EMA + 200 EMA

Antigravity Superstar

by eltonaguiar
4 stars

This strategy draws on the price chart and combines a triple EMA stack, a volume spike with a minimum price move, and a MACD line-signal crossover. It enters long or short only when at least the chosen number of those three signals agree, with an optional RSI

Strategy v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Antigravity Superstar

MTF Trend Dashboard Lab

by mitchell-917
4 stars

This indicator evaluates and displays market trend direction across four user-defined timeframes simultaneously. For each timeframe, it calculates a moving average and compares the timeframe close price against it to determine a bullish, bearish, or neutral bi

Indicator v5 Screeners & dashboardsMoving averages
Updated 11 months ago · Custom licence GitHub repository of MTF Trend Dashboard Lab

Nazilli SuperTrend

by Kalumur
4 stars

The Nazilli SuperTrend indicator combines an ALMA moving average with multiple SuperTrend configurations to identify trend changes on the price chart. It plots the ALMA line in blue and red colors for up and down trends, along with SuperTrend lines for four di

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Nazilli SuperTrend

Swing Trade

by might-tree
4 stars

This strategy plots three swing lines on the price chart. A small swing marks the current high after one higher high, or the current low after one lower low. A medium swing requires two consecutive rising highs or falling lows, and a large swing requires three

Strategy v5 TrendSupport & resistance
Updated 3 years ago · None stated GitHub repository of Swing Trade
3 stars

This strategy overlays the price chart to generate trading signals by combining Quantitative Qualitative Estimation (QQE), a custom SuperTrend, and a CCI ATR trend metric. It colors candles green or red according to combined trend alignment and enters long or

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Bankai DTEK Strategy

MirPapa_Lib_trend

by alvinng214
2 stars

MirPapa_Lib_trend is a Pine Script utility library providing trend and momentum calculation functions for other scripts. It features implementations for several moving average types, including the Hull Moving Average (HMA), Exponential Hull Moving Average (EHM

Library v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MirPapa_Lib_trend

ZEGUELA DEMATRON AXS 2H

by danielvm-git
2 stars

This strategy calculates and plots three double exponential moving averages (DEMA) on the price chart using lengths of 8, 24, and 0. It generates long signals on DEMA crossovers and short signals on crossunders. Positions are entered based on these signals and

Strategy v4 Moving averagesTrend Repaints
Updated 2 months ago · MIT GitHub repository of ZEGUELA DEMATRON AXS 2H

Momentum-based ZigZag + 趋势

by wynnforthework
2 stars

This strategy combines momentum-based ZigZag calculations with a Supertrend overlay and an EMA trend filter to generate trading entries. It allows selecting between QQE, MACD, or Moving Averages to drive the ZigZag pivot logic. The strategy includes adjustable

Strategy v5 TrendOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Momentum-based ZigZag + 趋势

HTF EMA

by Web3Degenerate
2 stars

This Pine Script indicator plots a higher-timeframe exponential moving average on the price chart. The script calculates the EMA using a configurable length and timeframe, then applies request.security to retrieve the value without repainting. It draws the lin

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of HTF EMA

This indicator combines a Nadaraya-Watson kernel regression estimator with moving average trend overlays. It recalculates kernel-weighted lines across historical bars on the latest candle, plotting reversal arrows when the curve direction shifts. Additionally,

Indicator v4 Moving averagesTrend Repaints
Updated 4 years ago · MIT GitHub repository of Nadaraya-Watson Estimator + Moving Average Colored EMA/SMA

Candlestick Structure [LuxAlgo] detects multiple classic bullish and bearish candlestick patterns in the context of broader market structure. It evaluates patterns such as hammers, engulfing candles, stars, haramis, tweezers, and three-method formations agains

Indicator v5 Candlestick patternsTrend
Updated 2 days ago · Custom licence GitHub repository of Candlestick Structure [LuxAlgo]

Dial Main Period

by pineforge-4pass
1 stars

A long-only EMA crossover strategy whose fast and slow lengths change with the chart timeframe. Separate pairs of lengths are set for 5, 15, 60 and 240 minute charts, and other timeframes use the 15 minute pair. It enters long when the fast EMA crosses above t

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Dial Main Period

MA Cross

by GammaExpansion
1 stars

This strategy calculates fast and slow moving averages using SMA or EMA selections and plots them on the price chart. It signals long entries on fast MA crossing above slow MA, optionally requiring slow MA to be rising. It closes positions on fast MA crossing

Strategy v6 Moving averagesTrend
Updated 7 days ago · MIT GitHub repository of MA Cross

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