Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 52)

Scripts written for Pine Script version 5. They still run in TradingView as they are, and the Pine Editor can convert them to version 6.

Pine scripts4,643
Code shown here2,378open licence
Updated in a year2,687
No repaint flag4,051

Pine Script v5: Indicators, Strategies and Libraries

US Ex-Dividend Alert

by kevinesk
1 stars

This indicator detects US stock ex-dividend dates using request.dividends() on the chart symbol. It plots purple diamonds marking past ex-dates and displays colored glows around buy windows: yellow when the window is open but quality gates fail, green when all

Indicator v5
Updated 4 months ago · None stated GitHub repository of US Ex-Dividend Alert
1 stars

This strategy plots on the price chart and stores recent closes in a float array during the first sixty bars. It enters a long position when the newest stored close is above the close ten slots earlier and the nine-period EMA crosses above the twenty-one-perio

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus Barstate Array Helpers

RSI and Z-Score Speedometer

by Focal-QuantAI
1 stars

An indicator in a separate pane that shows two gauge-style speedometers drawn with lines. The left gauge maps a 14 period RSI to a needle from 0 to 100. The right gauge converts a 20 period price z-score, clamped to a chosen limit, to the same scale. Layout in

Indicator v5 Oscillators & momentumScreeners & dashboards
Updated 6 months ago · None stated GitHub repository of RSI and Z-Score Speedometer

MA+STO+MA_V1

by gabriel-klettur
1 stars

This strategy combines Exponential Moving Averages (10, 55, and 200 EMAs) with a Stochastic Oscillator to execute trades. It enters long positions when the Stochastic K line crosses above D in oversold territory while price is above the 200 EMA. Short entries

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of MA+STO+MA_V1

EMA Ribbon

by Basant1Saini
1 stars

The EMA Ribbon strategy plots six exponential moving averages (periods 8, 13, 21, 34, 55, 89) on the price chart to form a visual ribbon. It detects trend direction using full stack alignment, partial alignment (at least 4 of 6 consecutive pairs), or fast EMA

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

A Pine v5 strategy that trades a breakout from a narrow range bar. A bar is narrow when its range is below a set fraction of the average range. Its high and low are stored and drawn as levels, and a close above the high opens a long while a close below the low

Strategy v5 BreakoutVolatility & bands
Updated 8 months ago · None stated GitHub repository of NRBOAlgo Narrow Range Breakout

SPX Gamma (DTE:55)

by Juice-zhi
1 stars

A price-chart overlay that draws a static set of options gamma levels for SPX (the S&P 500 index) expiring in about fifty-five days. The center line and the one and two standard deviation bands are hardcoded numbers from a snapshot dated 2026-02-03, produced o

Indicator v5 Support & resistance
Updated 8 months ago · None stated GitHub repository of SPX Gamma (DTE:55)

ES Alpha (Logic Fix)

by knectardev
1 stars

This strategy tracks the opening 1-minute range during regular market hours and trades the subsequent breakout on the price chart. It locks the high and low of the 09:30 to 09:31 session and plots both levels as trigger lines. A long position is taken if price

Strategy v5 BreakoutSessions & time Repaints
Updated 9 months ago · None stated GitHub repository of ES Alpha (Logic Fix)
1 stars

Target Trend is a trend-following overlay indicator that determines market direction using ATR-adjusted simple moving average bounds. It calculates upper and lower channel boundaries based on SMA calculations of high and low prices offset by a smoothed ATR val

Indicator v5 TrendSupport & resistance
Updated 9 months ago · None stated GitHub repository of Target Trend [BigBeluga]
1 stars

A chart-overlay indicator that detects pivot highs and lows and draws extended trendlines through the latest pairs, keeping only lines steeper than a minimum angle and limiting the total number. Resistance and support pivots can be labelled R and S. A table su

Indicator v5 Support & resistanceTrend
Updated 9 months ago · None stated GitHub repository of Ultimate Auto Trendlines

Wonder2

by turnupdigital
1 stars

An indicator on the price chart that builds smoothed average prices from a Heikin Ashi style open, high, low and close, then compares a smoothed close with a smoothed open. Green or red shading marks which is higher, and a buy or sell triangle appears when the

Indicator v5 Trend
Updated 1 year ago · None stated GitHub repository of Wonder2

[Z] Moving Average

by zhuzp98
1 stars

This indicator calculates and plots eight separate moving averages directly on the price chart. It provides seven Simple Moving Averages with default periods of 5, 10, 20, 30, 60, 120, and 200, alongside one 20-period Exponential Moving Average. Each moving av

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of [Z] Moving Average

Higher Close and Lower Close

by fiji-solutions
1 stars

Higher Close and Lower Close is an overlay indicator that highlights simple single-candle price action signals. It monitors whether the current bar closes above the preceding bar's high or below the preceding bar's low. When a close exceeds the previous high,

Indicator v5 Candlestick patternsBreakout
Updated 2 years ago · None stated GitHub repository of Higher Close and Lower Close

Grid Level

by JohnsonHsiao
1 stars

This indicator constructs a grid of upper and lower price levels centered around a Simple Moving Average baseline. It calculates ten upper bands and ten lower bands spaced evenly at step multipliers defined by the grid gap percentage. These bands are plotted d

Indicator v5 Support & resistanceMoving averages
Updated 3 years ago · None stated GitHub repository of Grid Level
1 stars

A separate-pane version of the Directional Movement Index. It plots the ADX line together with the plus and minus directional indicator lines, using the same Wilder style smoothing as the standard tool. The area between the plus and minus lines is filled with

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Directional Movement Index
575 stars

This multi-timeframe indicator calculates and draws key technical levels directly on the main price chart. It projects pivot points, support and resistance lines, and previous high/low boundaries across three configurable timeframes such as daily, weekly, and

Indicator v5 Support & resistance Repaints
Updated 1 year ago · MPL-2.0 GitHub repository of Magnetic Zones - Multi Timeframe
330 stars

Trend EMA + RSI is a trend-following strategy that generates trading signals using three exponential moving averages and RSI filter conditions. Long trades execute when a fast EMA crosses above a slow EMA while remaining above a long-term baseline EMA on a bul

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Trend EMA + RSI [Alorse]

Function - Forecast Linear

by ricardosantos79
261 stars

This script provides helper functions to calculate linear forecasts based on series data, mirroring standard spreadsheet forecast functionality. It converts price series into arrays over specified sample lengths and computes the predicted future value using si

Indicator v5
Updated 4 years ago · None stated GitHub repository of Function - Forecast Linear
257 stars

The ESH2023 5M strategy is a Pine Script v5 indicator for E-mini S&P 500 futures trading on the 5-minute chart. It calculates a Stochastic oscillator from Ichimoku cloud high/low averages using inputs for K period, D period, and smoothing. The script signals l

Strategy v5 Oscillators & momentumBreakout Repaints
Updated 7 weeks ago · None stated GitHub repository of ESH2023 5M - No repaint V1.1

This strategy generates trading signals on the 5-minute price chart using Williams Fractals for trend reversals, combined with EMA fast and slow trend filters and optional RSI confirmation. Long entries trigger on bullish fractals aligned with rising EMA and R

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 5min Williams Fractals Scalping (3commas)

Example 2

by be-thomas
65 stars

This indicator calculates a normalized percentage oscillator based on the distance between the closing price and a 10-period simple moving average. It displays the oscillator line alongside a dotted zero reference line in a separate indicator pane. The space b

Indicator v5 Oscillators & momentumMoving averages
Updated 6 days ago · GPL-3.0 GitHub repository of Example 2

No Repaint - MACD

by dearvn
43 stars

This indicator plots a MACD oscillator in a separate pane. It calculates the source as the average of the previous ten open prices, then subtracts a slow moving average from a fast moving average. A signal line and a histogram follow. Fast, slow, and signal le

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of No Repaint - MACD

Bollinger Bands

by TWODS-CAPITAL
37 stars

This indicator calculates and plots standard Bollinger Bands directly on the price chart. It computes a central basis line using a simple moving average of the selected price source over a user-defined period. Upper and lower bands are constructed by adding an

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · MIT GitHub repository of Bollinger Bands

Zen ATH Bands

by Zen-Tim
29 stars

Zen ATH Bands calculates the all-time high or current price of an asset and projects horizontal reference lines representing percentage pullback levels. It draws up to seven user-defined drawdown thresholds below the baseline, complete with custom price and pe

Indicator v5 Support & resistance
Updated 2 weeks ago · MIT GitHub repository of Zen ATH Bands

Stochtaker

by benso87
24 stars

Stochtaker combines a Stochastic oscillator and Bollinger Band Width Percentile (BBWP) into a single separate pane indicator. It calculates BBWP across a configurable lookback period and length, displaying volatility conditions using a dynamic color spectrum o

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · MPL-2.0 GitHub repository of Stochtaker

Divergenced H002

by ruckard
13 stars

Divergenced H002 is an automated trading strategy designed to identify divergence setups using transitions in the Squeeze Momentum Indicator combined with Curie moving average closing lines for exit conditions. It detects bearish divergence when momentum weake

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced H002

VWAP Bounce - Eterna

by EternaHybridExchange
9 stars

This strategy overlays volume-weighted average price deviation bands and an exponential moving average trend filter directly on the price chart. It enters long positions during an uptrend when price recovers above the lower band, and enters short positions in

Strategy v5 Mean reversionTrend
Updated 7 months ago · MIT GitHub repository of VWAP Bounce - Eterna

DCA Simulator

by suyons
7 stars

This strategy simulates a dollar-cost averaging investment approach directly on the price chart. It executes a long entry with a fixed cash amount on every historical bar that falls within a user-defined date window. All accumulated open positions are closed s

Strategy v5
Updated 4 months ago · None stated GitHub repository of DCA Simulator
7 stars

This strategy executes breakout trades based on price channels and moving average trend alignment. It enters long positions when the closing price breaks above its 20-period high while trading above a 130-period simple moving average. Short positions enter whe

Strategy v5 BreakoutTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Weekly Break out Strategy
6 stars

Calculates and plots support and resistance zones based on candle wick rejections and liquidity sweeps directly on the price chart. The indicator scans historical price action using a configurable lookback period and wick threshold percentage, merging close le

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of Wick Rejection S/R Strategy

Mean Price

by gorx1
5 stars

Mean Price is an indicator that calculates a custom weighted average price for each bar using open, high, low, and close values. The calculation dynamically adjusts its weighting depending on whether the bar closes higher, lower, or equal to its open price. An

Indicator v5 Moving averages
Updated 8 months ago · None stated GitHub repository of Mean Price

Bollinger Squeeze STEPFUN

by eltonaguiar
4 stars

This strategy detects Bollinger Band squeezes by measuring band width against a threshold. It waits for a confirmed breakout in either direction when bands expand, using optional volume confirmation. Long and short signals trigger on breakout after squeeze. Po

Strategy v5 Volatility & bandsBreakout
Updated 2 days ago · None stated GitHub repository of Bollinger Squeeze STEPFUN

Noob's MTF EMA Clouds

by InNoobWeTrust
4 stars

Noob's MTF EMA Clouds computes and overlays multi-timeframe Exponential Moving Average (EMA) pairs across up to five user-selected timeframes directly on the price chart. It calculates fast and slow EMAs to render shaded clouds that visualize trend direction a

Indicator v5 Moving averagesTrend
Updated 2 days ago · None stated GitHub repository of Noob's MTF EMA Clouds
4 stars

This strategy executes mean-reversion trades based on RSI overbought and oversold levels directly on the price chart. It generates long signals when the RSI crosses back above the oversold boundary and short signals when it crosses below the overbought boundar

Strategy v5 Mean reversionOscillators & momentum
Updated 11 months ago · Custom licence GitHub repository of RSI Mean Reversion Strategy [Lab]

Snagprofit WMA MA

by dearvn
4 stars

Snagprofit WMA MA calculates and plots weighted moving averages across multiple timeframes (1-minute, 5-minute, 15-minute, and 1-hour) alongside a chart-period simple moving average. It evaluates directional alignment between these moving averages and checks f

Indicator v5 Moving averagesTrend Repaints
Updated 4 years ago · None stated GitHub repository of Snagprofit WMA MA

P-Erik Tarama

by gocaman
3 stars

P-Erik Tarama is a multi-symbol scanner indicator that displays technical screening results directly on the price chart. It evaluates assets against a composite bullish condition combining price position relative to the Ichimoku conversion line and weekly base

Indicator v5 Screeners & dashboardsTrend
Updated 2 days ago · None stated GitHub repository of P-Erik Tarama

Jash Test

by jash-git
3 stars

This indicator plots five Fibonacci-based exponential moving averages with periods 3, 13, 34, 55, and 144 directly on the price chart. Built around modified Guppy Multiple Moving Average (GMMA) concepts and Granville's rules, it tracks moving average alignment

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of Jash Test

Candles In a Row

by g-moe
3 stars

This indicator tracks consecutive bullish and bearish candles on the main price chart. It counts consecutive closes relative to opens and plots a green triangle below the bar or a red triangle above the bar once a streak reaches the chosen target length on a c

Indicator v5 Candlestick patterns
Updated 5 months ago · None stated GitHub repository of Candles In a Row
3 stars

This indicator calculates volume-weighted price movement over a set period and normalizes it using standard deviation. It offers optional Hull Moving Average (HMA) smoothing and measures order flow velocity through customizable moving averages. Displayed in a

Indicator v5 VolumeOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Standardized Orderflow [AlgoAlpha]

BTMM-Sessions

by jcortes254
3 stars

BTMM Session Analysis is an indicator that draws session background boxes on the price chart for Asian, London and NY sessions. It tracks Asian session range with midpoint, extension and statistics display. The script detects liquidity sweep levels, stop hunts

Indicator v5 Sessions & timeSupport & resistance
Updated 1 year ago · None stated GitHub repository of BTMM-Sessions

A Pine Script library providing helper functions to evaluate local trend conditions across a user-defined lookback period. It exports functions that check if the current candle's low price is strictly higher or lower than all preceding lows within the specifie

Library v5
Updated 2 years ago · None stated GitHub repository of Uptrend Downtrend Loopback Candle Identification Lib
3 stars

Short Term Alpha Indicator calculates a weighted alpha from price change multiplied by volume, then derives EMAs at fast, medium, and slow lengths. It computes ROC values for the EMAs and applies percentile rank functions to identify deviations. These deviatio

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Short Term Alpha Indicator

Super 8 - 30m BTCUSDT.P

by wynnforthework
2 stars

Super 8 is a trend-following and momentum strategy designed for 30-minute cryptocurrency charts. It evaluates entries using dual EMAs, ADX strength filtering, Parabolic SAR direction, MACD or Z-VWAP calculations, and Bollinger Band width expansion alongside vo

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Super 8 - 30m BTCUSDT.P

SessionInfo

by Electrified-Trading
2 stars

SessionInfo is a Pine Script utility library providing functions for session-specific state tracking and calculations. It exports routines to determine whether the current intraday bar falls within a specified session, before the session begins, or after it co

Library v5 Sessions & time
Updated 1 year ago · MPL-2.0 GitHub repository of SessionInfo

Pinbar Strategy

by Web3Degenerate
2 stars

Pinbar Strategy identifies pinbar candlestick patterns (hammers and shooting stars) via the imported ZenLibrary and trades reversals or continuations on confirmed bars. Entries are filtered by an optional exponential moving average and candle range thresholds

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · None stated GitHub repository of Pinbar Strategy

HTF Candles & Pivots

by itmakesyousick
2 stars

Plots higher-timeframe candle overlays and pivot point levels directly onto the main price chart. It renders higher-timeframe open, high, low, and close levels as custom boxes with optional wicks, alongside traditional pivot points, support and resistance leve

Indicator v5 Support & resistanceCandlestick patterns
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

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