Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 12)

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

12/26-IT Strategy

by PlusGenie
1 stars

12/26-IT Strategy is a trend-following trading strategy that calculates 12 and 26 exponential moving averages alongside resistance levels and RSI bounds. It triggers long entries upon EMA crossovers, optionally filtered by resistance pivots and RSI ranges. The

Strategy v5 TrendMoving averages
Updated 2 years ago · MPL-2.0 GitHub repository of 12/26-IT Strategy
1 stars

This indicator overlays two variants of Bollinger Bands and four simple moving averages on the price chart. It plots the Bollinger basis along with upper and lower bands for two adjustable settings using different lengths and multipliers. It also displays MA7,

Indicator v4 Moving averagesVolatility & bands
Updated 2 years ago · None stated GitHub repository of Multi-Indicator Script
1 stars

A strategy that applies a k-nearest-neighbours classifier to RSI, ROC, CCI or volume features to estimate the next move, then trades long and or short with an optional moving average filter and volatility filter. Each position uses an ATR-multiple stop loss, a

Strategy v5 AI / machine learningTrend Repaints
Updated 2 years ago · None stated GitHub repository of kNN-Based Trend Following

SuperBollingerTrend

by eduardofx
1 stars

A price-chart overlay that builds a trailing line from Bollinger Bands calculated on highs and lows. The line follows the lower band while price is above it and the upper band while price is below, flipping colour when price crosses. Each flip can draw a zigza

Indicator v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of SuperBollingerTrend

GetTrend Strategy

by Bojack960
1 stars

This strategy tracks trends by comparing higher-timeframe open and close prices fetched via security calls. When the higher-timeframe close crosses above the open, a buy signal triggers, and a cross below triggers a sell signal, plotted with chart labels and c

Strategy v4 Trend Repaints
Updated 2 years ago · None stated GitHub repository of GetTrend Strategy

2Mars Strategy

by facejungle
1 stars

A multi-entry strategy combining a moving average cross, Bollinger Band touches and an optional SuperTrend confirmation. Extra orders can open when price reaches chosen outer bands, up to three entries in the same direction. Take-profit levels use standard dev

Strategy v5 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of 2Mars Strategy
1 stars

Wonverine - Lines calculates and plots multiple Simple Moving Averages (SMA) and Exponential Moving Averages (EMA) directly on the main price chart. It features predefined periods including 20, 50, 100, 200, and 500 bars to help identify short-term, medium-ter

Indicator v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Wonverine - Lines

Thange Woodwind Playbook

by govindthange
1 stars

A chart indicator built on Ichimoku-style components, with short-term, mid-term and long-term equilibrium lines, a lagging span and a cloud called the resistance band. It shows entry and exit signals and plans position size from an account size and maximum ris

Indicator v5 TrendSupport & resistance
Updated 3 years ago · Custom licence GitHub repository of Thange Woodwind Playbook

Schaff Trend Cycle

by goki75
1 stars

Schaff Trend Cycle is a trend following indicator that computes a smoothed version of the MACD difference between fast and slow EMAs applied to close prices. It normalizes this difference over a specified length, applies iterative smoothing, and plots the resu

Indicator v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Schaff Trend Cycle

My Strategy

by athul-22
1 stars

This strategy generates trading signals using simple moving average crossovers combined with closed trade results. It opens a long position when a 14-period simple moving average crosses above a 28-period simple moving average, and opens a short position when

Strategy v5 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of My Strategy

Kondor EMA

by arrabyte
1 stars

Strategy that trades crossovers of a 7-period and a 25-period EMA, filtered by a 200-period EMA: longs when the fast line crosses above and the slow line is above the trend line, shorts in the opposite case. Stop loss uses an ATR multiple, with a risk-reward t

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Kondor EMA
1 stars

A strategy that scores MACD, on-balance volume, ADX and DMI conditions into a single value and trades on that value. Inputs set long entry and exit thresholds and short entry and exit thresholds, along with DMI and ADX lengths and signal levels. Long and short

Strategy v5 Oscillators & momentumTrend
Updated 3 years ago · None stated GitHub repository of Money Printer Go BRRRRRR Backtest
1 stars

This indicator plots three moving averages on the price chart: a 36-period exponential average in red, a 200-period exponential average in yellow and a 200-period simple average in purple. The area between the 200 EMA and the 200 SMA is shaded. Lengths and col

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of EMA 36/200 + 200 SMA

X Trend

by Sikako
1 stars

X Trend is an overlay strategy that identifies trend direction and potential entry points using a custom X Trend trailing line, exponential moving averages, and Half Trend calculations. It includes optional Impulse MACD filtering designed to avoid ranging mark

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of X Trend
1 stars

A strategy that combines an Ichimoku-style cloud built from Donchian midpoints, MACD, a stochastic and ATR on the price chart. ATR-based stop loss and take profit multipliers, each defaulting to 1.0, set exit distances. A position side setting limits trading t

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of FXFUNDINGMATE Trend Indicator

Nilmiya Heikin Ashi

by jubayernil
1 stars

Nilmiya Heikin Ashi calculates and plots custom Heikin Ashi candlesticks in a separate indicator pane below the main chart. It fetches the smoothed open, high, low, and close values for the active symbol and timeframe using security calls. Bullish bars where t

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

12-BB

by sam30606
1 stars

This overlay strategy combines a Bollinger-style band with separate ATR upper and lower envelopes and optional ADX, Volume Flow Indicator, and RSI filters. It sizes positions as a percentage of equity. Settings change band length and multiplier, ATR periods an

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of 12-BB

ATR

by AliSawari
1 stars

An indicator that draws stop-loss and take-profit style lines on the price chart using a 14-period ATR. A 200-period EMA decides direction: in an uptrend the lower line sits one ATR below the close and the upper line one ATR above, and in a downtrend they swap

Indicator v5 Volatility & bandsTrend
Updated 3 years ago · MPL-2.0 GitHub repository of ATR
1 stars

A strategy written for 15-minute charts that looks for pullbacks within an uptrend. It requires the 50 EMA above the 200 EMA, the close below the 50 EMA, a recent oversold reading on a smoothed Stochastic RSI, and a stochastic cross up that is higher than an e

Strategy v5 Oscillators & momentumMean reversion
Updated 3 years ago · GPL-3.0 GitHub repository of Fluffy 15M Stochastic RSI Top

Sabarobe

by jinjernot
1 stars

An overlay indicator that stacks many familiar tools on one chart: Bollinger Bands, simple moving averages at 5, 10, 50, 100 and 200, exponential averages at 10, 55, 100 and 200, and an Ichimoku cloud. It also marks triangles when a reversal-style candle forms

Indicator v4 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of Sabarobe

FTSMA

by timurista
1 stars

A strategy that uses a Fourier transform of recent prices, with a selectable lookback and three chosen sinusoid components, together with fast, medium and slow moving averages of selectable type, including EMA, ALMA and FRAMA. Optional linear regression smooth

Strategy v4 Moving averagesTrend Repaints
Updated 3 years ago · None stated GitHub repository of FTSMA

ADX Expand

by JohnsonHsiao
1 stars

This indicator calculates the Average Directional Index alongside a simple moving average to evaluate trend strength. It plots the raw ADX line and its moving average in a separate pane below the price chart. Users can configure the ADX period, the ADX smoothi

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of ADX Expand
1 stars

A combined oscillator pane built for a Boom and Crash style strategy. It plots a very long RSI, a short moving average, and a ribbon of five very short EMAs, with price high and low pivots over a lookback window and optional horizontal levels. It adds a True S

Indicator v5 Oscillators & momentumTrend
Updated 4 years ago · None stated GitHub repository of Bootsie's Boom and Crash Combo
1 stars

This strategy template plots indicators directly on the price chart, including exponential moving averages, relative strength index, and average directional movement. It incorporates position management options such as account leverage, percentage-based positi

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Strategy Template

Supertrend v2

by greenish7
1 stars

Combines a Supertrend line with a Stochastic RSI filter on the price chart. Supertrend uses an ATR period and multiplier on a chosen source and marks trend flips with buy and sell signals and highlighting. Separate long and short entry conditions require the S

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Supertrend v2

Shortingen Strasse

by eyusufatik
1 stars

An overlay that combines three studies into long and short signals: a Hull moving average in HMA, THMA or EHMA form shown as a trend-colored band, optionally from a higher timeframe, plus two QQE RSI-based momentum components and an oscillator with a short and

Indicator v4 Moving averagesOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Shortingen Strasse
1 stars

A price-chart overlay that draws a moving average channel from a higher timeframe. It computes the moving average of the high, close and low on a chosen timeframe of 1 hour, 4 hours, daily, weekly or monthly, and plots them as three red lines. Settings pick th

Indicator v5 Moving averagesTrend Repaints
Updated 4 years ago · None stated GitHub repository of Switch using an expression
1 stars

A multi-tool overlay that bundles several classic studies on one chart, each with its own on/off switch. These include a blended BBI moving average colored by position against price, four configurable EMAs, Bollinger bands, parabolic SAR, zigzag with fib level

Indicator v5 TrendMoving averages
Updated 4 years ago · MIT GitHub repository of Victorinox by Illupute v1

Armonia de los MACD

by micayael
1 stars

A separate-pane indicator that plots a MACD with a simple-average signal line, colored by whether it is rising or falling around zero. On common timeframes it also plots a second MACD scaled up by a fixed multiplier toward a higher timeframe, drawn as circles.

Indicator v4 Oscillators & momentumTrend
Updated 4 years ago · None stated GitHub repository of Armonia de los MACD

Leo Supertrend

by kodtodya
1 stars

Leo Supertrend calculates and plots a Supertrend indicator alongside an Exponential Moving Average on the main price chart. It determines trend direction by tracking price relative to an ATR-based volatility band, supporting both standard RMA and simple moving

Indicator v4 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of Leo Supertrend
1 stars

This trend-following strategy overlays fast and slow Hull Moving Averages, Parabolic SAR, Chaikin Money Flow, a Volume Oscillator, and Heikin Ashi candle confirmation on the main price chart. Long entries occur when price and fast HMA are above the slow HMA, S

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of KRJ Swing HMA Volume Sar HA
1 stars

This strategy builds trades from two configurable moving averages, each selectable from eleven types with its own source, length, offset and ALMA settings. Optional modules add RSI-based take profit and stop levels and an ATR comparison as confirmation, and it

Strategy v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of All Moving Average Strategy

The script calculates two exponential moving averages with 21 and 34 periods and plots them on the price chart. It fills the area between them in a color that changes from green to red based on whether the fast MA is above the slow MA. This creates support ban

Indicator v5 Moving averagesTrend Archived
Updated 4 years ago · MPL-2.0 GitHub repository of MehdiJangjou - BullMarket Support Type 2

Stoch Strat

by GoatGodXBT
1 stars

Stoch Strat is an overlay trading strategy that combines Stochastic Oscillator crossovers, MACD histogram momentum, and 50/100 Exponential Moving Averages for trend filtering. It generates long signals when Stochastic crosses up in oversold conditions while pr

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Stoch Strat

MA+ADX+DMI

by fifiteen82726
1 stars

Plots a fast and a slow simple moving average on the price chart and shades the area between them. A buy highlight appears when the fast average crosses above the slow one while the positive directional index is above the negative and ADX is above a key level.

Indicator v4 TrendMoving averages
Updated 5 years ago · None stated GitHub repository of MA+ADX+DMI

Donchian Ichimoku Hybrid

by rocketbrainsurgeon
1 stars

This indicator builds a Donchian channel with midlines between the extremes, then uses Ichimoku-style logic to classify the market as trending up, trending down or ranging. Bars are coloured green, red or gray and the zones near the basis are shaded. An option

Indicator v4 TrendBreakout
Updated 5 years ago · GPL-3.0 GitHub repository of Donchian Ichimoku Hybrid

War Zone Control

by CriptomonedasRentables
1 stars

War Zone Control calculates a fast Exponential Moving Average (EMA) and a slow Weighted Moving Average (WMA) using the selected price source. It plots both moving averages directly on the price chart. When the fast EMA crosses above the slow WMA, it displays a

Indicator v4 TrendMoving averages
Updated 5 years ago · None stated GitHub repository of War Zone Control

DMI

by digasic
1 stars

This indicator calculates and displays the Directional Movement Index (DMI) and Average Directional Index (ADX) in a separate pane below the price chart. It measures directional price movements by computing the positive directional indicator (+DI), negative di

Indicator v4 TrendOscillators & momentum
Updated 6 years ago · None stated GitHub repository of DMI

MACD Rise and Fall

by RayRuizheLi
1 stars

This strategy calculates the MACD line and plots it as a colored histogram in a separate pane. Instead of traditional crossovers, it tracks consecutive rising or falling values on the MACD line. It enters long positions after a configurable number of consecuti

Strategy v4 Oscillators & momentumMoving averages
Updated 6 years ago · None stated GitHub repository of MACD Rise and Fall
1 stars

This indicator plots Bitcoin network hash-rate moving averages in a separate pane. It requests daily hash rate, applies a short and a long simple moving average, and can draw them as ribbons or as an oscillator. Optional markers show miner capitulation when th

Indicator v4 Moving averagesTrend Repaints
Updated 6 years ago · GPL-3.0 GitHub repository of Bitcoin Hash Ribbons

Kal's MTF OBV HAAR

by chipmaker
1 stars

Kal's MTF OBV HAAR is an indicator that plots OBV EMAs with lengths 9 and 4 on a separate pane to highlight volume trends. It calculates CCI with length 10 and CMF with length 10, using crossovers and crossunders of the CCI line at zero for up and down signals

Indicator v4 TrendOscillators & momentum Repaints
Updated 6 years ago · None stated GitHub repository of Kal's MTF OBV HAAR
947 stars

Calculates the Corrected Moving Average (CMA) alongside a standard Simple Moving Average (SMA) over a specified period. The indicator dynamically adjusts the average based on sample variance and deviation from price. Both lines plot directly on the price chart

Indicator v6 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Corrected Moving Average

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated 2 days ago · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout

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