Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 33)

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 long-only strategy automates staged entries and exits based on Bitcoin all-time high drawdowns and percentage gains. It scales into positions across five configured percentage drop levels from the highest recorded price. Profit taking occurs in five parti

Strategy v6 Support & resistanceTrend
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle [Infinity]
1 stars

This strategy trades moving-average crossovers only when the higher timeframe agrees. It requests the higher-timeframe close and a trend moving average, then goes long when that trend is bullish and the fast average crosses above the slow average, and short wh

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of MTF - Multi-Time Frame Strategy
1 stars

This indicator detects swing highs and lows using pivot points on the chart. It calculates Fibonacci retracement levels for each swing and optionally enables a trading strategy. The strategy sets stop loss and take profit using ATR multipliers. Main settings a

Indicator v5 Support & resistanceTrend
Updated 8 months ago · None stated GitHub repository of AutoFibAlgo Automatic Fibonacci

The Basic Crossover

by propuchon
1 stars

A course example strategy that trades a simple moving average crossover. It goes long when a 14-period SMA crosses above a 28-period SMA and goes short when it crosses below, which reverses any open position. Both averages are plotted on the price chart. The l

Strategy v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of The Basic Crossover
1 stars

Combined Indicators v5 Fixed merges multiple technical tools into a single price chart overlay. It identifies Smart Money Concepts structure such as Break of Structure, Change of Character, Order Blocks, Fair Value Gaps, and equal highs or lows. Additionally,

Indicator v5 SMC / ICT / price actionOscillators & momentum
Updated 9 months ago · None stated GitHub repository of Combined Indicators v5 Fixed

NSE Infinity

by anil-sn
1 stars

A long-only strategy that enters on a close above the prior 20-bar high or on a cross back above a 50 EMA, in both cases only while price is above a 200 EMA. It holds one position sized at 90 percent of equity and exits when the close falls below a Chandelier-

Strategy v6 TrendBreakout
Updated 9 months ago · None stated GitHub repository of NSE Infinity

MTF Trend Dashboard

by surajmateti
1 stars

This indicator tracks and compares trend direction across the current chart timeframe and a customizable higher timeframe. It calculates fast and slow exponential moving averages on both timeframes, classifying conditions as bullish, bearish, or flat based on

Indicator v5 TrendMoving averages
Updated 11 months ago · None stated GitHub repository of MTF Trend Dashboard
1 stars

This indicator monitors and displays signals across up to five selectable symbols using an on-chart table. It evaluates price relative to the midpoints of highest highs and lowest lows over three lengths derived from a configurable base length. Bullish signals

Indicator v5 Screeners & dashboardsTrend
Updated 1 year ago · MIT GitHub repository of Kurutoga Screener Template

Lab-Doi-05

by theteelek
1 stars

An experimental strategy lab script that simulates long, short and a second long position inside a date window, with a daily EMA 12 and EMA 26 cross as the trend filter. It tracks average entry prices, open profit, drawdown, win and loss counts and exchange fe

Strategy v6 Trend
Updated 1 year ago · None stated GitHub repository of Lab-Doi-05

TOTAL MTPI STRAT M_K

by Mikelkulla
1 stars

TOTAL MTPI STRAT M_K is a trend-following crypto market direction strategy that overlays multiple technical indicators on the price chart. It combines custom weighted moving averages, dynamic EMA ribbons, RMTA, and Kijun Sen baselines to evaluate overall marke

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TOTAL MTPI STRAT M_K
1 stars

This strategy trades flips of the Parabolic SAR. It enters long when price closes above the SAR after being at or below it on the prior bar, and short on the opposite flip. Each trade has an ATR-based stop loss and take profit set by separate multipliers. Acce

Strategy v5 Trend
Updated 1 year ago · None stated GitHub repository of Parabolic SAR Strategy

Donchian Trend

by JoeTonDev
1 stars

A trend-following strategy that goes long when price closes above the prior 20-bar high while a fast EMA is above a slow EMA, and short on a close below the prior 20-bar low when the fast EMA is below. Positions close on a 10-bar opposite extreme, and an ATR-b

Strategy v5 BreakoutTrend
Updated 2 years ago · None stated GitHub repository of Donchian Trend
1 stars

This strategy plots the built-in Supertrend line in green or red on the price chart. When the Supertrend value steps up it enters a long position, and when it steps down it enters a short position, so it stays in the market and reverses on each change. Each or

Strategy v5 TrendVolatility & bands
Updated 2 years ago · MPL-2.0 GitHub repository of Hello World, Supertrend
1 stars

This strategy follows Supertrend, with a 10-period ATR and a multiplier of three by default. It goes long when price crosses above the Supertrend line and short when price crosses below, and also closes on the opposite cross. In addition, each trade has a perc

Strategy v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of Supertrend + Percentage Target and Stop

Moving Average Extension

by krosenfeld7
1 stars

This indicator calculates a multi-timeframe moving average using Simple, Exponential, Hull, Volume Weighted, or Weighted moving average types. It computes the logarithmic distance between the asset price and the selected moving average to determine extension.

Indicator v4 Moving averagesTrend Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Moving Average Extension
1 stars

The High Low MA Band Indicator calculates moving averages separately on high and low prices to create a dynamic price channel overlaid directly on the chart. Users can select between Exponential, Weighted, Volume-Weighted, or Hull Moving Average calculation ty

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of High Low MA Band Indicator

Ichimoku-combo

by DT021
1 stars

Ichimoku-combo plots a modified Ichimoku Kinko Hyo system directly on the main price chart. It calculates the conversion line, base line, lagging span, and leading spans 1 and 2 using Donchian midpoints. The script features an adjusted base line period of 21 r

Indicator v4 TrendSupport & resistance
Updated 6 years ago · GPL-3.0 GitHub repository of Ichimoku-combo

AI Trend

by dearvn
257 stars

AI Trend is an indicator that plots pivot points, trend lines, and support and resistance levels directly on the price chart. It marks high and low pivots based on user-defined length, draws trend lines that check for violations at specified points, and identi

Indicator v5 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of AI Trend

[TradersPost] Sick Sigma

by TradersPost
228 stars

Sick Sigma detects extreme statistical standard deviation moves (sigma events) to execute trades directly on the main price chart. The strategy supports both momentum and mean-reversion trading styles. Traders can configure calculation lookback periods, sigma

Strategy v6 Volatility & bandsMean reversion Repaints
Updated 3 months ago · None stated GitHub repository of [TradersPost] Sick Sigma
219 stars

This indicator identifies local swing highs and swing lows to construct a Zig Zag pattern on the main price chart. It evaluates pivot points based on a customizable number of surrounding left and right bars. Using persistent variables, the script tracks previo

Indicator v4 Support & resistanceTrend Repaints
Updated 5 years ago · None stated GitHub repository of Teaching: Finding Highs and Lows 6

This indicator implements an artificial neural network using a single-layer perceptron model trained from scratch directly in Pine Script. It processes price features combined with a custom directional movement index across a rolling sample window to generate

Indicator v5 AI / machine learningTrend
Updated 1 year ago · None stated GitHub repository of Machine Learning: Perceptron-Based Strategy 5 (v.2)
99 stars

The Augmented Dickey-Fuller indicator calculates statistical stationarity and tests for unit roots in price series over a rolling window. It performs ordinary least squares regression on differenced historical price data to compute a t-statistic and an estimat

Indicator v6 Mean reversionTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of ADF - Augmented Dickey-Fuller Test

EMA Ribbon MACD v1

by iamrichardD
57 stars

This strategy combines an exponential moving average ribbon with MACD momentum indicators to identify trend-following entry and reversal signals. It draws in a separate pane, tracking MACD signal crossovers, zero-line crosses, and EMA structural alignments. En

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD v1

Ichimoku Cloud

by dcaoyuan
55 stars

The Ichimoku Cloud indicator plots key components of the traditional Ichimoku Kinko Hyo system directly on the price chart. It calculates the Conversion Line over 9 periods and the Base Line over 26 periods using Donchian midpoints. It projects Leading Span A

Indicator v6 TrendSupport & resistance
Updated 6 months ago · Apache-2.0 GitHub repository of Ichimoku Cloud

ZigZag

by milocaetano
48 stars

This Pine Script indicator identifies market structure pivots and plots a ZigZag line on the price chart. It calculates high and low pivot points using built-in pivot functions based on a configurable pivot strength input. When a pivot high or low is confirmed

Indicator v5 Support & resistanceTrend
Updated 3 days ago · MIT GitHub repository of ZigZag
43 stars

This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility
29 stars

The Zen Consecutive Bar Streak indicator calculates and tracks consecutive directional candle streaks directly on the main price chart. It determines whether each bar is bullish, bearish, or neutral based on its close relative to its open. When two or more con

Indicator v6 Candlestick patternsTrend
Updated 2 weeks ago · MIT GitHub repository of Zen Consecutive Bar Streak
29 stars

This overlay indicator builds trend ranges from a Donchian midpoint. It takes the highest high and lowest low over a user length, averages them, and holds that basis until the midpoint changes. When the basis updates, it sets a range from the close standard de

Indicator v5 TrendVolatility & bands
Updated 11 months ago · Custom licence GitHub repository of Donchian Trend Ranges [AlgoAlpha]
24 stars

This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa

Indicator v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Bollinger Band Swing
20 stars

This indicator plots John Ehlers' simple decycler on the price chart. It applies a high-pass filter to the chosen source, subtracts that component from the source, and draws the remaining low-frequency line. The line is green when the decycler rises for two co

Indicator v5 Trend
Updated 1 year ago · None stated GitHub repository of John F. Ehlers - Simple Decycler
16 stars

A trend-following strategy based on Ed Seykota's Donchian breakout framework, modified to take a single full-risk entry instead of pyramiding multiple units. It enters long or short on 55-bar channel breakouts with ATR-based position sizing and an initial stop

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 15: Single Position

SPY 0DTE Scalper - 15min

by chris-c-thomas
14 stars

This intraday overlay establishes directional bias and high-conviction swing setups for SPY on the 15-minute timeframe. It computes a weighted confluence score combining an EMA ribbon, a 50 EMA anchor, session VWAP bands, RSI divergence, ADX, TTM Squeeze, cand

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 15min

Crossing EMAs D

by ruckard
13 stars

Crossing EMAs D is a moving average crossover strategy designed to automate trade execution through Zignaly webhook and email integration. It detects simple moving average crossovers (14-period and 28-period) and formats detailed payload alert messages for cry

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Crossing EMAs D

My Strategy

by hirawatt
11 stars

This strategy plots five exponential moving averages of typical price on the price chart and treats a fully ordered stack as a trend signal. It enters long when the averages rise in order or when the 14-period RSI crosses above 60.5, and short on the opposite

Strategy v4 TrendMoving averages
Updated 2 years ago · MIT GitHub repository of My Strategy

Portfolio Backtester

by f-cksociety
11 stars

The script is a Pine Script v5 indicator that emulates strategy backtesting directly on the price chart. It evaluates modular entry strategies, trade directions, entry stop-loss types such as ATR multiples or fixed percentages, and a wide variety of trade filt

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Portfolio Backtester

Auto Trendlines

by casoon
9 stars

Auto Trendlines calculates support and resistance lines by identifying confirmed pivot highs and lows over a specified lookback window. It validates trendline candidates using ATR-based touch tolerances, touch counts, line spans, and max violation thresholds.

Indicator v6 TrendSupport & resistance Repaints
Updated 3 days ago · MIT GitHub repository of Auto Trendlines

Impulse Trend Arrows

by MeridianAlgo
9 stars

Calculates an adaptive baseline using an EMA and constructs an ATR channel smoothed over a user-defined length. It combines channel breakout conditions with RSI and MACD momentum agreement to generate buy and sell signals. Signals are displayed on the main pri

Indicator v6 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Impulse Trend Arrows

Ichimoku Cloud - Eterna

by EternaHybridExchange
9 stars

This strategy calculates standard Ichimoku Cloud components, including the conversion line, base line, and displaced leading spans. It opens long positions when price resides above a bullish cloud and the conversion line crosses above the base line. Short entr

Strategy v5 Trend
Updated 7 months ago · MIT GitHub repository of Ichimoku Cloud - Eterna

This indicator tracks swing highs and swing lows to generate trend-following trailing stop levels on the price chart. When the closing price breaks above the previous swing high, the system establishes a bullish state using the recent swing low as a trailing s

Indicator v4 TrendBreakout
Updated 4 years ago · None stated GitHub repository of Accurate Swing Trading System

Order Block Strategy

by muammeryldrm42
7 stars

This strategy identifies bullish and bearish order blocks using an average true range impulse filter and plots corresponding boxes on the price chart. It enters positions on price retests of the order block zones, optionally filtered by an exponential moving a

Strategy v5 SMC / ICT / price actionTrend
Updated 3 months ago · MIT GitHub repository of Order Block Strategy

EMA 9/26/52/200

by SynergOps
7 stars

EMA 9/26/52/200 calculates four exponential moving averages based on bar closing prices using fixed periods of 9, 26, 52, and 200. It plots all four lines directly on the main price chart in distinct yellow, purple, blue, and red colors to help identify short-

Indicator v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of EMA 9/26/52/200

This strategy generates trading signals based on crossovers between daily session VWAP and a 4-hour 90-period Exponential Moving Average (EMA). When VWAP crosses above the 4-hour EMA, the strategy closes open short positions and enters a long trade with full e

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 4H Bullish Buy 4H Bearish Sell Session

Moving Average

by SiegerTerpstra
5 stars

This indicator calculates a simple moving average as the arithmetic mean of a chosen price source over a set length. A second averaging pass can smooth the result, and an offset shifts the calculation window. An indicator timeframe input selects the data timef

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Moving Average

Linear Regression Channel

by jerryinyang
5 stars

The Linear Regression Channel indicator calculates the middle line via linear regression on a user-selected source over a configurable length. It plots upper and lower channel bands using a deviation multiplier and draws these lines directly on the price chart

Indicator v4 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of Linear Regression Channel

This strategy executes long positions by combining a 200-period EMA trend filter, Stochastic RSI oversold crosses, and Williams Alligator retracements, supplemented by RSI divergence detection. It triggers long entries when the price trades above the 200 EMA w

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Alligator + Stochastic Long Strategy

AG Momentum Breakout

by eltonaguiar
4 stars

AG Momentum Breakout is a strategy that identifies continuation signals after pullbacks in trending markets. It filters for uptrends using EMAs and detects recent pullbacks via RSI conditions before entering on RSI crossovers above 50 with ADX confirmation. Th

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Momentum Breakout

MTF MA Bands

by InNoobWeTrust
4 stars

The indicator calculates and plots up to five multi-timeframe moving average bands directly on the price chart. Each band is constructed from moving averages computed across user-defined timeframes, such as current chart, 5-minute, 30-minute, 4-hour, and daily

Indicator v6 TrendMoving averages Repaints
Updated 2 days ago · None stated GitHub repository of MTF MA Bands

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