Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 27)

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

4 stars

This strategy identifies Bitcoin price trends using fast and slow EMA crossovers filtered by RSI and a 200 EMA. It plots the EMAs and entry signals on the price chart. Bullish crossovers open long positions with ATR-based stop loss and take profit. Bearish cro

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Bitcoin BTC Strategy [trugurpala]
4 stars

This long-only strategy plots an asymmetric ATR channel around a rolling moving average on the price chart. It enters long when a confirmed close breaks above the upper band and exits when a confirmed close breaks below the lower band. An optional setting exit

Strategy v6 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of RMA ATR Bands (Long Only)

SMC Order Block + FVG

by LePotoRico2105
4 stars

SMC Order Block + FVG is an intraday strategy combining market structure breaks, order blocks, and fair value gaps. It identifies breaks of structure using pivot points, isolates order blocks following strong ATR-based impulses, and tracks fair value gaps. Lon

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 7 months ago · MIT GitHub repository of SMC Order Block + FVG

Improvisando [Alorse]

by Hugs-4-Bugs
4 stars

Improvisando [Alorse] is a price-chart strategy that plots three exponential moving averages and a TTM Squeeze-style oscillator. It opens a long when price is above all three averages and the oscillator is rising while still below zero. Shorts use the opposite

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Improvisando [Alorse]

Snag - Swing Trade Long Term V3 is an overlay indicator designed to track long-term trends using three Weighted Moving Averages (13, 48, and 200 periods). It plots the WMAs directly on the price chart and evaluates crossovers between price and moving averages,

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snag - Swing Trade Long Term V3

Regime HA on EMA strategy

by aofwittawat
4 stars

This overlay strategy classifies trend from a higher-timeframe Heikin Ashi close and an exponential moving average of that close. When the confirmed price is above the average it enters long and closes any short; when price is below it enters short and closes

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Regime HA on EMA strategy

ZigZag OrderBlock Retracement

by ricksimpsontrading
3 stars

This indicator plots multi-length ZigZag swing structures, detected order blocks, and retracement levels directly on the price chart. It computes up to four separate ZigZag lengths to track price swings across multiple horizons with color coding for bullish, b

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 10 days ago · None stated GitHub repository of ZigZag OrderBlock Retracement

Trend Strength Index

by AkashSasikumar47
3 stars

This indicator measures market trend strength by comparing net price change to cumulative bar-to-bar volatility over a specified lookback period. It plots two lines in a separate pane: a fast smoothed Trend Strength Index line based on the user-defined smoothi

Indicator v6 TrendOscillators & momentum
Updated 2 weeks ago · MIT GitHub repository of Trend Strength Index

Risk-Managed Scaffold

by jpantsjoha
3 stars

This strategy enters long when a 20-period EMA crosses above a 50-period EMA and price is above the previous closed daily close. It sizes the position from a percentage of equity and the ATR stop distance, then exits with an ATR stop and a reward-to-risk limit

Strategy v6 TrendMoving averages
Updated 4 weeks ago · Custom licence GitHub repository of Risk-Managed Scaffold

7 in 1

by g-moe
3 stars

The 7 in 1 indicator plots multiple customizable moving averages directly on the price chart to reduce indicator clutter. Traders can toggle each moving average on or off, selecting between Simple Moving Average (SMA) and Exponential Moving Average (EMA) types

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of 7 in 1

Stella's SuperTrend Basic

by stella-entry
3 stars

Stella's SuperTrend Basic is a trend-following strategy that calculates the SuperTrend indicator directly on the price chart. It enters long positions when the price crosses above the SuperTrend line and switches to short positions when the price crosses below

Strategy v6 Trend
Updated 8 months ago · MIT GitHub repository of Stella's SuperTrend Basic

MOTO ka NagAstra

by HelloMoto069
3 stars

NagAstra draws a Gaussian-kernel smoothed estimate of the selected source on the price chart. With repainting smoothing enabled, it rebuilds line segments on the latest bar and marks slope reversals with triangle labels. Disabling that option plots only the en

Indicator v5 Trend Repaints
Updated 1 year ago · None stated GitHub repository of MOTO ka NagAstra

This indicator calculates and plots a custom Exponential Moving Average (EMA) directly on the main price chart. It uses an initial Simple Moving Average over a user-defined period to seed the exponential calculation, applying standard alpha weighting to smooth

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Exponential Moving Average (Trend Following)

Poison Rat v2.1 - DataCrypto Analytics

by datacrypto-analytics
3 stars

This indicator tracks multi-timeframe moving average crosses directly on the price chart. It evaluates three Running Moving Averages (RMA lengths 4, 9, and 16) fetched from a user-selected secondary timeframe alongside 100-period and 200-period Simple Moving A

Indicator v4 Moving averagesTrend Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Poison Rat v2.1 - DataCrypto Analytics
3 stars

Greeffer's Long Study calculates Donchian Channels alongside a volume moving average filter to generate trade signals. When price touches the lower or upper channel boundaries combined with volume exceeding a custom moving average multiplier, the indicator tri

Indicator v4 TrendVolatility & bands
Updated 4 years ago · CC0-1.0 GitHub repository of Greeffer's Long Study

QQQ MA Accumulation v2

by yalili8521
2 stars

This intraday strategy calculates fast, mid, and slow Simple Moving Averages to confirm alignment alongside steady bar accumulation on short timeframes. It filters entries by rejecting large candle spikes and restricting execution to a defined morning session

Strategy v6 TrendMoving averages
Updated 9 days ago · None stated GitHub repository of QQQ MA Accumulation v2

Bollinger Bands

by piecioshka
2 stars

This indicator plots standard Bollinger Bands directly on the price chart using a simple moving average and standard deviation bounds. It displays filled background channels between the center moving average and the outer bands. Optional mean-reversion signal

Indicator v6 Volatility & bandsTrend
Updated 12 days ago · MIT GitHub repository of Bollinger Bands
2 stars

Modern Ichimoku Cloud [GBB] is an advanced trend and momentum indicator that enhances classic Ichimoku Kinko Hyo with multi-layered structural analysis. It plots traditional Tenkan-sen, Kijun-sen, Senkou Spans, and Chikou Span on the price chart while offering

Indicator v6 TrendSupport & resistance
Updated 2 weeks ago · MIT GitHub repository of Modern Ichimoku Cloud [GBB]

Market Structure

by TamTH-Dev
2 stars

Market Structure identifies and visualizes key market structure developments directly on the price chart. It calculates swing highs and swing lows using pivot detection with a five-bar lookback alongside an Average True Range filter to track structure. The ind

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Market Structure

Market Regime Dashboard

by vantradelabs
2 stars

The Market Regime Dashboard is a multi-timeframe dashboard indicator that evaluates market conditions across three user-defined timeframes. It measures four core dimensions: trend strength using ADX and DI direction, momentum using RSI z-scores, volatility via

Indicator v6 Screeners & dashboardsTrend
Updated 2 months ago · Custom licence GitHub repository of Market Regime Dashboard
2 stars

Calculates entry signals, stop loss levels, and five take-profit targets based on a 7-factor dual scoring engine. The system evaluates short-term market bias using EMA 9 and 21 crossovers, VWAP, RSI, MACD, ADX, relative volume, and multi-timeframe 5-minute RSI

Indicator v6 TrendOscillators & momentum Repaints
Updated 2 months ago · Custom licence GitHub repository of Sniper Entry/Exit with SL&TP

BOT A-SLP DEMATRON 2H

by danielvm-git
2 stars

This strategy calculates up to three Double Exponential Moving Averages (DEMA) to generate buy and sell signals based on crossover and crossunder conditions. It plots the moving average lines directly on the price chart. The indicator includes input controls f

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of BOT A-SLP DEMATRON 2H

Q-Trend

by middlechild0
2 stars

Q-Trend is a trend-following indicator that calculates a dynamic trend line using price channels and an ATR volatility offset. It plots a colored trend line directly on the price chart, switching between bullish and bearish modes when price breaches the upper

Indicator v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Q-Trend

This strategy plots a fast and a slow simple moving average on the price chart and enters long when the fast average crosses above the slow average, or short on a cross below. Longs also require ADX above a threshold, RSI below 65, ATR above a minimum, and a b

Strategy v5 TrendOscillators & momentum
Updated 8 months ago · MIT GitHub repository of Quantum Entanglement (Filtered MA Crossover)

Reverse RSI Signals [AlgoAlpha]

by mushroom-men-Trading
2 stars

This indicator projects reverse RSI price levels directly onto the main price chart to generate dynamic upper and lower bands alongside a Supertrend envelope midline. It detects bullish and bearish divergences by tracking RSI pivots with a configurable left lo

Indicator v6 Oscillators & momentumTrend
Updated 9 months ago · None stated GitHub repository of Reverse RSI Signals [AlgoAlpha]

QQE + AK Trend Combined

by realanthonyc
2 stars

This indicator combines a Qualitative Quantitative Estimation oscillator with an AK Trend line in a separate pane. It computes a smoothed Relative Strength Index and builds QQE bands using Wilder's smoothed average true range of the RSI. Additionally, it integ

Indicator v6 Oscillators & momentumTrend
Updated 11 months ago · MPL-2.0 GitHub repository of QQE + AK Trend Combined

Box Scalper

by wynnforthework
2 stars

This strategy draws on the price chart and combines a momentum zigzag, a custom QQE built from RSI, ADX directional strength, an SSL filter, and a coefficient-of-variation weighted average. Box period, deviation, and threshold inputs set the box filter, while

Strategy v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Box Scalper
2 stars

This indicator displays an on-chart comparison table tracking eleven major industry sector ETFs against a benchmark index, typically SPY. It calculates percentage price changes over a selectable timeframe, evaluates relative strength versus the benchmark, prov

Indicator v6 Screeners & dashboardsTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Industry Indices Comparison

Dual MA Crossover with Time Filter calculates a short simple moving average and a long simple moving average, plotting both on the main price chart. It identifies bullish crossovers and bearish crossunders to display Buy and Sell labels on the chart. A user-de

Indicator v5 TrendMoving averages Repaints

JBravo Swing

by scallywag41
2 stars

JBravo Swing plots a 9-period simple moving average, a 20-period exponential moving average, and a 200-period simple moving average directly on the price chart. It evaluates price position relative to these moving averages to generate Buy, Sell, Strong Buy, an

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of JBravo Swing
2 stars

This strategy enters long positions when the fast SMA of 10 periods crosses above the slow SMA of 30 periods. It calculates the trailing stop price as the position average price multiplied by one minus the trailing stop percentage divided by 100. The strategy

Strategy v5 TrendMoving averages
Updated 2 years ago · Apache-2.0 GitHub repository of Trailing Stop Strategy
2 stars

Jens Rabe Academy - Indicator 1 combines multiple trend and market condition tools directly on the main price chart. It calculates exponential moving averages (10, 21) and simple moving averages (30, 40, 50, 150, 200), identifies distribution days (D-Days) bas

Indicator v5 Moving averagesTrend Repaints
Updated 2 years ago · MIT GitHub repository of Jens Rabe Academy - Indicator 1
2 stars

This indicator plots four classic moving averages directly onto the price chart to help track short-term momentum and long-term trend direction. It calculates 8-period and 21-period exponential moving averages alongside 50-period and 200-period simple moving a

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of EMA 8/21, SMA 50/200

Multi ZigZag

by WISEPLAT
2 stars

This indicator calculates and plots up to four independent ZigZag lines on the price chart simultaneously using customizable length periods. It identifies high and low pivot points across multiple time horizons to display market structure and trend swings. Use

Indicator v5 Support & resistanceTrend Repaints
Updated 3 years ago · None stated GitHub repository of Multi ZigZag

This strategy plots SuperTrend lines on the price chart using ATR period and multiplier settings to identify trend direction and generate buy and sell signals. It integrates with Algomojo automation to automatically execute trades via API calls to supported br

Strategy v5 TrendVolatility & bands
Updated 4 years ago · MIT GitHub repository of SuperTrend Algomojo Trading Strategy with Target/Stoploss

Ichimoku Cloud

by mydcc
1 stars

This indicator plots the standard Ichimoku Kinko Hyo components directly on the price chart. It calculates the Conversion Line, Base Line, Leading Span A, Leading Span B, and Lagging Span using Donchian midpoint logic over configurable periods. The script shad

Indicator v6 TrendMoving averages
Updated 2 days ago · Custom licence GitHub repository of Ichimoku Cloud

An indicator that finds swing structure with pivots, draws a Fibonacci cloud and levels, and runs an adaptive trailing line that changes with a trend, range or volatile regime from ADX and ATR. Signals come from a trailing flip or from a cross of the 0.5 level

Indicator v6 TrendSupport & resistance

Leveraged Perp Arm

by nvolpe2007-cell
1 stars

A simulated leveraged perpetual futures strategy with three modes in one script. Direction comes from a 50-bar SMA or a 21 and 55 EMA cross, and exits use either a fixed take profit and hard stop or an ATR chandelier trail. Leverage is capped, with maintenance

Strategy v6 TrendVolatility & bands
Updated 2 days ago · None stated GitHub repository of Leveraged Perp Arm

Ghost Alpha Strategy

by mphinance
1 stars

A strategy version of the Ghost Alpha overlay, using the same Hull band, TRAMA, Keltner bands, moving averages, swing structure, Williams %R exhaustion and squeeze components with a minimum grade filter. The strategy settings use percent-of-equity sizing at th

Strategy v6 TrendVolatility & bands
Updated 3 days ago · Custom licence GitHub repository of Ghost Alpha Strategy
1 stars

An overlay that computes three simple moving averages, by default lengths 30, 50 and 100, but draws only the highest and the lowest of them on each bar. The two lines form a band that can be filled with a color, so the band stays clean even when the averages c

Indicator v5 Moving averagesTrend
Updated 5 days ago · None stated GitHub repository of Moving Average High-Low Range

EMA-Volume

by engtuncay
1 stars

The EMA-Volume indicator plots two Exponential Moving Averages (EMA 50 and EMA 200 by default) directly on the main price chart to track trend directions and crossover signals. It concurrently evaluates trading volume using 30-period and 120-period moving aver

Indicator v6 Moving averagesVolume
Updated 7 days ago · None stated GitHub repository of EMA-Volume

Hash Momentum Strategy

by kanylbullen
1 stars

Calculates normalized momentum against a threshold and combines it with an exponential moving average trend filter. It triggers trades in the direction of the EMA trend when momentum surges, subject to optional session, weekend, and cooldown filters. Exits are

Strategy v6 Oscillators & momentumTrend
Updated 8 days ago · None stated GitHub repository of Hash Momentum Strategy

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