Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 48)

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

Normalized Advanced Decomposition Oscillator decomposes price action into three distinct components: a trend component based on a simple moving average, a noise component based on standard deviation, and a transient component derived from significant rate-of-c

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Normalized Advanced Decomposition Oscillator

Currency Strength Chart

by itmakesyousick
3 stars

Currency Strength Chart plots the relative strength of selected major currencies on a separate pane. Users choose currencies to display along with their colors and line widths. The script calculates strength based on price, RSI, CCI, or Stochastics with adjust

Indicator v5 Oscillators & momentumSupport & resistance
Updated 4 years ago · None stated GitHub repository of Currency Strength Chart

NEODCA

by wynnforthework
2 stars

NEODCA is a Dollar Cost Averaging (DCA) strategy that combines MACD oscillators with volume-weighted moving average (VWMA) filters to execute trades. It supports long and short modes, placing base orders followed by up to eight safety orders scaled by multipli

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of NEODCA

Position Sizes

by etnt
2 stars

Position Sizes is an overlay indicator that calculates risk-managed trade sizing based on account size and risk percentage parameters. It calculates position values, required share quantities, stop-loss levels, and 1R take-profit targets across four customizab

Indicator v5 Screeners & dashboardsVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Position Sizes

Momentum

by Electrified-Trading
2 stars

This Pine Script library calculates various momentum metrics and oscillator values for other scripts to use. It provides functions for standard-deviation-normalized price change, dual-moving-average momentum, Stochastic RSI, and a customizable MACD. Function p

Library v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum

Monthly Performance Table

by Web3Degenerate
2 stars

This strategy combines an example trend pullback trading model with a modular monthly performance table displayed directly on the price chart. It buys when price is above a long-term moving average but below a short-term moving average, and exits when price cl

Strategy v5 Screeners & dashboardsMoving averages
Updated 2 years ago · None stated GitHub repository of Monthly Performance Table

HTF Candles & Pivots

by itmakesyousick
2 stars

HTF Candles & Pivots overlays higher-timeframe candlestick bars, pivot points, and price structure directly onto the main price chart. It renders customizable higher-timeframe candle bodies, wicks, and time division separators while calculating classic pivot l

Indicator v5 Candlestick patternsSupport & resistance
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

HMM V2 Regime

by rellis3
1 stars

Classifies the market into bull, bear, range and chop regimes with a hidden Markov style model in a separate pane. Three standardised inputs, trend, volatility and ADX, are scored against configurable regime means and variances that can be pasted from an exter

Indicator v5 TrendAI / machine learning
Updated 2 days ago · None stated GitHub repository of HMM V2 Regime
1 stars

This strategy trades based on calculated astronomical lunar phases. It computes the current lunar day using a fixed 29.53-day cycle from a reference timestamp to identify full moon and new moon events. Full moons trigger long entries, while new moons trigger s

Strategy v5 Sessions & time
Updated 8 days ago · None stated GitHub repository of Moon Phases Long/Short Strategy

SCDTM Strategy

by GreyssonEnterprises
1 stars

A strategy built on a multi-step checklist. It compares 9 and 18 EMA alignment across daily, 4-hour and 1-hour data, then combines Bollinger Band %B and Stochastic RSI conditions with fractal breakout levels. Stops sit at the fractal, take profit is set by a r

Strategy v5 TrendOscillators & momentum Repaints
Updated 3 months ago · MIT GitHub repository of SCDTM Strategy

Range Detector

by tthanhvu002sgu
1 stars

Finds sideways ranges on the price chart and draws them as boxes. A range is flagged when every close over the minimum length stays within an ATR-based band around a simple moving average. The box, a dotted midline and top and bottom plot lines extend while th

Indicator v5 Support & resistanceBreakout
Updated 3 months ago · None stated GitHub repository of Range Detector

NY Anchor Range FVG Breakout

by riegodavid-git
1 stars

An overlay indicator that marks an anchor range during a configurable morning session, by default 09:00 to 10:00 New York time. It detects a breakout from that range, sets a bullish or bearish bias, and finds fair value gaps in the breakout leg. It then tracks

Indicator v5 SMC / ICT / price actionBreakout
Updated 4 months ago · None stated GitHub repository of NY Anchor Range FVG Breakout

REQ TEST

by kevinesk
1 stars

REQ TEST is a minimal diagnostic utility indicator that tests external symbol data accessibility using security requests. It fetches daily closing price data for specified US market tickers including major index ETFs and market indicators such as SPY, QQQ, XLK

Indicator v5 Screeners & dashboards
Updated 4 months ago · None stated GitHub repository of REQ TEST
1 stars

Composite Price Stats is a trend-following overlay strategy that evaluates statistical metrics on price components. It calculates cumulative true range, variance, deviation, and ADX on hlc3 price data, while plotting an averaged price series. Long entries trig

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Composite Price Stats

Talons Volume Surge (Memecoin)

by muammeryldrm42
1 stars

A long-only strategy for fast-moving small-cap crypto charts. It enters when volume is a set multiple of its recent average, the bar gains more than a minimum percentage, the candle is green and the move over the last twelve bars is not above a too-late limit.

Strategy v5 VolumeBreakout
Updated 5 months ago · None stated GitHub repository of Talons Volume Surge (Memecoin)
1 stars

This Pine Script strategy combines bullish and bearish engulfing candlestick patterns detected on the price chart with a stochastic oscillator for entry signals. The stochastic is calculated using inputs for K period, D period, and smoothing. Long entries trig

Strategy v5 Candlestick patternsOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Engulfing and Stochastic Strategy

VWAP Bounce & Cross

by Basant1Saini
1 stars

This strategy trades intraday price interactions with the Volume Weighted Average Price (VWAP). It offers bounce and crossover entry modes, filtered by an Exponential Moving Average trend filter and a customizable trading session window. Stop loss levels are c

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of VWAP Bounce & Cross

IBOB Inside Bar Outside Bar

by Tradehook-org
1 stars

A Pine v5 strategy that trades an outside bar after one or more inside bars. An inside bar has a lower high and higher low than the bar before it, and an outside bar exceeds both. After the chosen number of consecutive inside bars, an outside bar closing up op

Strategy v5 Candlestick patternsBreakout
Updated 8 months ago · None stated GitHub repository of IBOB Inside Bar Outside Bar

SPX Gamma (7DTE)

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 seven days. The center line and the one and two standard deviation bands are hardcoded numbers from a snapshot dated 2026-02-04, produced offline from

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

An overlay indicator that draws the current candle range of several higher timeframes on the lower-timeframe chart. Seven timeframes can be switched on or off: 30 minutes, 1 hour, 2 hours, 4 hours, daily, weekly and monthly. Each gets its own colour, and an op

Indicator v5 Support & resistance
Updated 9 months ago · None stated GitHub repository of Multi-Timeframe Intrabar

A chart-overlay indicator that detects pivot-based swings and marks break of structure and change of character events. It measures the percentage size of each move that follows and sorts it into four levels with adjustable minimum and maximum percentages. Labe

Indicator v5 SMC / ICT / price actionSessions & time
Updated 9 months ago · None stated GitHub repository of BOS/CHoCH Impulsive Move Detector

TD RSI Strategy

by zhuzp98
1 stars

This strategy combines a TD Sequential close comparison, RSI with a moving-average Bollinger envelope, MACD, and the Stochastic Momentum Index. It allows long, short, or both directions and sizes orders from a percentage of equity. Inputs set RSI and MACD leng

Strategy v5 Oscillators & momentumBreakout
Updated 1 year ago · None stated GitHub repository of TD RSI Strategy

Hello World

by fiji-solutions
1 stars

This educational indicator illustrates how variable persistence functions across historical and real-time bars. It maintains three counters: a standard bar counter using the var keyword, a tick counter using varip that increments on every intrabar update witho

Indicator v5 Repaints
Updated 2 years ago · None stated GitHub repository of Hello World

DTX

by JohnsonHsiao
1 stars

Calculates two TRIX (Triple Exponential Average) lines based on logarithmic close prices over different lookback periods. The fast TRIX uses a primary period length, while the slow TRIX adds an offset factor to determine its longer period length. Both TRIX lin

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of DTX

Trend SNEK

by rajatjpatel
1 stars

A price chart overlay that plots the highest high and lowest low of the previous set number of bars, ten by default, together with a midline between them. The area between the bands is shaded green when the current bar's high breaks above the prior upper line

Indicator v5 BreakoutSupport & resistance
Updated 4 years ago · None stated GitHub repository of Trend SNEK
947 stars

This script provides a developer testing framework for Pine Script v5 that executes custom test suites and assertions. It logs test specifications, skips marked tests, and evaluates array equality across data types. The tool renders a visual test reporter dire

Indicator v5
Updated 12 days ago · GPL-3.0 GitHub repository of Unit Testing Framework
575 stars

This overlay indicator screens a pasted list of symbols for ICT market structure shifts, or for retracements toward an optimal trade entry or order block. It uses a zig zag built from highs and lows or opens and closes, then lists matching bullish and bearish

Indicator v5 SMC / ICT / price actionScreeners & dashboards
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Market Structure Shift (MSS) Screener

Strategy Tester

by Alorse
330 stars

Strategy Tester is an overlay trading strategy that combines linear regression momentum, Directional Movement Index (DMI), and Average True Range (ATR) volatility levels. It seeks long entry setups when pivot highs form on the custom momentum oscillator while

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Strategy Tester

DebugConsole

by ricardosantos79
261 stars

DebugConsole is a Pine Script v5 library that stores debug text in a fixed-length string array and shows it in a single chart table cell. init creates a bottom-left table and an empty line buffer whose size defaults to 20. queue drops the oldest line and appen

Library v5
Updated 4 years ago · None stated GitHub repository of DebugConsole
257 stars

This strategy overlays a volume-weighted moving average of open prices and standard-deviation bands on the ES futures chart, aimed at the one-minute timeframe. It requests open and low from several higher timeframes with lookahead enabled. Percentage inputs se

Strategy v5 Volatility & bandsMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of ES - Futures 1M No repaint

STRG-HOLP

by harryguiacorn
220 stars

STRG-HOLP is a trading strategy that identifies High of Low Period (HOLP) and Low of High Period (LOHP) breakout setups. It tracks the lowest low or highest high over a user-defined lookback window. A long trade opens when the close breaks above the high of th

Strategy v5 BreakoutSupport & resistance
Updated 1 year ago · None stated GitHub repository of STRG-HOLP
106 stars

This strategy plots 50-, 100- and 200-period simple moving averages on the price chart. After a user-chosen start date, it enters a long position when the 50-period average crosses above the 100-period average, using 100 percent of equity. A short order is cod

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 50/100/200 Moving Average Strategy

Dual-color bars

by be-thomas
65 stars

This indicator draws a separate OHLC bar series in its own pane using plotbar. Each bar is colored lime when the close is greater than or equal to the open, and red when the close is below the open. It has no user inputs, no signals, and no entry, exit, stop,

Indicator v5 Candlestick patterns
Updated 6 days ago · GPL-3.0 GitHub repository of Dual-color bars

Supply Demand

by iamc1oud
56 stars

This overlay indicator maps market structure and draws supply and demand zones on the price chart. It marks swing points, optional structure mapping, sweep marks, and bubbles, and can color candles from its trend detection. It plots the last selected order blo

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of Supply Demand
43 stars

Donald - AI Futures is a price-chart strategy that estimates inner and outer high-low zones and a smoothed close with rational quadratic kernel regression. It builds bullish and bearish momentum signals, optionally compares volume with a volume-weighted moving

Strategy v5 Oscillators & momentumSMC / ICT / price action Repaints
Updated 2 years ago · None stated GitHub repository of Donald - AI Futures

Awesome Oscillator

by TWODS-CAPITAL
37 stars

This indicator plots the Awesome Oscillator in a separate pane. It subtracts a 34-period simple moving average of the high-low midpoint from a 5-period simple moving average of the same midpoint. Rising bars are drawn as teal columns and falling bars as red co

Indicator v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Awesome Oscillator
26 stars

This indicator identifies and plots bullish and bearish Fair Value Gaps (FVG) directly on the price chart. It detects three-bar imbalances where gaps occur between the high of the first candle and the low of the third candle, or vice versa. The tool includes a

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · AGPL-3.0 GitHub repository of Fair Value Gap (FVG)

KC15

by benso87
24 stars

KC15 is a price-chart strategy that configures two moving averages, a Bollinger Band Width Percentile filter, and PMARP entry and exit thresholds for long and short trades. Users can switch each average between SMA and EMA, set lengths and colors, and toggle l

Strategy v5 Moving averagesVolatility & bands
Updated 4 years ago · MPL-2.0 GitHub repository of KC15

Trailing Drawdown

by palitojendthen
20 stars

The Trailing Drawdown indicator calculates and visualizes the percentage drop of a price series from its peak over a user-specified lookback period. It tracks maximum price levels within a rolling window and measures the current deviation from those peaks. Tra

Indicator v5 Volatility & bandsSupport & resistance
Updated 1 year ago · None stated GitHub repository of Trailing Drawdown

Divergenced E005

by ruckard
13 stars

Strategy identifying market entries based on Squeeze Momentum Indicator divergence patterns and exiting via Curie Closing Lines moving averages. It evaluates color transitions in the squeeze momentum histogram against price movements to detect divergence condi

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Divergenced E005

Stochastic RSI Crossover - Eterna MCP

by EternaHybridExchange
9 stars

This strategy plots a Stochastic RSI oscillator in a separate pane. It computes RSI of close, then a stochastic of that RSI, and smooths the result into K and D lines. It enters long when K crosses above D below the oversold level and short when K crosses belo

Strategy v5 Oscillators & momentum
Updated 7 months ago · MIT GitHub repository of Stochastic RSI Crossover - Eterna MCP

Wyckoff Phase

by muammeryldrm42
7 stars

This strategy identifies Wyckoff consolidation ranges directly on the price chart to trade potential spring and upthrust events. It calculates highest highs and lowest lows over a customizable lookback period, filtering setups by average volume spikes and ATR

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of Wyckoff Phase

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