Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 51)

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

ZigZag Supertrend

by WISEPLAT
2 stars

This overlay indicator draws a ZigZag from recent pivot highs and lows and feeds those extremes into a Supertrend-style calculation that uses ATR. Pivot length, stored history, and ATR period and multiplier change how swings and the trend band form. Optional w

Indicator v4 TrendVolatility & bands Repaints
Updated 3 years ago · None stated GitHub repository of ZigZag Supertrend
1 stars

JAT+BSM Pro v13 Extended is a multi-timeframe trading strategy overlay that combines kinematic regression models, Bayesian inference, and consolidation zone analysis. It processes multi-layer volatility bands, volume profile buckets, and pattern structure targ

Strategy v5 TrendVolatility & bands
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended

EMA Ribbon

by pineforge-4pass
1 stars

This strategy calculates three exponential moving averages with adjustable lengths for the fast, mid, and slow periods. It enters a long position when the moving averages form a bullish stack and a short position during a bearish stack, utilizing a transition

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of EMA Ribbon

DEPV2 DEBUG DAY

by YuceSezar89
1 stars

This debug version of the DEPV2 indicator tests multi-method signal logic. It evaluates four categories—TREND, MOMENTUM, VOLATILITY and VOLUME—across 20 cryptocurrency symbols including BTCUSDT, ETHUSDT, SOLUSDT and others. Users select signal modes for simult

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG DAY

FUTURES-IWBADT Reference

by GreyssonEnterprises
1 stars

A reference copy of a Pine v4 indicator that reads trend from 9 and 18 period EMAs on three higher timeframes (1 hour, 4 hour and daily by default), with an option to include the chart timeframe. Colours on the price chart show when all or only some timeframes

Indicator v4 TrendMoving averages Repaints
Updated 3 months ago · MIT GitHub repository of FUTURES-IWBADT Reference
1 stars

This strategy draws on the price chart and uses a 21-period EMA of the current symbol close as a fast line and a 55-period SMA of the close price from a higher timeframe (default 60 minutes) as a slow line. Long conditions trigger on EMA crossover above the sl

Strategy v5 Moving averagesTrend
Updated 4 months ago · MIT GitHub repository of Corpus MTF Security Close
1 stars

This indicator overlays several optional trend tools on the price chart. It draws a ZigZag from a deviation setting and can plot a multi-timeframe Tillson T3, a Jurik moving average, an ALMA, and a Range Filter. Users switch each tool on or off and change leng

Indicator v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Quad Trend Master & KalmanOSC

Vortex Indicator

by amico1234
1 stars

The Vortex Indicator calculates positive (VI+) and negative (VI-) directional movement lines to help identify trend direction and momentum. It measures the sum of upward and downward price movements relative to the true range over a specified lookback period.

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

A Pine v4 overlay that plots three simple moving averages of 50, 100 and 200 periods on a chosen source. The 50 and 100 lines turn green when rising and red when falling, while the 200 line changes colour depending on whether the close is above it. An optional

Indicator v4 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of QS Institutional Moving Averages
1 stars

A Pine v4 strategy that plots a 21-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 LINKBTC EMA Cross Strategy

This indicator scans a pasted list of symbols and shows matching long and short setups in a table in a separate pane. It uses a Supertrend crossover, then applies an ATR or fixed-point volatility range so quiet, sideways conditions can be skipped. Optional fil

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Trend Following Setup - Sideways Market Skipper Scanner
257 stars

This is a futures trading strategy for instruments like ES. It plots an Ichimoku Cloud using Tenkan, Kijun, Senkou A, Senkou B and Chikou lines along with pivot highs and lows to mark resistance and support levels directly on the price chart. Inputs let users

Strategy v5 TrendSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of Futures No Repain ES
114 stars

This indicator applies a logistic regression binary classification model trained via gradient descent directly on chart data. On every bar, the model updates weights over a configurable number of training iterations and passes them through a sigmoid function t

Indicator v4 AI / machine learningTrend Repaints
Updated 1 year ago · None stated GitHub repository of Machine Learning: Logistic Regression

AC- MY SCRIPT1

by hasnocool
106 stars

This strategy plots an Optimized Trend Tracker and a selectable moving-average support line on the price chart. It builds the average as SMA, EMA, WMA, TMA, VAR, WWMA, ZLEMA, or TSF, then offsets long and short stops by a percent of that average. Optional mark

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AC- MY SCRIPT1
55 stars

Calculates dynamic trendlines and horizontal support and resistance levels using pivot highs and pivot lows with a fixed length of 10 bars. When a new pivot high or low is confirmed, the script updates extended trendlines connecting the two most recent pivots,

Indicator v5 TrendSupport & resistance
Updated 6 months ago · Apache-2.0 GitHub repository of AAPL Dynamic Line Analysis

This indicator implements swing chart construction rules based on Perry Kaufman's Trading Systems and Methods. It runs up to three swing models simultaneously across two, three, and four-bar reversal thresholds, plotting swing lines directly on the price chart

Indicator v5 Support & resistanceTrend
Updated 2 weeks ago · MIT GitHub repository of Zen TSaM Swing Chart Multi-Mode 2/3/4
16 stars

This strategy enters long or short when a fast exponential moving average crosses a slow one, then sizes each unit from a percentage of equity and an ATR-based initial stop. It can add positions as price moves by a multiple of ATR, up to a set unit limit, and

Strategy v6 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of Seykota Alt 2: EMA Crossover

Elliott Wave Radar identifies and validates Elliott Wave impulse (1-5) and corrective (A-B-C) patterns using a dual-degree ZigZag pivot engine with an ATR noise filter. It checks structural rules and Fibonacci guidelines, scoring counts and projecting price ta

Indicator v6 TrendSupport & resistance
Updated 3 days ago · MIT GitHub repository of Elliott Wave Radar [WavesUnchained]
9 stars

VSA Pro: Trend and Rejection is an overlay strategy combining SuperTrend trend filtering with Volume Spread Analysis principles. It calculates SuperTrend direction to enter long positions when a new bullish trend starts and exits all positions when the trend t

Strategy v5 TrendVolume
Updated 4 months ago · MIT GitHub repository of VSA Pro: Trend and Rejection

Multi Timeframe MA

by suyons
7 stars

Calculates and overlays up to ten moving averages from custom timeframes directly onto the main price chart. Each moving average line allows individual configuration of its timeframe, period length, and average type, supporting Simple Moving Average (SMA), Exp

Indicator v5 Moving averagesTrend Repaints
Updated 4 months ago · None stated GitHub repository of Multi Timeframe MA

WR-SR + SMC Strategy v4.0

by alboogycOdR
6 stars

The WR-SR + SMC Strategy v4.0 combines wick rejection for support and resistance level detection with Smart Money Concepts including CHoCH and BOS structure changes, fair value gap zones and order blocks. It signals trading entries and exits on the price chart

Strategy v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of WR-SR + SMC Strategy v4.0

Kenny's Strategy

by jerryinyang
5 stars

Kenny's Strategy combines multiple exponential moving averages to identify trend changes and generate entry signals. It calculates short, medium, and long EMAs from a user-selected source and checks for alignment within specific zones. A long-term EMA filter r

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Kenny's Strategy

This strategy tracks GBP/USD market structure by storing confirmed pivot highs and lows. It enters long when price crosses above the last pivot high while above a trend EMA, and short when price crosses below the last pivot low while below that EMA. Entries oc

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · MIT GitHub repository of GBP/USD Market Structure [trugurpala]

Jash_test

by jash-git
3 stars

Jash_test is a price-chart overlay that plots five exponential moving averages using Fibonacci lengths: 3 and 13 as the fast pair, 34 and 55 as the slow pair, and 144 as a longer filter. It colors them red, orange, blue, purple, and black. On the current bar a

Indicator v5 TrendMoving averages
Updated 4 weeks ago · None stated GitHub repository of Jash_test
3 stars

CSW Breakout Signals plots breakout buy and sell labels on the price chart when price breaks support or resistance after a trend change. Each signal can show a numbered confirmation score built from a moving-average cross, momentum, opening-range alignment, re

Indicator v5 BreakoutTrend
Updated 5 months ago · None stated GitHub repository of CSW Breakout Signals

Simple Pullback Strategy

by Web3Degenerate
2 stars

This strategy executes long trades during pullbacks within an established uptrend, plotting moving averages, entry prices, and stop levels on the price chart. It buys when the close is above the long-term simple moving average and below the short-term moving a

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Simple Pullback Strategy

Bollinger ZigZag ++

by WISEPLAT
2 stars

Bollinger ZigZag ++ combines Bollinger Band percent B calculations, pivot points, and a ZigZag filter to mark potential support and resistance levels directly on the price chart. It detects overbought and oversold thresholds relative to the bands and draws vis

Indicator v4 Volatility & bandsSupport & resistance Repaints
Updated 3 years ago · None stated GitHub repository of Bollinger ZigZag ++
1 stars

An extended version of the JAT+BSM strategy that adds a strategy preset, a risk aggression choice and a pattern type filter to the AlphaTrend style core, MACD, consolidation layers, volume profile and candlestick and macro pattern drawings. Forecasts use kinem

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended
1 stars

This mean-reversion strategy implements Larry Connors' 2-period RSI system. It enters long positions when price trades above a long-term simple moving average (default 200) and the 2-period RSI drops below 10. Optional short positions enter below the trend ave

Strategy v6 Mean reversionOscillators & momentum
Updated 4 days ago · MPL-2.0 GitHub repository of RSI-2 (Larry Connors) [JR]

ES point-value 9/21 SMA cross

by pineforge-4pass
1 stars

This strategy isolates ES futures point-value PnL scaling using a nine-period and twenty-one-period simple moving average cross. It enters one long contract when the fast average crosses above the slow average and closes that long when the fast average crosses

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of ES point-value 9/21 SMA cross

A strategy that uses ADX to decide between two sub-strategies. In ranging conditions it fades asymmetric Bollinger Band extremes with a 200 EMA trend filter. In trending conditions it trades Donchian channel breakouts, protected by optional volume, candle rang

Strategy v6 Mean reversionBreakout
Updated 8 days ago · GPL-3.0 GitHub repository of Hierarchical Trading System v6 Fakeout Protected

DEPV2 DEBUG S0

by YuceSezar89
1 stars

DEPV2 DEBUG S0 monitors 20 major cryptocurrencies on Binance including BTC, ETH, SOL, XRP, DOGE and others. It generates signals using four methods: TREND, MOMENTUM, VOLATILITY and VOLUME. Users choose from same-time confirmation, sequential confirmation or au

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S0
1 stars

This indicator plots mirrored price and parallel lines on the chart. It defines a base line using two input points and calculates the maximum deviation for a price channel by reflecting the close price around the base line. Users can apply the reflection to th

Indicator v6 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Mirrored Price & Parallel Lines

Terminal Velocity Stop

by vedkanani123
1 stars

An ATR trailing stop drawn on the price chart. The stop chases a target set at a multiple of ATR below price in an uptrend and above price in a downtrend, but its travel per bar is capped at a terminal velocity setting measured in ATR, 0.3 by default. This kee

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Terminal Velocity Stop

FUTURES-IWBADT Trading Bot

by GreyssonEnterprises
1 stars

A Pine v4 indicator that judges trend by comparing a 9 and an 18 period EMA on three higher timeframes (1 hour, 4 hour and daily by default) and optionally the chart timeframe. Background colours show when all or most timeframes agree on direction. Settings in

Indicator v4 TrendMoving averages Repaints
Updated 3 months ago · MIT GitHub repository of FUTURES-IWBADT Trading Bot
1 stars

Corpus Switch And Strings is a multi-asset strategy that calculates the price spread between two configurable symbols on a set timeframe. It evaluates the spread using a string switch selection to compute either a 9-period Exponential Moving Average, a 9-perio

Strategy v5 Moving averagesOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Corpus Switch And Strings

Supertrend

by shubhamtaywade82
1 stars

Plots the built-in Supertrend line on the price chart as a single blue line. It has two settings, the ATR length with a default of 10 and the ATR multiplier with a default of 3. The line trails price and flips side when price closes through it. There are no al

Indicator v6 TrendVolatility & bands Archived
Updated 5 months ago · None stated GitHub repository of Supertrend

Rainbow EMA & SMMA

by ymlee1104
1 stars

This script plots a rainbow ribbon overlay composed of eight Exponential Moving Averages ranging from 10 to 50 periods alongside two Smoothed Moving Averages on the main price chart. It evaluates complete moving average alignment across all calculated lengths

Indicator v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Rainbow EMA & SMMA

A Pine v4 overlay that plots simple moving averages of 50, 100 and 200 periods on a chosen source, with progressively thicker lines. Each line is green while it is rising and red while it is falling. An optional background colour is available, and the three le

Indicator v4 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of QS Institutional Moving Averages
1 stars

A Pine v4 strategy that plots a 27-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 LINKWETH EMA Cross Strategy
330 stars

This strategy combines triple exponential moving averages with a TTM Squeeze oscillator to capture trend-following momentum. It enters long or short positions when price aligns with all three EMAs (125, 680, and 2500 period) and the oscillator turns in the tre

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]
228 stars

This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template
114 stars

This indicator implements a binary logistic regression classification model retrained on each bar using gradient descent optimization. It processes normalized price features through a sigmoid activation function to classify market direction and generate direct

Indicator v4 AI / machine learningTrend Repaints
Updated 1 year ago · None stated GitHub repository of Machine Learning: Logistic Regression

Accumulate

by hasnocool
106 stars

Accumulate identifies potential market accumulation and breakdown phases by combining four Simple Moving Averages (21, 50, 90, and 200 periods) with a Price Volume Trend (PVT) MACD indicator. Green buy arrows plot on the main price chart when price is above a

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Accumulate

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