Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 76)

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 overlay strategy combines confirmed pivot break-of-structure with a curved linear-regression and ATR channel. It enters long when price breaks a confirmed pivot high and closes above the slope-adjusted channel midline, and enters short on the symmetric be

Strategy v6 BreakoutSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe bos-curv-probe-integration

TnSovereignAliceV6

by raybird
1 stars

TnSovereignAliceV6 evaluates price action using a five-part methodology comprising fractal efficiency, RSI, Bollinger Bands, proxy institutional flow, and MACD histogram momentum. Entries trigger when a user-defined minimum number of consensus conditions align

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of TnSovereignAliceV6

This indicator calculates a Normalized Least Mean Squares (LMS) adaptive FIR filter based on the Widrow-Hoff learning algorithm. It predicts the current bar price using weighted past values and dynamically adjusts its coefficients based on the prediction error

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Least Mean Squares Adaptive Filter (LMS)
13 stars

This strategy runs on the main price chart and generates trade signals using moving average crossovers. It opens long positions when the fast simple moving average crosses above the slow simple moving average, and enters short positions on a bearish cross. Exi

Strategy v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Ruckard QuickFingers Luc A002

Moving Averages 3D

by regalouisei
2 stars

This indicator calculates ten sequential moving averages using either simple or exponential moving averages and renders them as a pseudo-three-dimensional grid in a separate pane. It projects recent price trends through an array of dynamically colored line dra

Indicator v5 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of Moving Averages 3D
1 stars

This strategy plots the Kaufman Adaptive Moving Average on the price chart as an overlay. It generates buy signals on ta.crossover of close above the KAMA and sell signals on ta.crossunder of close below the KAMA. Long entries occur when flat or short, short e

Strategy v6 Moving averagesTrend Repaints
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Kanuck-Probe-01-Kama-State
1 stars

TnSovereignEntropyCausalityV6 evaluates directional information flow between volume and price using symbolic encoding and an approximated transfer entropy metric. It calculates whether volume precedes price moves across a selectable lookback window while filte

Strategy v6 VolumeTrend
Updated 2 months ago · None stated GitHub repository of TnSovereignEntropyCausalityV6

ADX + BB %B + AO + EMA

by hasnocool
106 stars

This strategy plots multiple exponential moving averages and a linear regression squeeze channel directly on the price chart. It executes 100-unit long and short trades by combining four EMA trend alignments, Bollinger Bands %B extremes, Awesome Oscillator mom

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX + BB %B + AO + EMA

Linear Decay (DECAY)

by mihakralj
99 stars

This indicator calculates a linear decay filter over a selected price source and plots the result directly on the price chart. The algorithm tracks local peaks and descends linearly by a fixed step equal to the inverse of the specified period whenever the pric

Indicator v6 TrendSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Linear Decay (DECAY)

ADX + RSI Strat

by hasnocool
106 stars

This strategy combines a 7-period RSI with an ADX filter to trade market regimes on the price chart. When the ADX indicates ranging conditions below a set threshold, it triggers entries on RSI overbought or oversold extremes. By default, the entry logic is inv

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of ADX + RSI Strat
99 stars

This indicator computes the linear regression endpoint and slope over a specified rolling lookback period. It manages historical price values internally using a circular array buffer, handling missing data by carrying forward the last valid price. The calculat

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Linear Regression (LINREG)
13 stars

This strategy demonstrates how to integrate TradingView signals with the Zignaly Crypto Trading Platform. It calculates a crossover between a 14-period and a 28-period simple moving average to generate trade signals directly on the price chart. Entries trigger

Strategy v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Zignaly Tutorial A061
1 stars

This validation strategy tests the simultaneous runtime handling of Kaufman's Adaptive Moving Average (KAMA), intra-bar tick counting, and deep historical buffer retention. It enters trades when the closing price crosses above KAMA, gated by an intra-bar tick

Strategy v6 Moving averagesTrend Repaints
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Kanuck-Probe-Integration

ADX Strategy

by hasnocool
106 stars

An ADX-based trend-following strategy that enters long positions when the positive directional indicator (DI+) crosses above the Average Directional Index (ADX) while ADX remains below a preset threshold and a fast EMA is above a slow EMA. It allows adding to

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX Strategy
3 stars

This indicator overlays multi-timeframe candlesticks on the current price chart. It pulls data from up to five selected higher timeframes and renders them as boxes with customizable body, border, and wick colors. Candles can be styled as regular or Heikin-Ashi

Indicator v5 Candlestick patternsTrend Repaints
Updated 5 months ago · None stated GitHub repository of MTF Candles + MAs

ADX | DMI Trend

by hasnocool
106 stars

This price-chart strategy treats a rising ADX above a chosen key level as a trend and uses plus and minus DI to choose direction. It enters long when plus DI leads and short when minus DI leads, if short trades are allowed. Volume and an EMA or SMA can block e

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX | DMI Trend

LOESS Filter

by mihakralj
99 stars

This indicator plots a LOESS smoother on the price chart. It fits a locally weighted linear regression inside a sliding window and returns the fitted value at the window center. The length setting sets the window, which is forced to an odd size of at least thr

Indicator v6 Trend
Updated 4 weeks ago · Apache-2.0 GitHub repository of LOESS Filter
1 stars

This validation strategy calculates fast and slow simple moving averages of the closing price. It submits a fixed-size long entry when the fast SMA crosses above the slow SMA, and enters short when the fast SMA crosses below the slow SMA, reversing any open po

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kkb-probe-03-margin-100-pct
106 stars

This strategy captures strong bullish momentum by combining a 200-period SMA baseline, a custom Bollinger Band, the True Strength Index (TSI) smoothed with WMAs, and the ADX trend strength indicator. It initiates long positions when price is above the 200 SMA,

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of ADX_TSI_Bol Band Trend Chaser

PF probe kkb-probe-integration

by pineforge-4pass
1 stars

This strategy combines a one-dimensional Kalman filter with an EMA midline and ATR breakout bands. It enters long when the Kalman estimate rises and close crosses above the upper band, and short when the estimate falls and close crosses below the lower band. A

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe kkb-probe-integration
106 stars

This strategy calculates and plots aggregated Bitcoin volume collected across multiple exchanges, along with two volume moving averages in a separate pane. It enters long positions when price crosses above a fast EMA while remaining above a slow EMA, and enter

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Aggregate BTC Volume + EMA Strat

MTF CCI & SAR

by g-moe
3 stars

This multi-timeframe indicator calculates the Commodity Channel Index and Parabolic SAR across four user-defined timeframes, defaulting to 1, 30, 60, and 240 minutes. It generates signals when CCI exceeds an entry threshold across all four periods while price

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MTF CCI & SAR
2 stars

This indicator projects future pivot levels on the main chart by combining zigzag price swings with a choice of underlying momentum oscillators, such as RSI, CCI, CMO, COG, MFI, or ROC. It draws projected pivot points, pivot lines, sentiment background fills,

Indicator v5 Support & resistanceTrend Repaints
Updated 8 months ago · None stated GitHub repository of Next Pivot Projection [Trendoscope]

This strategy confirms swing pivot highs and lows and compares each new pivot with the previous swing of the same type. It draws on the price chart. A long entry fires when a confirmed pivot high is a higher high and the position is flat or short. A short entr

Strategy v6 Support & resistanceTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe liquidity-sweep-probe-01-pivot-swing
1 stars

This strategy draws on the price chart and trades structural breakouts. It stores confirmed pivot highs and lows, then looks for a close beyond the last pivot in the direction of an exponential moving average. A thermodynamic check must also pass, with free en

Strategy v6 SMC / ICT / price actionBreakout
Updated 2 months ago · None stated GitHub repository of TnSovereignMarketStructureV20

This overlay strategy scores alignment of seven moving averages, lengths 5 through 200, of a user-selected type. Full stacks count as up or down, and partial alignment can add a smaller score. A rolling high-low period flags the current extreme, while an optio

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AlignedMA and Cumulative HighLow Strategy

This overlay strategy scores whether price and moving averages from 5 through 200 periods are fully or partially aligned, and it marks when the bar is a period high or low. Direction helpers compare a series with earlier bars over two configurable lookbacks. I

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AlignedMA and Cumulative HighLow Strategy V2
1 stars

This strategy detects pivot highs and lows to establish swing structure, then identifies liquidity sweeps where price breaks the wick of the most recent pivot and closes back inside it. After a one-bar delay on continuation, it fires long entries on bullish st

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe liquidity-sweep-probe-integration
106 stars

This strategy scans the price chart for a large set of classic candlestick patterns and lets the user enable or disable each pattern. It classifies setups as bullish, bearish, or both, and can require price to be above or below an SMA 50, or aligned with both

Strategy v4 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of All Candlestick Patterns Strategy

This strategy detects market regime state transitions based on pivot high and low break levels. It calculates pivot highs and lows using a specified strength setting and updates the market state when the close price breaks above the last pivot high or below th

Strategy v6 TrendBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Market Shift Probe 03 Shift Driven Entry

All in One Strategy

by hasnocool
106 stars

This strategy overlays multiple switchable trading models onto the main price chart, allowing the user to select between standard RSI crossing, Connors RSI, MACD, EMA, or Stochastic signals. Entries execute in long, short, or bidirectional modes when the selec

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of All in One Strategy

MA Envelope (MAE)

by mihakralj
99 stars

The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p

Indicator v6 Moving averagesSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MA Envelope (MAE)

Supertrend

by alboogycOdR
6 stars

This indicator calculates and plots the standard Supertrend bands directly on the price chart to determine trend direction. It computes volatility bands using either Pine's built-in RMA-based ATR or an SMA-based true range, adjusting dynamically with close pri

Indicator v4 TrendVolatility & bands
Updated 7 months ago · None stated GitHub repository of Supertrend
1 stars

This strategy maintains a market regime state based on breaks through recent pivot highs and lows. It tracks pivot levels with user-set strength and flips from neutral to bull on price closing above the last pivot high or to bear on closing below the last pivo

Strategy v6 TrendSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Market-Shift-Probe-01-Shift-State

This Pine Script strategy computes rolling highest and lowest prices over a user-set window. It draws reference levels on the price chart and issues long signals on close crossing the prior rolling low plus short signals on close crossing the prior rolling hig

Strategy v6 TrendSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe market-shift-probe-02-rolling-extreme
1 stars

This strategy plots on the price chart and measures fractal efficiency over 10, 20, and 40 bars. It multiplies those efficiencies into a connectivity score and requires a volume z-score above a threshold. A long opens when connectivity is high, the 10-bar aver

Strategy v6 TrendVolume
Updated 2 months ago · None stated GitHub repository of TnSovereignTopologicalSutureV6
106 stars

Calculates the correlation coefficient and covariance between the current crypto asset and a reference market index, such as CRYPTOCAP:TOTAL2, using higher-timeframe data. It tracks percentage price changes in rolling arrays to compute correlation alongside a

Strategy v4 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Altcoin Correlation Meter
3 stars

This indicator plots four simple moving averages of periods 5, 10, 20, and 50 on the price chart. It calculates and sends alert conditions for every pairwise crossover and crossunder between the moving averages, including MA5 cross above MA10, MA10 cross above

Indicator v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of Multi MA Crossover Alerts
1 stars

This strategy enters trades based on EMA crossovers and manages exits with tight tick-based bracket orders on the price chart. It calculates fast and slow Exponential Moving Averages, triggering long entries on bullish crossovers and short entries on bearish c

Strategy v6 Moving averagesScalping
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Scalping Tight TP SL Points
106 stars

This strategy executes long-only entries based on moving average pullbacks relative to a 504-period high. It enters when price dips between the 13 and 21 EMAs while remaining within ten percent of the recent high. The script plots green markers on new highs an

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of AMRS LongOnly PartTimer

Aphrodite

by hasnocool
106 stars

This Pine Script strategy overlays signals directly on the price chart, combining pseudo-random normal distribution calculations with price primeness detection. It sizes positions using a fixed percentage of equity and accumulates long entries with heavy pyram

Strategy v4 TrendSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Aphrodite

RedK Momentum Bars

by regalouisei
2 stars

Calculates and plots momentum bars in a separate pane using three moving averages: a fast MA, a slow MA with a delay setting, and a trend filter MA. Loosely inspired by the Elder Impulse system, it measures momentum relative to a zero filter line. Users can cu

Indicator v5 Oscillators & momentumMoving averages
Updated 8 months ago · None stated GitHub repository of RedK Momentum Bars
1 stars

This strategy combines a three-tier EMA stack, RSI momentum filtering, and channel breakout rules to generate trend-following entries on the price chart. It detects swing highs and swing lows to draw connecting trend lines across pivot points. Entries trigger

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Trendmaster Integration

This indicator calculates a staircase trailing trend line based on recent highest highs and lowest lows over a customizable lookback period. It plots a step-line directly on the price chart, changing color between green for uptrends and red for downtrends. It

Indicator v5 TrendSupport & resistance Repaints

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