Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 18)

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

EA_2

by equitymarkets
1 stars

EA_2 is a basic strategy template that generates trade entries based on price crossovers with a Simple Moving Average. It monitors a fast moving average relative to a selected price source, entering a long position when the price crosses above the moving avera

Strategy v6 Moving averagesTrend
Updated 1 year ago · MIT GitHub repository of EA_2

MTF Moving Average

by itsmeterada
1 stars

Plots a simple or exponential moving average calculated on a user-selected timeframe over the current chart. Inputs set the timeframe, average type, length, source, line colour, thickness and transparency. An optional label on the last bar shows the timeframe,

Indicator v6 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of MTF Moving Average
1 stars

This strategy executes long trades based on price interaction with a daily simple moving average. It calculates a higher-timeframe daily SMA and its derivative using a three-point backward difference formula. Long entries trigger when the close sits within a s

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Price Crossover Strategy

OTHERS.D MTPI

by Mikelkulla
1 stars

This strategy computes the direction of the altcoin market via the Others.D MTPI index. It merges outputs from Median Supertrend, FDI-Adaptive Supertrend, Hyperbolic Tangent Volatility Stop, Dema AFR, and Normalized KAMA Oscillator to generate long or short si

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of OTHERS.D MTPI

TrendTwisterV1.5

by Axden27
1 stars

TrendTwisterV1.5 is a Pine Script strategy that uses a 12-period Hull Moving Average and a 5-period EMA shifted forward by 2 bars to identify trend changes. It plots the Hull MA in orange and the shifted EMA in blue on the price chart with buy and sell signal

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TrendTwisterV1.5
1 stars

A separate-pane indicator that calculates ADX and the plus and minus directional indicators with Wilder smoothing and shows their difference as a coloured histogram. Optional lines show ADX and ADXR, which averages ADX with its earlier value. Two threshold inp

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Histogram with DI Lines

TB: Main Indicators

by farias-hecdin
1 stars

This indicator collects overlay tools for the price chart in one script. It draws two configurable vertical time separators, tints the background by day of week, and plots two EMAs of 100 and 50 periods. It also marks support and resistance from pivot highs an

Indicator v5 TrendMoving averages
Updated 1 year ago · MIT GitHub repository of TB: Main Indicators

Swing Trader Strategy

by MuhammadHussain07
1 stars

Swing Trader Strategy is a long-only strategy that buys when the MACD line crosses above its signal line during a chosen date range. It exits when the close falls below a trailing stop measured from the highest close since entry, or below a fixed percentage st

Strategy v6 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Swing Trader Strategy

Jinni v1

by Hurairahengg
1 stars

Jinni v1 is a Pine Script indicator that plots buy and sell signals on the price chart. It calculates two EMAs, one on close with length 34 and another on input source with length 65, to detect uptrend and downtrend. Additional checks include candle direction,

Indicator v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Jinni v1

SuperChandelierIndicator

by darkshloser
1 stars

Draws three ATR-based SuperTrend lines on the price chart, each with its own ATR period, multiplier, source and a wicks-or-close option. A second timeframe input supports a higher timeframe view, and a Chandelier-style exit layer with ATR length, multiplier, c

Indicator v5 TrendVolatility & bands
Updated 2 years ago · Apache-2.0 GitHub repository of SuperChandelierIndicator

Tripple Supertrend Strategy

by danielhyuncoder
1 stars

The Tripple Supertrend Strategy calculates three separate Supertrend indicators using different length and multiplier parameters to gauge trend concurrence. It enters a long position when all three Supertrend instances align in a bullish direction. The strateg

Strategy v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of Tripple Supertrend Strategy

Grail Only Shorts

by Wendigooor
1 stars

A short-only strategy that combines a slow SMA, medium and fast EMAs, a pin bar test, a stochastic filter, an MFI filter on a separate timeframe and a stochastic momentum index. Exits use a trailing stop plus a hard stop expressed in pips. Inputs include stop

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

Surfr 5-Minute Variant

by RobACurtis
1 stars

A strategy that trades when price closes across a 50-period moving average after the previous close was on the other side, with a Stochastic RSI direction check and a cap on the stop distance in points. A confirmation timeframe, 5 minutes by default, supplies

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Surfr 5-Minute Variant

This long-only strategy builds an AlphaTrend line from ATR bands that switches behaviour on MFI, or RSI when volume data is missing. A buy signal appears when the line crosses above its two-bar-delayed copy, and a sell signal on the opposite cross. It enters l

Strategy v5 TrendVolatility & bands
Updated 2 years ago · MPL-2.0 GitHub repository of Alpha Trend Strategy on TradingBoat

This strategy enters long when a 13-period EMA crosses above a 34-period EMA and short when it crosses below, and closes on the opposite cross. While in a trade, it places a stop loss and a take profit at fixed percentages of the average entry price, set separ

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of EMA Crossover With Percentage Stop and Target
1 stars

This indicator draws several kernel regression lines on the price chart, using a kernel function library. Each of five lines has its own filter mode (No Filter, Smooth or Zero Lag), kernel type (Rational Quadratic, Gaussian, Periodic or Locally Periodic), look

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Kernel Regression Toolkit

The Woverine - Buy Sell Indicators plots buy and sell labels on the price chart based on selected calculation sources like close, EMA, or SMA, combined with ADX for long or short strategies. Users can customize the strategy type, signal colors, label sizes, po

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of Woverine - Buy Sell Indicators

200 EMA

by mayurpatil77
1 stars

This indicator plots a 200-period exponential moving average on the price chart. It colors the line green when the current EMA is above its value on the previous bar and red when it is not, so the color tracks whether the average is rising or falling. There ar

Indicator v4 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of 200 EMA

Imbalance Strategy

by creatidy
1 stars

A stock strategy that combines a trend template with relative strength against a reference index. It builds smoothed moving averages scaled for daily or weekly charts, 52-week high and low, and an IBD-style relative strength measure against a reference symbol.

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · GPL-3.0 GitHub repository of Imbalance Strategy

Mavezo

by arrabyte
1 stars

Strategy built on exponential moving averages and an optional volume zone oscillator filter. It plots fast, slow and 200-period trend EMAs on the price chart. Risk settings include an ATR based stop distance, a risk-to-reward ratio for the take profit, optiona

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Mavezo

Fluffy MACD Uptrend

by pvdochtend
1 stars

A long-only strategy that buys when the MACD histogram turns from negative to positive while the 50 EMA is above the 200 EMA and RSI sits between a lower and an upper limit. Its only exit is a percentage take-profit above the average entry price. No stop loss

Strategy v5 Oscillators & momentumTrend
Updated 3 years ago · GPL-3.0 GitHub repository of Fluffy MACD Uptrend

EMA 50 100 150 200

by juliencrn
1 stars

This overlay indicator plots exponential moving averages of the close at 12, 26, 50, 100, 150 and 200 periods in different colors on the price chart. The 12 and 26 lines are the fast and slow averages used in MACD and are labeled that way in the plot names. Th

Indicator v5 TrendMoving averages Archived
Updated 4 years ago · None stated GitHub repository of EMA 50 100 150 200

Supertrend v2 Strategy

by greenish7
1 stars

Strategy version of a Supertrend plus Stochastic RSI system. Supertrend direction comes from an ATR period and multiplier; long and short entries require the Stochastic RSI lines to be in low or high bands and close to each other while the trend agrees. Trades

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

Alt Coin BB SMA Strategy

by samliu0206
1 stars

Alt Coin BB SMA Strategy calculates custom MACD delta histogram values, Bollinger Bands, and middle band slopes to generate trading signals in a separate pane. It triggers long entry orders when the price crosses above the Bollinger middle band, provided the M

Strategy v4 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Alt Coin BB SMA Strategy
1 stars

A separate-pane indicator that plots a slow MACD, 21 and 200 periods by default, against a long simple-average signal line, colored green or red by which is higher. A second MACD can be shown, with its lengths multiplied by a factor chosen for the chart timefr

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

MJ Bull Support 1

by mehdijangjou
1 stars

This indicator plots the 20-period EMA in green and the 20-period SMA in red directly on the price chart. It fills the space between the two moving averages using a color that changes based on which line sits above the other. The script targets crypto assets a

Indicator v5 Moving averagesTrend Archived
Updated 4 years ago · MPL-2.0 GitHub repository of MJ Bull Support 1

MA+ADX+DI+time Strategy

by fifiteen82726
1 stars

A long-only strategy that enters when a fast simple moving average crosses above a slow one, the positive DI is above the negative DI and ADX is above a key level. It closes the position on the opposite cross with DI and ADX confirming. Trading is limited to a

Strategy v4 TrendMoving averages
Updated 5 years ago · None stated GitHub repository of MA+ADX+DI+time Strategy

EMA Crossover

by rocketbrainsurgeon
1 stars

This indicator plots a fast and a slow exponential moving average of the bar midpoint on the price chart. The slow length is the fast length multiplied by a selectable ratio from three to ten, which keeps the two lines well apart. A triangle marks each upward

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

This indicator plots logarithmic growth curves directly on the price chart to model macro valuation channels for Bitcoin. It calculates upper and lower bounds using elapsed time from a fixed historical baseline, scaling mathematical curves and intermediate Fib

Indicator v4 Support & resistanceTrend
Updated 6 years ago · GPL-3.0 GitHub repository of Bitcoin Logarithmic Growth Curves
947 stars

The Fibonacci Weighted Moving Average calculates a trend-following line on the price chart using Fibonacci sequence numbers as weights. Newer data points receive larger Fibonacci weights to increase responsiveness compared to standard simple moving averages. I

Indicator v6 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Fibonacci Weighted Moving Average
318 stars

This indicator plots fast and slow moving averages using either EMA or SMA directly on the main chart to identify trend direction and crossovers. It calculates an ATR-based trailing stop line derived from the highest high minus a multiplied ATR value over a co

Indicator v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TVT MA Crossover with Stop Loss
257 stars

This overlay strategy targets one-minute ES futures and plots volume-weighted moving-average bands from the open, scaled by a standard-deviation multiple, plus a slower band from ten-minute opens. A higher-timeframe exponential moving average can filter trades

Strategy v6 Moving averagesVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint

JMA Clone

by capissimo
114 stars

This indicator implements an approximation of the Jurik Moving Average algorithm, featuring an adjustable power parameter. It overlays a smoothed curve and a one-bar lagged reference curve directly on the price chart. When the slope turns upward, a green circl

Indicator v5 Moving averagesTrend Repaints
Updated 1 year ago · None stated GitHub repository of JMA Clone

BTC MACD Basic Tests

by iamrichardD
57 stars

BTC MACD Basic Tests implements a Pine Script unit-testing framework designed to validate components of a long-only Bitcoin MACD trading system. It constructs structured test cases to evaluate mock functions for MACD crossover calculations, volume threshold ch

Strategy v6 Oscillators & momentumTrend
Updated 1 year ago · Apache-2.0 GitHub repository of BTC MACD Basic Tests
53 stars

This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of Candle Counter + MA + RSI + Mode

EMA

by milocaetano
48 stars

This script calculates and plots an Exponential Moving Average (EMA) directly on the price chart. It uses Pine Script's built-in moving average calculation over a customizable period length and input price source, defaulting to a 9-period close price. The resu

Indicator v5 Moving averagesTrend
Updated 3 days ago · MIT GitHub repository of EMA

This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price

Strategy v5 TrendMoving averages Repaints
Updated 2 years ago · None stated GitHub repository of Binancash Futures Strategy 1M Candles

Abandoned Baby - Bullish

by TWODS-CAPITAL
37 stars

This indicator identifies the Bullish Abandoned Baby candlestick pattern directly on the price chart. The three-bar reversal pattern consists of a strong down candle during an established downtrend, followed by a lower gapping doji candle, and completed by an

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Abandoned Baby - Bullish

NostalgiaForInfinityV2

by viktors1982
36 stars

NostalgiaForInfinityV2 is a multi-timeframe mean-reversion strategy derived from the popular Freqtrade algorithmic trading framework. It evaluates price behavior using dual Bollinger Bands, RSI, exponential moving averages, and ATR volatility metrics sampled a

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · None stated GitHub repository of NostalgiaForInfinityV2

Smart Money Concepts [LuxAlgo]

by GeneralTradingSarl
24 stars

Calculates and plots Smart Money Concepts elements directly on the price chart. It identifies internal and swing market structure shifts, including Break of Structure (BOS) and Change of Character (CHoCH). The indicator plots bullish and bearish order blocks,

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 12 days ago · Custom licence GitHub repository of Smart Money Concepts [LuxAlgo]

ADX/DMI Strategy

by benso87
24 stars

This strategy calculates ADX and plus and minus directional movement and adds a Bollinger Band Width Percentile filter. It tracks positive or negative DMI, rising or falling ADX, and an optional recent DMI flip within a set lookback. Settings change ADX length

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of ADX/DMI Strategy

SARs

by pacificbay
22 stars

This indicator implements J. Welles Wilder's Parabolic SAR (Stop and Reverse) methodology directly on the price chart. It calculates the trailing SAR level based on user-defined initial, increment, and maximum Acceleration Factors. In addition to plotting the

Indicator v4 Trend
Updated 6 years ago · MIT GitHub repository of SARs

This script plots Vegas Tunnel exponential moving averages directly onto the price chart. It calculates two pairs of EMAs: a fast tunnel using 144 and 169 periods displayed in green, and a slow filter tunnel using 576 and 676 periods displayed in red. Although

Strategy v5 Moving averagesTrend
Updated 3 weeks ago · Apache-2.0 GitHub repository of 第一个指标VeGa隧道交易策略
16 stars

This strategy plots Donchian channels, trailing stops, and profit targets directly on the price chart. It enters breakout trades using a 55-bar Donchian channel and sizes positions according to an ATR-based risk percentage per unit. The system adds units as pr

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 10: Profit Targets

Alighten Pattern A

by alighten-dev
14 stars

Alighten Pattern A is an overlay indicator that calculates market structure pivots and identifies price patterns directly on the main price chart. It plots a ZigZag line to track price highs and lows, rendering horizontal dashed levels and directional signal m

Indicator v6 Support & resistanceTrend Repaints
Updated 2 weeks ago · None stated GitHub repository of Alighten Pattern A

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