Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 29)

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 strategy calculates the Supertrend using ATR period and factor inputs, then plots green lines for up direction and red lines for down direction on the price chart. It signals long entries when Supertrend changes to positive and short entries when changing

Strategy v5 TrendMoving averages
Updated 2 years ago · MPL-2.0 GitHub repository of Hello World, Supertrend
1 stars

A price chart overlay that combines an SSL channel system with ATR bands around the close. It offers a baseline, a first SSL line, a continuation line and an exit line, each with a selectable moving average type such as HMA, JMA, TEMA, Kijun or McGinley. Bars

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of SSL + QQE + RSI Indicator

This indicator plots Support and Resistance levels on the price chart. Support is drawn as a green line at the highest high over the specified length, and Resistance as a red line at the lowest low. An optional Directional Projection Trend line can be shown us

Indicator v5 Support & resistanceTrend
Updated 3 years ago · MIT GitHub repository of Woverine - Support & Resistance

Min-Max Strategy

by creatidy
1 stars

A strategy that trades breakouts of a rolling high and low channel, filtered by a long moving average adjusted for relative strength. Stop orders are placed at the upper channel for longs when the channel low is above the adjusted level, and at the lower chann

Strategy v4 BreakoutTrend
Updated 3 years ago · GPL-3.0 GitHub repository of Min-Max Strategy

Money Printer Go BRRRRRR

by sourdiesel1202
1 stars

A separate-pane indicator that sums scored readings from an imported helper library covering a moving average, ADX, DMI, MACD and on-balance volume into one combined value. That value is plotted as a blue line against reference levels at zero, 100 and minus 10

Indicator v5 Oscillators & momentumTrend
Updated 3 years ago · None stated GitHub repository of Money Printer Go BRRRRRR

EMA Crosses

by krosenfeld7
1 stars

This indicator calculates and plots three exponential moving averages across both the current chart timeframe and a user-selected higher timeframe, defaulting to the daily period. It identifies trend changes and momentum shifts using higher-timeframe crossover

Indicator v4 Moving averagesTrend
Updated 3 years ago · Apache-2.0 GitHub repository of EMA Crosses

Trend Meter

by jubayernil
1 stars

Trend Meter is a multi-indicator visual tool designed to confirm market directional bias across multiple technical filters in a separate pane. It tracks three customizable Trend Meters based on MACD crossovers or RSI threshold levels, alongside two Trend Bars

Indicator v4 TrendOscillators & momentum Repaints
Updated 3 years ago · None stated GitHub repository of Trend Meter

Turtle Trader

by rocketbrainsurgeon
1 stars

The Turtle Trader indicator merges Donchian channels with trend detection to classify market state. It computes upper and lower channel levels from recent highs and lows, along with stop levels, and plots them directly on the price chart. Green bars signal upw

Indicator v4 TrendVolatility & bands
Updated 5 years ago · GPL-3.0 GitHub repository of Turtle Trader

Weinstein MAs

by rosskevin
1 stars

Weinstein MAs plots adaptive simple and volume-weighted moving averages based on Stan Weinstein's Stage Analysis framework. On weekly charts, it calculates 10, 30, and 40-period MAs, whereas on non-weekly intervals it uses 50, 150, and 200-period MAs. Both sim

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

This indicator combines three technical tools into a single price overlay: dual Exponential Moving Averages (EMA), Parabolic SAR (PSAR), and ATR-derived stop loss levels. It calculates fast and very fast EMAs (defaults 9 and 21) using a custom EMA function, pl

Indicator v4 TrendMoving averages
Updated 6 years ago · GPL-3.0 GitHub repository of EMA-PSAR-ATR Indicators [Numchuck]

The Inverse Distance Weighted Moving Average calculates a moving average where historical prices are weighted according to their pairwise absolute distances across a user-defined lookback window. Plotted directly on the price chart, the indicator tracks trend

Indicator v6 Moving averagesTrend
Updated 12 days ago · GPL-3.0 GitHub repository of Inverse Distance Weighted Moving Average
257 stars

This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry

Strategy v6 Volatility & bandsSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of V1.6 ES - Futures 1M No Repaint

This strategy combines Linear Regression Candles with UT Bot trailing stop signals to generate trading setups. It calculates smoothed linear regression open, high, low, and close values alongside a signal line, while computing an ATR-based trailing stop. Long

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Linear Regression Candles and UT Bot Strategy

Adaptive Price Channel

by mihakralj
99 stars

This indicator calculates an adaptive price channel by independently smoothing bar highs and lows using exponential moving averages. It plots an upper band from smoothed highs, a lower band from smoothed lows, a yellow midpoint line, and a shaded channel area

Indicator v6 Volatility & bandsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Adaptive Price Channel
92 stars

Calculates fast and slow Simple Moving Averages to display a visual rainbow ribbon on the price chart. The indicator fills multiple gradient bands between the dual moving averages and adds visual effects like glowing SMA halos, animated palette shifts, and reg

Indicator v6 Moving averagesTrend
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Rainbow Wave 20/40

EMA

by dcaoyuan
55 stars

This indicator calculates and plots three Exponential Moving Averages directly on the main price chart. It includes configurable inputs for fast, slow, and slowest moving averages, defaulting to 9, 21, and 36 periods based on bar close values. Traders can adju

Indicator v6 Moving averagesTrend
Updated 6 months ago · Apache-2.0 GitHub repository of EMA

This trend breakout strategy plots Donchian Channels consisting of upper, lower, and middle bands directly on the main price chart. Long positions enter when price touches the upper channel and pulls back to or below the middle band, placing a stop loss at the

Strategy v6 TrendBreakout
Updated 2 months ago · MPL-2.0 GitHub repository of Donchian Strategy - Dynamic TP, Fixed SL, 1% Risk, Daily Target
47 stars

This indicator calculates and plots an Andrews' Pitchfork channel directly on the price chart using geometric projections. It computes a central median line along with parallel upper and lower channel boundaries based on three historical anchor points specifie

Indicator v6 Support & resistanceTrend
Updated 8 months ago · MIT GitHub repository of Andrews' Pitchfork (AP)

Calculates normalized moving average trend strength, historical volatility, and volatility-adjusted position sizing in a separate pane. It computes the percentage distance between fast and slow EMAs relative to price, evaluates standard deviation of daily retu

Indicator v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Risk-Based Position Size Calculator

This strategy overlays the ETHUSDT perpetual price chart and is labeled for the five-minute timeframe. It calculates a smoothed stochastic oscillator from the open, high, and low, with adjustable K, D, and smoothing lengths plus overbought and oversold levels.

Strategy v5 Oscillators & momentumTrend Repaints
Updated 2 years ago · None stated GitHub repository of ETHUSDTPERP-5M - No repaint 2023

Hyperfork Matrix

by blueprintresearch-dev
42 stars

This indicator draws an Andrews pitchfork on the price chart from three pivots chosen automatically or by time. It supports Original, Schiff, and Modified Schiff constructions, optional extra parallel levels, and forward or backward action and reaction lines.

Indicator v6 Support & resistanceTrend
Updated 2 weeks ago · None stated GitHub repository of Hyperfork Matrix
16 stars

This Pine Script implements a trend-following strategy inspired by John Seykota's methods. It enters positions on Donchian channel breakouts using a longer lookback period of 55 bars and exits on shorter 10-bar signals. Volatility gating prevents adding to pos

Strategy v6 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of Seykota Alt 13: Vol-Gated Adds

HalfTrend + EMA

by msongkiet
16 stars

This indicator combines the HalfTrend trend-following algorithm with five exponential moving averages overlayed directly on the price chart. HalfTrend determines directional bias by evaluating local high and low price extrema over a selectable amplitude alongs

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of HalfTrend + EMA

Market Monitor 5m

by chris-c-thomas
14 stars

Market Monitor 5m is an intraday context overlay designed for 5-minute chart analysis. It calculates directional bias using exponential moving averages, VWAP, TTM Squeeze volatility state, NYSE TICK market breadth, and ATR volatility regimes. The script plots

Indicator v6 Screeners & dashboardsSupport & resistance Repaints
Updated 6 months ago · MIT GitHub repository of Market Monitor 5m

Crossing EMAs B

by ruckard
13 stars

Crossing EMAs B is a moving average crossover strategy designed as an example for Zignaly bot signal integration. It monitors a 14-period and a 28-period simple moving average on close prices, entering long when the short average crosses above the long average

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Crossing EMAs B

NFI v7.2.1

by koradiyakaushal
12 stars

This strategy is a Pine Script implementation of the NostalgiaForInfinity crypto strategy. It calculates indicator metrics across multiple timeframes and compares price action against a master pair such as BTC/USDT. Settings allow traders to configure informat

Strategy v4 TrendMoving averages
Updated 5 years ago · MIT GitHub repository of NFI v7.2.1

Dual Moving Average

by hirawatt
11 stars

The Dual Moving Average strategy calculates fast and slow exponential moving averages based on HLC3 prices. It generates long signals when the fast EMA crosses above the slow EMA and short signals when it crosses below. Position sizing can be calculated dynami

Strategy v4 Moving averagesTrend Repaints
Updated 2 years ago · MIT GitHub repository of Dual Moving Average

Bte Strat

by f-cksociety
11 stars

Bte Strat provides a backtesting and trading engine framework implemented as an indicator on the price chart. It evaluates trade signals using selectable entry rules, technical filters like volume and moving averages, and dynamic exit strategies. The script pl

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

This strategy plots a fast and a slow moving average on the price chart and enters when their relationship flips, subject to an optional ADX filter. It goes long when the fast average is above the slow average and short when it is below, reversing an existing

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Crossing Moving Averages with ADX Filter

Donchian Channel Breakout - Eterna

by EternaHybridExchange
9 stars

This strategy plots Donchian Channel bands, a middle line, and breakout signals directly on the price chart. It opens long positions when price breaks above the upper band and short positions when price breaks below the lower band, evaluated after confirmation

Strategy v5 TrendBreakout
Updated 7 months ago · MIT GitHub repository of Donchian Channel Breakout - Eterna

Ichimoku

by PipC
8 stars

This indicator plots the standard Ichimoku Kinko Hyo components directly onto the price chart. It calculates the Tenkan-sen and Kijun-sen midpoints, shifts the Chikou Span backward, and projects the Senkou Span A and Senkou Span B ahead to form the colored Kum

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Ichimoku

Ichimoku Breakout

by muammeryldrm42
7 stars

This strategy executes trades based on Ichimoku Kinko Hyo breakouts combined with Tenkan-sen and Kijun-sen crosses. A long position triggers when price closes above the cloud top while the Tenkan-sen crosses above the Kijun-sen within a bullish cloud. A short

Strategy v5 TrendBreakout
Updated 3 months ago · MIT GitHub repository of Ichimoku Breakout

This strategy plots a 90-period exponential moving average from the weekly and daily charts plus a daily session VWAP on the price chart. It enters long when the weekly VWAP is above the weekly average and the daily VWAP crosses above the daily average, and en

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 1W Bullish Buy 1D Bearish Sell Session EMA

Confluence

by trsdn
6 stars

The Confluence indicator combines Bollinger Bands, RSI and MACD to generate signals on the price chart. It plots the upper Bollinger Band in green, lower Bollinger Band in red, the middle basis in blue, the RSI value and the MACD line with signal. A confluence

Indicator v5 TrendOscillators & momentum
Updated 7 days ago · MIT GitHub repository of Confluence

30 Laws Dashboard

by AllienNova
5 stars

This indicator overlays a regime and risk dashboard on the price chart. It calculates ADX from DMI, an ATR ratio against a long moving average of ATR, and a daily VIX close. It labels the market SHOCK, TRENDING, RANGING, or TRANSITION using those thresholds. I

Indicator v5 Screeners & dashboardsTrend
Updated 8 weeks ago · None stated GitHub repository of 30 Laws Dashboard

MACD

by SiegerTerpstra
5 stars

This indicator calculates and plots the Moving Average Convergence Divergence (MACD) line, signal line, and histogram in a separate pane. It tracks trend direction and momentum shifts by calculating the difference between fast and slow exponential moving avera

Indicator v6 Oscillators & momentumTrend
Updated 9 months ago · None stated GitHub repository of MACD

Cerebr Centauri Strategy

by jerryinyang
5 stars

Cerebr Centauri Strategy is a multi-indicator trading system for Pine Script v4 that combines Moving Averages (SMA, EMA, LSMA, WMA), Stochastic Oscillator, RSI, and MACD across both current and higher timeframes. It evaluates trend conditions and oscillator st

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Cerebr Centauri Strategy

This short-only trading strategy combines 20 and 50 period Exponential Moving Averages with a pivot low breakout filter. A short entry triggers when the 50 EMA is above the 20 EMA, recent candle closes remain below the 50 EMA while reaching above the 20 EMA, a

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 20 EMA + 50 EMA + Breakout Short Strategy (5M)

Moving Average Pair

by InNoobWeTrust
4 stars

Moving Average Pair calculates and plots two customizable moving averages on the price chart. Users can choose separate moving average types, length periods, source prices, and line styling for both the fast and slow lines. The indicator detects bullish crosso

Indicator v6 Moving averagesTrend
Updated 2 days ago · None stated GitHub repository of Moving Average Pair

RSI EMA Breakout

by latentwill
4 stars

This strategy trades momentum breakouts by combining an Exponential Moving Average with the Relative Strength Index. It enters a long position when the closing price is above the EMA and the RSI crosses above the breakout threshold. It enters a short position

Strategy v5 TrendOscillators & momentum
Updated 8 days ago · None stated GitHub repository of RSI EMA Breakout

Japo [Alorse]

by Hugs-4-Bugs
4 stars

This strategy plots a fast EMA and a slow EMA of Heikin Ashi closes requested from two higher timeframes, both drawn on the price chart. It enters long when the fast average crosses above the slow average and enters short on the opposite cross, only inside a u

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Japo [Alorse]

FRAMA Strategy

by ShabbirHasan1
4 stars

Calculates a Fractal Adaptive Moving Average (FRAMA) and signal line using multi-timeframe security data, plotted directly on the price chart. Includes an optional SuperTrend filter with customizable factors and period for signal confirmation and visual entry

Strategy v4 Moving averagesTrend Repaints
Updated 1 year ago · Custom licence GitHub repository of FRAMA Strategy

My Strategy Coding

by fox-buddy
4 stars

This script executes a trend-following strategy based on simple moving averages and exponential moving averages. It enters a long position when the 5-period SMA is above the 10-period SMA and the 10-period SMA is above the 34-period EMA. It enters a short posi

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of My Strategy Coding

EFELER-DDT

by Kalumur
4 stars

EFELER-DDT plots multiple moving average overlays and pivot-based support and resistance levels directly on the price chart. It calculates dual Weighted Moving Averages (9 and 15 WMA), three standard Exponential Moving Averages (20, 50, and 200 EMA), and three

Indicator v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of EFELER-DDT

This long-term trend-following indicator plots three Weighted Moving Averages (13, 48, and 200 periods) directly on the main price chart. It evaluates price crossovers against each moving average to detect early trend shifts, alongside crossovers between WMA l

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snag - Swing Trade Long Term V3

RSI-7 Breakout

by aofwittawat
4 stars

This strategy identifies breakout trades using a 7-period RSI combined with price extreme lookbacks. A long entry triggers when the RSI rises above 70 and price reaches a new lookback high, provided price remains above an optional EMA trend filter and passes a

Strategy v5 Oscillators & momentumBreakout
Updated 4 years ago · None stated GitHub repository of RSI-7 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