Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 22)

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-only strategy generated from the TrendLab research project, drawn on the price chart. It calculates the Parabolic SAR with acceleration start 0.05, step 0.01 and maximum 0.33. It buys when the close crosses above the SAR and closes the position when the

Strategy v6 Trend
Updated 9 months ago · MIT GitHub repository of Parabolic SAR 0.05/0.01/0.33

TrendHorizon Suite

by Corbanistan
1 stars

This indicator combines three trend tools on the price chart. Smart signals colour candles and place labels by trend direction, with a time horizon setting from fast to slow and an option to show only strong signals. A fair value trail draws an ATR-based cloud

Indicator v6 TrendVolatility & bands
Updated 9 months ago · MPL-2.0 GitHub repository of TrendHorizon Suite
1 stars

Calculates trend channels based on a Simple Moving Average (SMA) and Average True Range (ATR) envelope. When price crosses outside the volatility envelope, the indicator identifies trend changes and draws dynamic mid, top, and bottom channel lines directly on

Indicator v5 TrendVolatility & bands
Updated 9 months ago · None stated GitHub repository of Future Trend Channel [ChartPrime]

SFA Impulse Origin v1

by genesisgrubio39
1 stars

This library from the SFA framework detects structural flow points using break of structure (BOS) and change of character (CHOCH) events. It calculates impulse origins by comparing close prices against ATR-based high and low extremes, filtered by volume percen

Library v6 SMC / ICT / price actionTrend
Updated 10 months ago · None stated GitHub repository of SFA Impulse Origin v1
1 stars

A chart-overlay indicator that plots a fast and a slow EMA, pivot-based support and resistance, and buy or sell signals. A signal needs at least four of five conditions: an EMA cross, RSI inside a middle band, price on the correct side of the fast EMA, a volum

Indicator v6 TrendOscillators & momentum
Updated 10 months ago · None stated GitHub repository of Professional Crypto Signals

Echo Forecast [LuxAlgo]

by christonomous
1 stars

This indicator projects future price trajectory directly on the price chart by searching historical price movements for matching patterns. It compares a recent reference window against historical evaluation segments using correlation to identify the most simil

Indicator v5 AI / machine learningTrend
Updated 11 months ago · None stated GitHub repository of Echo Forecast [LuxAlgo]
1 stars

The Donchian Breakout Strategy is a Turtle-style breakout system that plots Donchian channels on the price chart. It generates long entries when the close price crosses above the upper channel and short entries when crossing below the lower channel. Exits are

Strategy v5 BreakoutTrend
Updated 11 months ago · None stated GitHub repository of Donchian Breakout Strategy
1 stars

This indicator identifies high and low pivot points on the price chart using user-defined left and right bars around each bar. It connects pivot points with wave lines, plots PH and PL marks, and labels the latest P1 to P8 patterns. A table shows pivot details

Indicator v5 Support & resistanceTrend
Updated 11 months ago · MIT GitHub repository of Pivot Waves + 8-Pattern + CHoCH

NakInvest Cross EMA

by feliperazeek
1 stars

This strategy trades three-candle reversal patterns, called 123, PFR and engulfing, together with a 9, 40 and 80 EMA trend stack. Entries can occur when price crosses the fast EMA without crossing the slower ones, or when it crosses all of them. Optional volum

Strategy v5 Candlestick patternsMoving averages
Updated 1 year ago · None stated GitHub repository of NakInvest Cross EMA

Smoothed Heiken Ashi

by turnupdigital
1 stars

An indicator that draws smoothed Heiken Ashi candles on the price chart. Prices are smoothed with a selectable moving average type and length before the Heiken Ashi calculation and again afterwards, using an imported library of average types. Candles are shade

Indicator v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Smoothed Heiken Ashi

Momentum Trend Strategy

by yagyesh-bobde
1 stars

The Momentum Trend Strategy combines the Average Directional Index (ADX), SuperTrend, and Heikin Ashi candle colors to identify and trade trend momentum on the price chart. It enters long or short positions when ADX exceeds an entry threshold and SuperTrend al

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Momentum Trend Strategy
1 stars

A strategy that trades with two EMAs. A long entry needs price above the short EMA, which is above the long EMA, plus either RSI below a level or price within a tolerance of a recent pivot low. Shorts mirror this in a downtrend near pivot highs. Exits use ATR-

Strategy v6 TrendSupport & resistance
Updated 1 year ago · None stated GitHub repository of Optimized Trading Strategy

This strategy trades S50 TFEX USDTHB contracts on the price chart. It detects swing highs and swing lows with pivot points to generate long entries on swing highs and short entries on swing lows. The ATR indicator calculates dynamic stop-loss distances while t

Strategy v6 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of S50 TFEX Strategy With ATR and Stoploss

ETHBTC MTPI

by Mikelkulla
1 stars

ETHBTC MTPI is a multi-indicator trend-following strategy designed for crypto pairs to determine relative market strength. It combines up to five toggleable components: Liquidity-Weighted Supertrend, dual exponential moving averages, DEMA Supertrend, DEMA AFR,

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

The IBKR Safe Forex Strategy is a Pine Script v6 strategy that trades forex pairs using crossovers of 10-period and 50-period EMAs, filtered by a 200-period EMA and restricted to London or New York session overlap. It enters long positions on fast EMA above sl

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of IBKR Safe Forex Strategy
1 stars

This strategy computes a Donchian channel from the highest high and lowest low over a set period, plus a middle line. It goes long when the close breaks above the previous channel high and short when it breaks below the previous channel low. Each trade has an

Strategy v5 BreakoutTrend
Updated 1 year ago · None stated GitHub repository of Donchian Channel Breakout

BTC Trend

by mkdir700
1 stars

A separate-pane indicator that plots the Bitcoin price from the BTCUSDT symbol, scaled by an adjustable factor so it fits beside other panes, whatever chart symbol is open. The line is coloured green when the latest change is up or zero and red when it is down

Indicator v5 Trend
Updated 1 year ago · None stated GitHub repository of BTC Trend
1 stars

HMA-Kahlman Trend & Trendlines plots a smoothed directional trend ribbon directly on the price chart by combining Hull Moving Average calculations with an optional Kalman filter. It evaluates two moving lines alongside their average, changing color to reflect

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of HMA-Kahlman Trend & Trendlines

Fractal Enculfing Caldles

by fiji-solutions
1 stars

This indicator identifies bullish and bearish engulfing candlestick patterns directly on the price chart. To refine signal quality, it provides three optional filters: an ATR filter to cap maximum candle size relative to volatility, a swing high or low filter

Indicator v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Fractal Enculfing Caldles

Jinni v1

by Hurairahengg
1 stars

Jinni v1 is an overlay indicator that highlights the Sydney trading session and plots buy or sell signals based on dual exponential moving average trends. It draws a dynamic box around the Sydney session price range and applies time filters to exclude Fridays

Indicator v5 Sessions & timeMoving averages
Updated 2 years ago · None stated GitHub repository of Jinni v1

theIndicator v1.9

by darkshloser
1 stars

Overlays several SuperTrend-style trailing stop lines on the price chart, each built from an ATR period, ATR multiplier and source, with a choice of using wicks or closes. Lines are green while the direction is up and red while it is down, with a flip when pri

Indicator v5 Trend
Updated 2 years ago · Apache-2.0 GitHub repository of theIndicator v1.9

TD_Indicator

by subhrapratim07
1 stars

This indicator implements Tom DeMark Sequential logic directly on the price chart. It calculates TD buy and sell setups by comparing closes against four bars prior, tracks setup counts up to nine, and evaluates bar lows and highs to identify perfected setup co

Indicator v5 Mean reversionTrend
Updated 2 years ago · None stated GitHub repository of TD_Indicator
1 stars

A two-sided strategy that looks for a fan of fast EMA, medium EMA and slow SMA in order, a pin bar candle and a bar piercing one of the averages. It then places a stop order beyond the previous bar high or low. Exits combine a hard stop in pips with a trailing

Strategy v5 TrendCandlestick patterns Repaints
Updated 2 years ago · None stated GitHub repository of Grail Trailing Stop Strategy

TrendChecker

by RobACurtis
1 stars

A Pine library that exports three functions, bullish, bearish and getTrend, which judge market direction on the current symbol and timeframe. Each call takes three switches to include a Stochastic RSI cross, a MACD line versus signal check and a comparison of

Library v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of TrendChecker
1 stars

This strategy trades mean-reversion bounces using Bollinger Bands and constructs JSON webhook payloads for automated execution. It opens a long position when the price crosses back above the lower band within a specified date filter and closes the position whe

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · MPL-2.0 GitHub repository of Bolinger Bands Strategy

MACD VWAP Supertrend

by kritarth2121
1 stars

This strategy combines a MACD crossover, a positive histogram, VWAP versus the open and a Supertrend direction change within the last few bars to open long trades. It closes the position when MACD crosses back under its signal line or Supertrend turns bearish.

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of MACD VWAP Supertrend
1 stars

A strategy that enters long when the MACD histogram crosses above zero, price is above both EMAs and the Supertrend has just turned up. It enters short on the mirror conditions. Positions are reversed by the opposite signal, and the code has no separate stop l

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of MACD & EMA & Supertrend Strategy

Stx Ma-Trend Finder

by arrabyte
1 stars

Plots one moving average on the price chart and colours it by slope strength. The average type can be SMA, EMA, HMA, RMA, WMA, SWMA, VWMA or TEMA, with adjustable length and source. The slope of each bar is compared with the largest slope seen so far; when it

Indicator v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Stx Ma-Trend Finder

Bull Market Support Band

by krosenfeld7
1 stars

The Bull Market Support Band indicator overlays a higher-timeframe exponential moving average and simple moving average onto the price chart to visualize dynamic support or resistance zones. It calculates both moving averages using a user-defined timeframe res

Indicator v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of Bull Market Support Band

Heikin Ashi

by jubayernil
1 stars

This indicator calculates and plots Heikin Ashi candlesticks in a separate pane below the main price chart. It retrieves the open, high, low, and close values of the Heikin Ashi synthetic ticker for the chart's current timeframe. Bullish candles, where the Hei

Indicator v4 Candlestick patternsTrend
Updated 3 years ago · None stated GitHub repository of Heikin Ashi

Aroon RSI Adjusted Net

by JohnsonHsiao
1 stars

The Aroon RSI Adjusted Net indicator combines the standard Aroon oscillator with RSI calculations over a user-defined rolling period. It calculates Aroon Up and Aroon Down values for both raw price and the RSI indicator, measuring the spread between price Aroo

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · None stated GitHub repository of Aroon RSI Adjusted Net

MACD Delta Strategy

by juliencrn
1 stars

This Pine v5 strategy computes MACD and takes the difference between the MACD and signal lines. It goes long when that histogram crosses above zero and short when it crosses below, reversing the position. A percentage stop loss measured from the average entry

Strategy v5 Oscillators & momentumTrend Archived
Updated 4 years ago · None stated GitHub repository of MACD Delta Strategy

BTC Futures Daily Bias

by 0xfffangel
1 stars

An overlay meant for the daily chart that gives a long, short or neutral bias for Bitcoin. It takes daily prices from a chosen source such as CME futures, an index feed or Binance, then compares two EMAs (8 and 21 by default) with an 80-period Hull moving aver

Indicator v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of BTC Futures Daily Bias

micayael EMAs

by micayael
1 stars

An overlay that plots a selection of exponential moving averages: a main pair at 10 and 55 drawn as circles, and an optional set at 7, 21, 30, 50, 100 and 200. Optional extras are an ADX-based movement strength display with a key level, a pullback display, and

Indicator v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of micayael EMAs

EMA Crossover Strategy

by rocketbrainsurgeon
1 stars

This strategy trades the crossover of two exponential moving averages of the bar midpoint, where the slow length is a chosen multiple of the fast length. It goes long when the fast line crosses above the slow line and short on the opposite cross, or only long

Strategy v4 Moving averagesTrend
Updated 5 years ago · GPL-3.0 GitHub repository of EMA Crossover Strategy

Nasdaq

by rosskevin
1 stars

This indicator plots market breadth metrics for the Nasdaq exchange in a separate pane. It calculates a simple moving average of the Nasdaq Advance-Decline line, switching between a 10-period average on weekly charts and a 50-period average on daily charts, co

Indicator v4 TrendMoving averages
Updated 5 years ago · AGPL-3.0 GitHub repository of Nasdaq

This indicator calculates and plots logarithmic growth curves and intermediate Fibonacci levels directly on the main price chart to outline long-term channel boundaries for Bitcoin. It computes upper and lower growth curves based on historical time elapsed sin

Indicator v4 TrendSupport & resistance
Updated 6 years ago · GPL-3.0 GitHub repository of Bitcoin Logarithmic Growth Curves

HalfTrend

by everget
947 stars

HalfTrend plots a trailing trend line on the price chart. It tracks recent highs and lows over an amplitude window and flips between up and down when a simple moving average of highs or lows crosses the tracked extreme and price confirms. The line is blue in a

Indicator v6 TrendVolatility & bands
Updated 12 days ago · GPL-3.0 GitHub repository of HalfTrend
330 stars

Double Supertrend [Alorse] is a trend-following strategy that calculates two Supertrend indicators with distinct ATR periods and multiplier factors directly on the price chart. It enters long or short positions when the fast Supertrend signals a trend. Exits o

Strategy v5 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Double Supertrend [Alorse]
257 stars

This overlay indicator tracks sideways consolidations on the SPX price chart and flags breaks above or below that range. It builds a zigzag from the highest and lowest bars inside a loopback window, smooths nearby highs and lows with a rational quadratic kerne

Indicator v6 BreakoutSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of SPX 30M - Trading Chart
106 stars

This strategy trades the three-candle strike pattern filtered by trend direction and time sessions. It calculates market regime using linear regression and exponential or smoothed moving averages to distinguish between ranging and trending conditions. Risk man

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Candle Strike Strategy

Bollinger Bands Strategy

by cklose2000
105 stars

This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po

Strategy v5 Volatility & bandsMoving averages
Updated 1 year ago · None stated GitHub repository of Bollinger Bands Strategy
104 stars

This overlay strategy combines a Chandelier Exit with a zero-lag least squares moving average. Although the header mentions Heikin Ashi candles, the calculations use ordinary closes. An ATR trailing stop sets long and short levels, and direction flips when pri

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Chandelier Exit & ZLSMA Strategy
56 stars

BigBeluga Smart Money Concepts identifies and overlays market structure and volumetric order blocks directly on the price chart. It analyzes market swings, trend sweeps, and mapping structure using customizable pivot lengths and calculation modes. The indicato

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of BigBeluga - Smart Money Concepts
53 stars

This strategy evaluates two Relative Strength Index (RSI) indicators across two user-defined timeframes to generate trading signals. The higher-timeframe RSI acts as a trend filter, enabling long trades when above 50 and short trades when below 50. Lower-timef

Strategy v6 Oscillators & momentumTrend
Updated 2 months ago · MPL-2.0 GitHub repository of Customizable Dual-Timeframe RSI Strategy
47 stars

The Vortex Trend Tracker calculates positive and negative Vortex Indicator values smoothed with exponential moving averages. It plots a histogram representing the absolute difference between the smoothed positive and negative lines in a separate pane, alongsid

Indicator v4 TrendOscillators & momentum
Updated 5 years ago · None stated GitHub repository of Vortex Trend Tracker 2.0 + RSI

BTC Onchain Indicator

by readysetcryptocodes
43 stars

The indicator overlays Bitcoin pricing models built from daily on-chain series, including difficulty, supply, and market capitalization. It plots a difficulty ribbon from a power-law regression and several moving averages, a stock-to-flow price, a cumulative a

Indicator v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of BTC Onchain Indicator

SMAOffsetProtectOptV0

by viktors1982
36 stars

This strategy generates buy and sell signals based on moving averages with price percentage offsets, combined with an Elliott Wave Oscillator (EWO) and RSI filter. Long entries occur when price falls below the offset moving average under specific EWO and RSI c

Strategy v4 Moving averagesOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of SMAOffsetProtectOptV0

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