Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 47)

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

Turtle Trading Strategy

by GreyssonEnterprises
1 stars

This strategy overlays four smoothed moving averages and a trend fill between a two-period EMA and the longest average on the price chart. It marks optional three-line strike and engulfing candle patterns. Inputs set a Donchian channel length, the four average

Strategy v5 TrendMoving averages
Updated 3 months ago · MIT GitHub repository of Turtle Trading Strategy

Trend-Quality Indicator

by tthanhvu002sgu
1 stars

Measures how strong and clean a trend is, in a separate pane. A fast and slow EMA define direction; the script accumulates price change while the direction holds and smooths it into a trend value. That value is divided by a noise estimate, linear or squared, t

Indicator v5 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Trend-Quality Indicator

Algo Trend System TG

by Focal-QuantAI
1 stars

An indicator on the price chart that follows an ATR-based trend line with a factor setting, plus a fast and slow EMA cloud, and prints signals with fixed dollar stop loss and three take profit distances. Signals can be limited to two time sessions in a chosen

Indicator v5 TrendSessions & time
Updated 6 months ago · None stated GitHub repository of Algo Trend System TG

Simple MA Crossover Strategy

by gabriel-klettur
1 stars

The Simple MA Crossover Strategy calculates and plots a 55-period EMA and a 200-period EMA directly on the main price chart. It generates long entry signals when the 55 EMA crosses above the 200 EMA and short entry signals when it crosses below. Positions are

Strategy v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Simple MA Crossover Strategy
1 stars

A multi-feature indicator on the price chart that prints buy and sell signals in confirmation or contrarian mode with exits, adjustable sensitivity and tuning, and a signal quality score from 1 to 4. Presets for trend, scalping, swing and contrarian styles app

Indicator v5 TrendScreeners & dashboards
Updated 1 year ago · None stated GitHub repository of Lux Algo Signals and Overlays
1 stars

This price-chart indicator simulates dollar-cost averaging between a start date and an end date. It builds a five-bar Hull moving average, smooths it with an exponential average, and colors the line by direction. Inside the window, every bar adds a fixed BTC s

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of TeeLek Lab 03 DCA and Pause

BBTrend

by ivansoft
1 stars

Plots a histogram in a separate pane that compares two sets of Bollinger Bands, a short one of 20 bars and a long one of 50 bars by default. It measures how far apart the lower bands are minus how far apart the upper bands are, scaled by the short middle band.

Indicator v6 Volatility & bandsTrend
Updated 1 year ago · None stated GitHub repository of BBTrend

Indicators

by fiji-solutions
1 stars

This basic script demonstrates how to calculate and plot a simple technical indicator in Pine Script. It computes a 14-period Exponential Moving Average (EMA) using the closing price of each bar and renders the line in a separate pane. Designed as an education

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

Gann High Low

by rajatjpatel
1 stars

A Gann HiLo activator drawn on the price chart. It averages highs over one period and lows over another, 13 and 21 by default. When the close breaks below the prior low average, the line switches to the high average and turns maroon; when the close breaks abov

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Gann High Low
1 stars

A Pine v4 strategy that plots a 12-period exponential moving average of the close in orange on the price chart. It goes long when a green candle opens above the average and short when a red candle opens below it, closing each position when the opposite signal

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

The Alpha-Decreasing Exponential Moving Average (ADEMA) calculates an exponential moving average where the smoothing factor decreases dynamically relative to the bar index. On early bars, the weight given to new price data is larger, making the calculation rea

Indicator v4 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Alpha-Decreasing Exponential Moving Average
330 stars

This indicator plots three moving averages taken from separate timeframes onto the price chart. The user chooses either exponential or simple averages, then sets a timeframe and period for each of the three lines, defaulting to 15-minute, 60-minute, and 240-mi

Indicator v5 Moving averagesTrend
Updated 2 months ago · None stated GitHub repository of 3 Multi Timeframe EMA/SMA
257 stars

This strategy executes trades on futures contracts by combining custom smoothed price bars with a multi-timeframe stochastic oscillator and Ichimoku elements. It calculates percentage-based stop-loss and take-profit targets for long and short positions. It ove

Strategy v5 Oscillators & momentumTrend Repaints
Updated 7 weeks ago · None stated GitHub repository of ESH2023 5M Futures No Repaint

EMA Crossover Strategy

by TradersPost
228 stars

EMA Crossover Strategy plots a fast and a slow exponential moving average on the price chart. It treats a confirmed fast-over-slow cross as a long condition and a confirmed cross under as a short condition. Position size is a percentage of equity. Optional per

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of EMA Crossover Strategy

Five-in-one Strategy

by capissimo
114 stars

Five-in-one Strategy combines five analytical tools into a single price chart overlay: the Dual Thrust Trading Algorithm (DTTA), Semafore, HalfTrend, Nick Rypock Trailing Reverse, and Tweezer or Kangaroo Tail candlestick patterns. It generates trade signals us

Indicator v4 TrendBreakout Repaints
Updated 1 year ago · None stated GitHub repository of Five-in-one Strategy

5msm VISHNU

by hasnocool
106 stars

This strategy overlays several classic studies on the price chart. It calculates a MACD-style oscillator from fast and slow moving averages with a signal line, a 200-period exponential moving average, and Williams Alligator smoothed averages for the jaw, teeth

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

Example 3

by be-thomas
65 stars

This indicator calculates and plots a 5-period simple moving average and a 20-period simple moving average directly on the price chart. It visualizes the channel between the two moving averages by filling the background space with dynamic colors. When the 5-pe

Indicator v5 TrendMoving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Example 3

Supertrend Strategy

by dcaoyuan
55 stars

This indicator calculates a Supertrend line combined with a 200-period exponential moving average for trend filtering. It plots the Supertrend lines and background fills directly on the price chart, generating buy and sell signal labels when the trend directio

Indicator v6 TrendMoving averages
Updated 6 months ago · Apache-2.0 GitHub repository of Supertrend Strategy
24 stars

This strategy plots a Supertrend and a double exponential moving average on the price chart. Supertrend direction flips mark buy and sell signals, with optional labels and trend highlighting. The DEMA uses a selectable timeframe and source and is requested wit

Strategy v5 TrendMoving averages Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Super Duper Trend Strategy
16 stars

This strategy enters long or short Donchian breakouts and sizes each unit from a percentage of equity and ATR. It sets an initial ATR stop, trails with a chandelier stop, and tightens that trail after a chosen number of bars. Optional profit targets close one

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 25: Time Profit Lock

Heikin Ashi Dots

by lunarticktrading
7 stars

Heikin Ashi Dots calculates trend momentum using Heikin-Ashi candle values retrieved across a customizable timeframe. It evaluates the relationship between the open and close of the current and prior Heikin-Ashi bars, plotting a horizontal series of colored ci

Indicator v6 TrendCandlestick patterns
Updated 2 weeks ago · None stated GitHub repository of Heikin Ashi Dots

Smooth Theil-Sen

by eddiebelaval
7 stars

This indicator calculates and plots a smoothed Theil-Sen robust linear regression line directly on the price chart alongside statistical deviation bands. It uses Gaussian kernel weighting to blend between median and mean calculations for slopes and residuals.

Indicator v6 TrendVolatility & bands
Updated 3 months ago · None stated GitHub repository of Smooth Theil-Sen
6 stars

Wick Rejection S/R Strategy identifies key support and resistance zones based on candlestick wick rejections and liquidity sweeps directly on the price chart. It calculates potential reversal and breakout retest zones using configurable wick thresholds, level

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of Wick Rejection S/R Strategy
5 stars

Quick Scan for Cycles is a technical indicator designed to analyze cyclic behavior in financial asset prices. Operating in a separate indicator pane, it uses a customizable data source and bar lookback length to process price data and scan for recurring cycle

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Quick Scan for Cycles

This short-only strategy enters when price is below a daily 50-period EMA, crosses under a four-hour 50-period EMA, and closes below the previous bar low. Position size is 20 percent of equity. Exits use a limit and stop based on percentage distances by defaul

Strategy v4 TrendMoving averages Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Daily Trend + 4 Hour Reversal + 15 Min Pressure Short
4 stars

This strategy trades Ethereum with a fast and slow exponential moving average crossover filtered by a 200-period EMA. It enters long when the fast EMA crosses above the slow EMA and price is above the 200 EMA. Shorts stay off by default and open only when that

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Ethereum ETH Strategy [trugurpala]

SPY Trending

by dearvn
4 stars

SPY Trending is an indicator designed for SPY that evaluates trend alignment across multiple timeframes using Exponential Moving Averages (5, 10, and 20 EMAs). It fetches data across lower and higher timeframes to evaluate buy and sell conditions, displaying t

Indicator v5 Moving averagesScreeners & dashboards Repaints
Updated 4 years ago · None stated GitHub repository of SPY Trending

Jash Test

by jash-git
3 stars

This indicator plots five Fibonacci-based exponential moving averages on the main price chart, using lengths of 3, 13, 34, 55, and 144. It tracks Guppy Multiple Moving Average and Granville concepts to analyze trend direction and alignment. The script tests wh

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of Jash Test

CCI + Stoch + HA

by g-moe
3 stars

This indicator combines three momentum and trend analysis tools into a separate pane: a multi-timeframe Commodity Channel Index (CCI), a multi-timeframe Stochastic Oscillator, and a dual-EMA smoothed Heikin-Ashi trend bias displayed as colored dots. Users can

Indicator v5 Oscillators & momentumTrend Repaints
Updated 5 months ago · None stated GitHub repository of CCI + Stoch + HA

Swiss Knife

by IAMATOMIC001
3 stars

This Pine Script indicator draws fractal levels on the price chart. It computes up and down fractals by evaluating high and low values across multiple bars using custom array functions. The code defines weighted array sums and slices to identify fractal indice

Indicator v5 Support & resistanceTrend
Updated 12 months ago · None stated GitHub repository of Swiss Knife

Skew Weighted Average Price (SWAP) calculates a skew-weighted average price for nuanced analysis of price dynamics and potential trading opportunities. The script determines skew by comparing smoothed positive and negative true ranges derived from price direct

Indicator v5 Volatility & bandsSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Skew Weighted Average Price (SWAP)

This strategy identifies buy and sell entry points for XAUUSD using a combination of exponential moving averages, RSI, Stochastic oscillators, ATR, and Fibonacci zones. It supports multi-mode execution featuring confirmation and scalp entries triggered by over

Strategy v5 TrendOscillators & momentum

This strategy plots support and resistance from the highest high and lowest low over a lookback window, and can overlay Bollinger Bands on the price chart. It calculates RSI or MFI, optionally from Heikin Ashi prices, and exposes WaveTrend, Laguerre smoothing

Strategy v5 Support & resistanceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Support and Resistance with RSI and Trend Filter
2 stars

ZigZag (Using Line Array) plots zigzag lines on the price chart to identify swing highs and lows. Bullish and bearish pivots are drawn with green and red lines respectively, while trap zones use orange and lime colors. Labels display pivot labels like HH or HL

Indicator v4 TrendSupport & resistance
Updated 3 years ago · None stated GitHub repository of ZigZag (Using Line Array)

Trendsignal

by DaniilOkrug
2 stars

Trendsignal plots buy and sell markers on the price chart when a short-term trend flips. It measures the average high-low range and the highest and lowest prices over a fixed nine-bar window, then builds inner thresholds from the RISK setting. A close above th

Indicator v4 TrendBreakout Repaints
Updated 4 years ago · MIT GitHub repository of Trendsignal

My First Strategy

by jayadevrana
1 stars

This strategy plots an exponential moving average on the price chart and opens a long position when the close crosses above that average, but only when no position is already open. It exits with a percentage stop loss and a percentage take profit measured from

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of My First Strategy

Drawing Visual Noise Geometry

by pineforge-4pass
1 stars

This strategy plots a 14-period simple moving average as a chart line and fills the space between two overlapping lines. It creates a small label on each bar, then overwrites the label text. It enters one long contract when close crosses above the line level a

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of Drawing Visual Noise Geometry

Volume Breakout Strategy

by kanylbullen
1 stars

This strategy identifies breakouts using Keltner Channels combined with volume spike filters, ADX trend strength, RSI thresholds, and an optional EMA trend direction filter. It triggers long entries when price crosses above the upper channel and short entries

Strategy v5 BreakoutTrend Repaints
Updated 8 days ago · None stated GitHub repository of Volume Breakout Strategy

DEPV2 C5 - Mod Secici

by YuceSezar89
1 stars

DEPV2 C5 Mod Secici is a signal mode selection indicator designed primarily for 15-minute timeframes. It evaluates market conditions across four primary dimensions: HLC3 moving average trend scores, momentum rate-of-change z-scores, volatility expansions via f

Indicator v6 TrendOscillators & momentum
Updated 13 days ago · None stated GitHub repository of DEPV2 C5 - Mod Secici

Turtle Trading System

by GreyssonEnterprises
1 stars

An indicator that plots a Donchian channel from the highest high and lowest low over a chosen length, with an optional midpoint line and shaded fill. It marks a bullish signal when the upper band rises and a bearish signal when the lower band falls, colours th

Indicator v5 BreakoutTrend
Updated 3 months ago · MIT GitHub repository of Turtle Trading System
1 stars

US Swing Entry Planner plans swing trading entries on daily price charts using dual entry models: pullback limit buys near the fast EMA and breakout buy-stop orders above pivot highs. It calculates ATR-based stop loss and profit targets along with position siz

Indicator v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of US Swing Entry Planner

Heikin Ashi Trend

by Basant1Saini
1 stars

Heikin Ashi Trend is a trend-following strategy that calculates Heikin Ashi candle values and moving averages directly on the main price chart. It generates long and short entry signals when a user-defined number of consecutive Heikin Ashi bars align with fast

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Heikin Ashi Trend

Turtle Trading Rules

by webcrack4
1 stars

Turtle Trading Rules is an indicator based on the classic Turtle Trading Channels system, customized to generate JSON payloads for the OKX Signal Bot. It calculates price breakout channels using configurable entry and exit lengths (defaulting to 20 and 10 peri

Indicator v5 TrendBreakout
Updated 9 months ago · None stated GitHub repository of Turtle Trading Rules
1 stars

This indicator simulates and compares standard daily dollar-cost averaging against HMA-filtered long and short DCA execution models. It tracks accumulated position sizes, average cost prices, and accumulated or unrealized profit within a user-specified date wi

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TeeLek Lab 03 DCA and Pause X

Bjorgum Reversal

by amico1234
1 stars

Bjorgum Reversal is an overlay indicator that combines Tillson T3 moving averages, Parabolic SAR, and the True Strength Index to identify trend direction and potential reversal points. It recolors candles to signal trends and potential crossovers, while plotti

Indicator v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Bjorgum Reversal

Linear Slope & Delta2

by JohnsonHsiao
1 stars

This indicator measures how a linear regression of the close changes over a chosen shift, then measures how that slope itself changes. It plots the slope and a second difference in a separate pane with a zero baseline. The regression length sets how many bars

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Linear Slope & Delta2
947 stars

The Apirine Adaptive Moving Average calculates a dynamic moving average that adjusts its sensitivity according to price volatility and position within a recent range. It uses highest high and lowest low values over a selected lookback period to scale a smoothi

Indicator v4 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Apirine Adaptive Moving Average

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