Pine Library · 3,870 open-source scripts

Free Trend Pine Scripts (page 77)

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 overlay strategy builds two moving averages from a selectable EMA, WMA, or SMA and plots the faster one on the price chart. A buy signal is a crossover of the fast average above the slow average, and a sell signal is the opposite cross. It colors the aver

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Arch1tect's New Toy (Strategy Tester Version)
1 stars

PF Probe Trendmaster Trend Line Projection is a Pine Script strategy designed to evaluate trend line projections and slope math. It identifies swing pivot highs and lows using a configurable pivot strength setting and draws trend lines directly on the price ch

Strategy v6 TrendSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Trendmaster Trend Line Projection
106 stars

This strategy calculates the Aroon Oscillator along with the Relative Strength Index (RSI) to generate long trading signals. It opens an initial long position when the Aroon Oscillator crosses above the zero line, and pyramids into the position if price dips b

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Aroon Oscillator Strategy
1 stars

This strategy tracks a three-tier exponential moving average (EMA) stack to identify trend alignment regimes. It defines a bullish state when fast EMA is above mid and mid is above slow, and a bearish state when inverted. Orders execute strictly on state trans

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe trendmaster-probe-02-multi-tier-ma
106 stars

The Aroon Strategy Long Only is a trend-following strategy that combines the Aroon indicator with a Least Squares Moving Average filter. It enters long positions when the Aroon Up line crosses above the Aroon Down line while the closing price trades above the

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Aroon Strategy Long Only
2 stars

Calculates buying and selling pressure by evaluating high and low movements relative to a two-bar price range. Bull and bear pressures are averaged using weighted moving averages with optional pre-smoothing, and net pressure is derived through an additional sm

Indicator v5 Oscillators & momentumTrend
Updated 8 months ago · None stated GitHub repository of RedK Trader Pressure Index (TPX)
1 stars

This strategy detects long and short signals using a fast EMA crossing above or below a slow EMA. Entries only trigger when a recent pivot exists for anchoring. Long entries place a stop loss at the last pivot low and a take profit at 2R distance using the ent

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe trendmaster-probe-03-pivot-tp-sl

This overlay indicator plots automatic Midas-style anchored VWAPs on the price chart. It finds the bars of the highest high and lowest low inside a user-set length, then builds volume-weighted averages of high or low and of the HLC3 midpoint back to those bars

Indicator v5 VolumeTrend
Updated 5 months ago · None stated GitHub repository of Nubia - Auto Midas Anchored VWAP [xdecow]

RedK Volume-Accelerated Directional Energy Ratio (VADER) measures directional momentum accelerated by volume activity. It calculates price change relative to the average bar range, limits the ratio, and scales it using relative, raw, or static volume weighting

Indicator v5 VolumeOscillators & momentum
Updated 8 months ago · None stated GitHub repository of RedK Volume-Accelerated Directional Energy Ratio

This strategy evaluates a triple-confluence entry gate combining trend, momentum, and structure filters on the price chart. It enters long when a fast exponential moving average is above a slow exponential moving average, RSI exceeds a defined threshold, and t

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Trendmaster-Probe-04 Trend Entry Gate

Opening Range

by g-moe
3 stars

The Opening Range indicator combines multiple technical analysis tools onto the main price chart. It calculates MACD momentum sequences alongside Stochastic oscillator limits to generate buy and sell triangle shapes. Additionally, it evaluates trend alignment

Indicator v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Opening Range

PF probe wunder-scalper-probe-02-alert-message-templates is a strategy that generates long and short signals using a fast EMA of 5 crossing above a slow EMA of 13 on the price chart. It places fixed-size entries of 1 share on each crossover signal and emits al

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe wunder-scalper-probe-02-alert-message-templates

ZZC Market Structure Sovereign v6 is a trend-following strategy that combines directional pivot tracking with Keltner-style volatility corridors. It calculates pivot highs and lows alongside an EMA baseline bounded by ATR corridors. A long entry is triggered w

Strategy v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of ZZC Market Structure Sovereign v6

This strategy implements a custom Parabolic SAR algorithm modified with Average True Range (ATR) to measure volatility steps. It calculates the SAR line, acceleration factors, and extreme points directly on the price chart. When a trend reversal occurs and per

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR Parabolic SAR Strategy [QuantNomad]

Opening Range

by g-moe
3 stars

This indicator overlays a Directional Sentiment Line ribbon on the price chart using moving averages of high, low, open, and close prices. It combines higher-timeframe MACD and RSI filters with standard deviation volume heatmap thresholds to assess directional

Indicator v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Opening Range

Renko Candles Overlay

by regalouisei
2 stars

This indicator calculates and displays a Renko brick overlay directly on the main price chart. It supports multiple brick size calculation methods, including traditional fixed values, percentage-based sizing, and ATR-derived variations (ATR, ATR/2, and ATR/4).

Indicator v5 TrendCandlestick patterns
Updated 8 months ago · None stated GitHub repository of Renko Candles Overlay
1 stars

Calculates fast and slow Exponential Moving Averages (EMAs) to identify trend shifts on the price chart. When the fast EMA crosses above the slow EMA, any open short position is closed before opening a long trade. When the fast EMA crosses below, any open long

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Wunder-Scalper-Probe-Integration
106 stars

This strategy calculates fast and slow average true range trailing stops directly on the price chart. It enters long positions when the fast trailing stop crosses above the slow trailing stop, and enters short positions when it crosses below. It paints price b

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR Trailing Stop Strategy by ceyhun
1 stars

This strategy serves as a validation probe to test default order execution timing where orders are processed on the open of the following bar. It implements a simple long-only system using a 9-period and 21-period exponential moving average crossover filtered

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF process-orders 01 - on_close=false
106 stars

This strategy plots an ATR trailing stop on the price chart. It builds the stop from the highest value of high minus a multiple of ATR over a lookback window, and colors bars green, red, or black relative to that line. It enters long when close crosses above t

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR Trailing Stoploss Strategy
1 stars

This Pine Script strategy evaluates fast and slow exponential moving average crossovers gated by an RSI boundary to enter long positions. It utilizes fixed cash position sizing and permits up to three pyramided entries, converting cash to fractional contract a

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF Pyramid Carry 02 - Cash Fractional

Parabolic SAR

by g-moe
3 stars

Parabolic SAR is a price-chart strategy that reads Commodity Channel Index and Parabolic SAR values from four user-selected timeframes. It opens a long when every timeframe’s CCI is above the entry level and price is below every SAR, and it closes that long wh

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Parabolic SAR

Atrend by OTS

by hasnocool
106 stars

Atrend by OTS combines MACD histogram crossovers, RSI threshold crosses, and an ATR-based trailing trend indicator on the main price chart. The strategy triggers long entries when the MACD signal delta crosses above zero or when RSI crosses above the oversold

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Atrend by OTS

Parabolic SAR

by g-moe
3 stars

This strategy overlays a smoothed moving average on price and combines it with Aroon, Chaikin Money Flow and a Chaikin oscillator to define long and short conditions. Relative Vigor Index and Parabolic SAR values are calculated for exits. Entries can be limite

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Parabolic SAR
1 stars

This Pine Script strategy calculates the accumulation/distribution line with ta.accdist and its 21-period EMA. It plots these in a separate pane. The strategy issues long entries on ta.crossover of the accumulation/distribution line above its EMA and short ent

Strategy v6 VolumeMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - accdist EMA(21) cross

3Commas Bot

by regalouisei
2 stars

This strategy draws two moving averages on the price chart and uses their bias to open long or short trades. It places the stop beyond a swing high or low using an ATR risk multiple, then sets a limit exit from the reward-to-risk ratio. An optional ATR trail c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of 3Commas Bot
1 stars

This indicator plots the original simple moving average, a symmetric moving average calculated from the highest and lowest moving averages over the window length, and a dynamic midline. It generates buy signals when the deviation from the symmetric moving aver

Indicator v5 Moving averagesTrend
Updated 7 weeks ago · None stated GitHub repository of Symmetric MA Reversal Signals

An automated trend-following investment strategy designed for Bitcoin. It compares two customizable trend lines (such as TEMA, LSMA, EMA, or SMA) to detect crossovers and filters entries using an ATR-based trailing stop channel. Positions are exited when the p

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Automated Bitcoin (BTC) Investment Strategy

Pivot Trendlines

by g-moe
3 stars

Pivot Trendlines marks confirmed pivot highs and pivot lows on the price chart and tracks small pivot highs and lows from consecutive red or green candles. It plots the count of green bars since the last pivot low and red bars since the last pivot high, and it

Indicator v5 Support & resistanceTrend
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines

Pivot Trendlines

by g-moe
3 stars

This strategy overlays two SMA lines with a cloud fill to show trend direction. It detects band reversals with Bollinger Bands and uses RSI for mean-reversion signals. Long entries trigger when the trend is bullish, price touches the lower band, and RSI is bel

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines

This strategy implements the B-Xtrender indicator, calculating short-term and long-term momentum oscillators using RSI applied to moving average spreads and smoothings. It plots the momentum oscillators as colored histograms in a separate pane. Trades are filt

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of B-Xtrender [Backtest Edition] @QuantTherapy
99 stars

This indicator calculates and plots the Minus Directional Indicator (-DI) in a separate pane to measure downward price movement. It computes negative directional movement and true range using Wilder's smoothing with warmup compensation, ensuring stable values

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Minus Directional Indicator (-DI)

Zig Zag

by be-thomas
65 stars

Calculates and plots a ZigZag indicator directly on the price chart to highlight significant high and low pivot points. The script identifies local pivot highs and lows using a custom loop mechanism based on the depth setting, then connects them with drawing l

Indicator v4 TrendSupport & resistance Repaints
Updated 5 days ago · GPL-3.0 GitHub repository of Zig Zag

Pivot Trendlines

by g-moe
3 stars

Pivot Trendlines is an indicator that plots horizontal support and resistance lines along with trendline support and resistance based on swing pivots of customizable lengths. Three separate groups allow adjustment of pivot length to draw multiple horizontal li

Indicator v5 Support & resistanceTrend
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines

Andean Oscillator

by regalouisei
2 stars

The Andean Oscillator measures trend strength by calculating distinct bullish and bearish components using modified exponential envelopes applied to open and close prices. It computes variance-like metrics to estimate directional volatility and tracks momentum

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Andean Oscillator
106 stars

Backtest Custom HiLo Strategy overlays a high-low trailing line on the price chart calculated from moving averages of highs and lows. It establishes upper and lower bounds using simple or exponential moving averages along with optional period extremes. Signal

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Backtest Custom HiLo Strategy
99 stars

Calculates and plots the Minus Directional Movement (-DM) component of J. Welles Wilder's directional movement system. It measures downward price momentum by comparing the current low to the previous low and applying Wilder's RMA smoothing with warmup compensa

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Minus Directional Movement (-DM)

Pivot Trendlines

by g-moe
3 stars

The Pivot Trendlines indicator identifies swing highs and lows on the chart to form support and resistance levels. It plots these levels as markers and draws trendlines connecting them. Buy and sell signals activate when the price breaks beyond a set percentag

Indicator v5 Support & resistanceBreakout
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines

Pivot Trendlines

by g-moe
3 stars

This indicator plots supply and demand zones along with pivot-based trendlines on the price chart. It detects swing highs and lows to form trendlines and overlays three customizable zones with adjustable lengths and timeframes for multi-timeframe analysis. Mai

Indicator v5 Support & resistanceTrend Repaints
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines

Modular Filter (MODF)

by mihakralj
99 stars

Modular Filter (MODF) calculates and plots an adaptive dual-path smoothing filter on the main price chart. Based on work by alexgrover, it computes upper and lower EMA bands that snap to price extremes and maintain a bullish or bearish state. The beta paramete

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Modular Filter (MODF)

Pivot Trendlines

by g-moe
3 stars

The Pivot Trendlines strategy identifies swing pivots on the price chart using a configurable swing lookback period and draws trendlines connecting these pivots. It generates buy and sell signals based on three-move patterns with user-defined move sizes, filte

Strategy v5 TrendBreakout
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines
1 stars

Symmetric Price with MA calculates centered and mirrored price values using moving average midpoints and user-defined slope projections. It allows users to set a time anchor and slope angle to dynamically offset price data, optionally applying Golden Ratio mul

Indicator v5 Moving averagesTrend
Updated 7 weeks ago · None stated GitHub repository of Symmetric Price with MA

Pivot Trendlines

by g-moe
3 stars

The Pivot Trendlines indicator detects swing pivot highs and lows on the price chart using a user-defined pivot length. It identifies small pivots when they occur and large pivots when price breaks through the recent opposite small pivot. Labels for small pivo

Indicator v5 Support & resistanceSMC / ICT / price action Repaints
Updated 5 months ago · None stated GitHub repository of Pivot Trendlines
1 stars

This strategy tests the 55-period Hull Moving Average (HMA) calculation. It enters a long position when the closing price crosses above the HMA(55) line and enters a short position when the closing price crosses below it. The script operates directly on the pr

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Isolate 04 - Close x HMA(55)

BarUpDn Strategy

by hasnocool
106 stars

The BarUpDn Strategy triggers trades based on candle price direction relative to a past bar. It enters a long position with a stop order above the high when the current candle closes above its open and its open is higher than the close of a specified lookback

Strategy v4 Candlestick patternsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BarUpDn Strategy

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