Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 37)

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

This long-only strategy combines a 200-period Exponential Moving Average, Stochastic RSI, and three distinct Supertrend indicators with varying ATR periods and multipliers. It enters long trades when price trades above the 200 EMA, Stochastic RSI crosses up fr

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

This strategy trades pullbacks in the direction of a moving-average trend and draws on the price chart. An uptrend requires the 50-period EMA above the 200-period EMA with price above the slower average, and a downtrend is the reverse. It enters long or short

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Trend-Pullback Optimized

SuperTrend Follow

by latentwill
4 stars

The SuperTrend Follow strategy determines trend direction using a simple ATR value derived from the moving average of high-low ranges. It plots on the price chart and enters long positions when price exceeds the ATR value or short when price falls below. The s

Strategy v5 TrendMoving averages
Updated 8 days ago · None stated GitHub repository of SuperTrend Follow
4 stars

This strategy trades directional momentum breakouts for crude oil on the price chart. It enters long or short positions when a fast exponential moving average crosses a slow exponential moving average, provided that current Average True Range exceeds its movin

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of CL Crude Oil Momentum [trugurpala]
4 stars

The Keltner Channel Strategy is a breakout system plotted directly on the main price chart. It calculates upper and lower channel bands around an exponential or simple moving average using ATR, True Range, or bar range multiplied by a specified factor. A long

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Keltner Channel Strategy

MA Crossover Strategy [Lab]

by mitchell-917
4 stars

This strategy plots fast and slow moving averages on the price chart and trades their crossovers. It enters long when the fast average crosses above the slow average and short when it crosses below. An optional higher-timeframe moving average can block trades

Strategy v5 TrendMoving averages
Updated 11 months ago · Custom licence GitHub repository of MA Crossover Strategy [Lab]

M+AT+BOLL+T3

by Kalumur
4 stars

This multi-indicator toolkit and scanner overlays Tillson T3 Moving Averages, MavilimW weighted moving average combinations, Bollinger Bands, and AlphaTrend calculations directly on the price chart. It includes color-coded trend direction signals and alerts wh

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of M+AT+BOLL+T3
3 stars

This indicator plots four exponential moving averages on the price chart and compares their order. It marks a fast-over-medium crossover only when the fast average is on the same side of the trend average, and it draws buy or sell labels when all four averages

Indicator v5 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Stella's Multi-EMA Crossover

Elite Algo Modded

by IAMATOMIC001
3 stars

This overlay indicator plots optional buy and sell signals on the price chart, with a selectable strategy mode, sensitivity, and an automatic sensitivity option. Filters can limit signals during consolidation, to smart signals, or to high-volume bars, and cand

Indicator v5 Volatility & bandsTrend
Updated 12 months ago · None stated GitHub repository of Elite Algo Modded

This indicator calculates and plots a custom Parabolic Stop and Reverse (PSAR) trailing level directly on the price chart. It tracks trend direction by updating acceleration factors as new extreme price highs or lows are reached. Bullish trends are displayed w

Indicator v5 Trend
Updated 2 years ago · None stated GitHub repository of Parabolic Stop and Reverse (Trend Following)

Golden / Death Cross

by piecioshka
2 stars

This indicator plots a fast and a slow simple moving average on the price chart, defaulting to lengths of 50 and 200. It marks a golden cross when the fast average crosses above the slow average and a death cross when it crosses below. Each cross draws a dashe

Indicator v6 TrendMoving averages
Updated 12 days ago · MIT GitHub repository of Golden / Death Cross

ZEGUELA DEMALONG

by danielvm-git
2 stars

This strategy executes long trades based on Double Exponential Moving Average (DEMA) crossover signals. It calculates up to three DEMAs, triggering entries when the faster DEMA crosses above the slower DEMA (optionally filtered by a third DEMA's direction) or

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of ZEGUELA DEMALONG

This indicator calculates Stan Weinstein's Mansfield Relative Strength (MRS) comparing a security against a chosen benchmark index, such as the S&P 500. It measures outperformance and underperformance relative to a zero line using a moving average baseline. Th

Indicator v6 TrendOscillators & momentum
Updated 3 months ago · Apache-2.0 GitHub repository of Mansfield Relative Strength (Weinstein Method)

WaveTrend with Crosses [LazyBear]

by avatar-lavventura
2 stars

This strategy combines multiple technical indicator systems into a composite trading setup. It computes an Ichimoku Cloud, an ATR-based trailing stop system (nKRAL) with optional Heikin Ashi smoothing, Bollinger Bands, Parabolic SAR, and higher-timeframe Super

Strategy v4 TrendVolatility & bands
Updated 7 months ago · None stated GitHub repository of WaveTrend with Crosses [LazyBear]

This indicator builds a Supertrend-style channel from ATR and the median price, then tracks the highest and lowest prices between trend flips. It plots a grid high, grid low and midpoint, shifted by an offset, and can filter the channel by minimum and maximum

Indicator v6 TrendVolatility & bands Repaints
Updated 8 months ago · MIT GitHub repository of Grid Bot Supertrend Channel [psyll]
2 stars

This strategy enters long when price closes above the prior channel high and a longer EMA filter, the bar is bullish, volume rises versus the previous bar, and average volume and turnover clear set thresholds. It exits the long when price closes below a shorte

Strategy v5 BreakoutMoving averages
Updated 2 years ago · None stated GitHub repository of DegenerateChain Channel Breakout

ZigZag_Punches_OH_OL

by WISEPLAT
2 stars

This indicator calculates pivot highs and lows using a custom depth and deviation threshold to draw zigzag swing lines directly on the price chart. At each swing reversal, it plots labels displaying the reversal price, price change in absolute or percentage te

Indicator v5 Support & resistanceVolume
Updated 3 years ago · None stated GitHub repository of ZigZag_Punches_OH_OL

Range Filter [DW]

by theupslidedown
2 stars

The Range Filter indicator filters out minor price fluctuations directly on the price chart to provide a clearer view of underlying market trends. Inspired by QQE volatility concepts, it calculates a smooth range using methods such as ATR, Average Change, Stan

Indicator v4 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of Range Filter [DW]

Supertrend

by mydcc
1 stars

Supertrend is a trend-following overlay indicator that computes dynamic trailing bands based on the Average True Range and price action. It calculates the standard Supertrend line using customizable ATR length and factor multiplier inputs. Green lines plot bel

Indicator v6 TrendVolatility & bands
Updated 2 days ago · Custom licence GitHub repository of Supertrend

TSMOM L/S SMA50

by nvolpe2007-cell
1 stars

An always-in-the-market strategy that goes long when the daily close is above a 50-bar SMA and short when below, with an optional hysteresis band and a switch to disable shorts. It simulates a perpetual futures position with a funding cost charged over the hol

Strategy v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of TSMOM L/S SMA50

Conduit OBV AccDist

by pineforge-4pass
1 stars

A long-only strategy that requires two volume flow measures to agree: On Balance Volume and Accumulation/Distribution, each compared with its own EMA. It enters long when both are above their signals for the first time and price is above a longer EMA filter. I

Strategy v6 VolumeTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Conduit OBV AccDist
1 stars

A long and short strategy based on five moving averages of 10, 20, 50, 100 and 200 bars. It can require the averages to be in perfect order with aligned slopes, filter entries by ADX range, and optionally by RSI and a higher timeframe moving average. A strict

Strategy v6 Moving averagesBreakout
Updated 8 days ago · None stated GitHub repository of Qullamaggie MA Breakout L+S

DEPV2 A8 · Onay Makinesi

by YuceSezar89
1 stars

This indicator implements a multi-metric confirmation engine that validates trading signals across four core dimensions: trend level scores based on an HLC3 SMA, momentum z-scores derived from rate of change, volatility expansion ratios comparing fast and slow

Indicator v6 TrendOscillators & momentum
Updated 13 days ago · None stated GitHub repository of DEPV2 A8 · Onay Makinesi

SR+Trend v12

by MuhammadMuhamid
1 stars

A long-only crypto spot strategy whose support and resistance section can be switched on or off and set as the main entry trigger or as a secondary filter. When enabled, it uses pivots on four timeframes, ATR-sized touch zones and a retest window. Trend filter

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of SR+Trend v12
1 stars

The XAUUSD Scalping Confluence Engine is a separate-pane indicator that calculates a composite trading score based on multiple technical factors. It evaluates a four-period exponential moving average stack, SuperTrend trend direction, Relative Strength Index,

Indicator v5 TrendOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of XAUUSD Scalping Confluence Engine

Linear Regression Volume

by vedkanani123
1 stars

An overlay indicator that computes a volume-weighted price average using SMA, RMA, HMA or ALMA, fits a linear regression to it as a fair value baseline, and draws bands at one, two and three standard deviations of price around it. The baseline and band fills t

Indicator v6 TrendVolume
Updated 2 months ago · None stated GitHub repository of Linear Regression Volume

Smooth Trend Radar

by raybird
1 stars

A trend strategy on the price chart built on a double-smoothed Supertrend using WMA and EMA smoothing, with pivot rejection entries when price touches the baseline. Settings scale automatically by timeframe. Stop loss can use the flip candle, baseline or swing

Strategy v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Smooth Trend Radar

EMM Strategy V2 - Pine Engine

by tthanhvu002sgu
1 stars

A strategy that trades price crossings of an exponential moving median line on the price chart. It buys when close crosses above the line and sells when it crosses below, closing the opposite position on the same cross. An optional higher-timeframe filter, def

Strategy v5 Moving averagesTrend
Updated 3 months ago · None stated GitHub repository of EMM Strategy V2 - Pine Engine

STT SR TMA Plan

by majohnst
1 stars

This strategy executes trades based on Triangular Moving Average (TMA) crossings, support and resistance structures, and breakout logic. It evaluates multiple confluence conditions including daily pivots, anchored VWAP, and multi-day moving averages alongside

Strategy v6 Moving averagesTrend
Updated 4 months ago · None stated GitHub repository of STT SR TMA Plan

HA Moving Average

by rubbermetal
1 stars

HA Moving Average calculates a moving average from Heikin Ashi prices fetched for the chart symbol, while the chart itself can stay on normal candles. Users choose the average type (EMA, SMA, RMA or WMA), the length and the Heikin Ashi source. The line changes

Indicator v6 TrendMoving averages
Updated 4 months ago · MPL-2.0 GitHub repository of HA Moving Average

Trailing Call Comma

by Snappni
1 stars

This strategy plots a 12-period and a 26-period exponential moving average on the price chart. It enters long when the fast average crosses above the slow average and enters short when the fast average crosses below the slow average. Opposite signals reverse t

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Trailing Call Comma
1 stars

This overlay strategy finds swing highs and lows, then marks an Optimal Trade Entry band between the 0.62 and 0.79 retracements of the latest impulse. A long is allowed only inside the bullish band and above a trend EMA; a short is allowed only inside the bear

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 5 months ago · None stated GitHub repository of Talons OTE (Optimal Trade Entry)
1 stars

An overlay toolkit for crypto charts that combines a volume profile with value area, an anchored VWAP, EMA lines, a higher-timeframe EMA bias and an order flow proxy from lower-timeframe delta, relative volume and cumulative delta, plus swing and ATR-based pri

Indicator v6 VolumeSupport & resistance
Updated 5 months ago · MIT GitHub repository of Crypto AMT Toolkit v7 Clean Execution
1 stars

This strategy generates buy and sell signals on the SP500 4H chart using EMA crossovers confirmed by MACD, filtered by ADX trend strength, RSI levels, and active London or New York sessions. It plots EMA 9, EMA 21, and EMA 200 on the price chart. Buy signals e

Strategy v6 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Señales EMA + MACD v4b [SP500 4H]

V15 Zone Trader

by snoozie-v
1 stars

An indicator that takes a four-hour EMA trend with a small deadzone and looks for one-hour entries in the same direction, either a fast and slow EMA crossover or a pullback, with optional volume confirmation. Stops and targets are ATR multiples with one, two a

Indicator v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of V15 Zone Trader

EMA Crossover Strategy

by knectardev
1 stars

This strategy plots a fast and a slow exponential moving average on the price chart. It opens a long position when the fast EMA crosses above the slow EMA and closes that long when the fast EMA crosses back below. There is no short entry and no stop loss. Posi

Strategy v5 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of EMA Crossover Strategy
1 stars

A chart-overlay indicator that tracks a Hull moving average and issues buy and sell signals when price crosses it in the direction of the slope. Entries are filtered by a score built from momentum, RSI and volume, a price-volume-trend check, and an optional bl

Indicator v6 TrendOscillators & momentum
Updated 9 months ago · None stated GitHub repository of RAPF Anti-Chop Fusion

Supertrend Strategy

by Studentcodee
1 stars

A Pine v6 strategy that follows the built-in Supertrend indicator on the price chart. The ATR length and the multiplier factor are inputs. When the Supertrend direction flips to bullish the strategy enters long, and when it flips to bearish it enters short, so

Strategy v6 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Supertrend Strategy
1 stars

An EMA crossover strategy that allows up to three entries in the same direction. A fast EMA crossing above a slow EMA opens a long, and crossing below opens a short with a size taken from a risk percentage of equity divided by price. Every opposite cross close

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Pyramid Strategy with EMA Cross

Supertrended RSI

by munlit
1 stars

A separate-pane indicator that computes an RSI, smooths it with a selectable moving average type, and applies a Supertrend-style ATR band to it. The trend line flips when the RSI crosses the band, and colours show direction. Inputs set the RSI length, smoothin

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Supertrended RSI
1 stars

This indicator adapts a chop zone calculation, which measures the angle of an average price line, to colour the candles on the price chart instead of drawing a separate oscillator. It also plots a selectable moving average, with options SMA, EMA, ALMA, HMA, RM

Indicator v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Moving Average Chopzone Color
947 stars

The Quick Moving Average calculates a triangular-weighted moving average on the price chart. It plots the average line and can color it green when rising or pink when falling. Price bars and chart background receive matching colors based on slope. Settings con

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

Omar MMR [Alorse]

by Alorse
330 stars

Omar MMR is a long-only price-chart strategy that combines three exponential moving averages, RSI, and MACD. It enters long when price is above the slowest average, the fastest average is above the middle one, the MACD line crosses above its signal, and RSI is

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Omar MMR [Alorse]
257 stars

This indicator uses a Lorentzian distance k-nearest neighbors classification algorithm to predict market direction based on up to five technical features, such as RSI, WaveTrend, CCI, and ADX. It compares current feature values against historical bar patterns

Indicator v5 AI / machine learningOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of Donald - Machine Learning Options
99 stars

Calculates the Archer Moving Averages Trends (AMAT) indicator by comparing fast and slow Exponential Moving Averages (EMAs) alongside their slope directions. A bullish trend (+1) is identified when the fast EMA exceeds the slow EMA with both rising, while a be

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Archer Moving Averages Trends (AMAT)

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