Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 74)

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

1 stars

This indicator combines three dominant cycle lengths, pivot highs and lows, and candlestick pattern matching to project future turning prices and dates. Bollinger Band, Keltner Channel and volatility lengths are also available as inputs. Projected values appea

Indicator v5 Support & resistance Repaints
Updated 6 months ago · None stated GitHub repository of Price and Date Forecast V5

Probability

by ricardosantos79
261 stars

Probability is a Pine Script v5 library of functions for probability calculations. It multiplies two matrices stored as flat float arrays and raises a square matrix to a power, using helpers intended for Markov-chain state probabilities. It depends on imported

Library v5
Updated 4 years ago · None stated GitHub repository of Probability

BB Strategy tooba

by hasnocool
106 stars

This strategy executes trades based on Bollinger Band crossovers on the price chart. It calculates a simple moving average basis along with standard deviation bands. When the closing price crosses above the lower band, it places a long stop order, and when pri

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BB Strategy tooba

ATR Breakout

by TamaraKGreen
46 stars

This indicator plots the 100-bar percent rank of ATR in a separate pane and draws a midline at 50. It colors that midline green, red, or gray by comparing the close with the open a set number of bars earlier against a multiple of ATR across a lookback window.

Indicator v5 Volatility & bandsBreakout
Updated 8 weeks ago · None stated GitHub repository of ATR Breakout

InSide Bar Strategy

by TWODS-CAPITAL
37 stars

This strategy detects an inside bar when the current high is below the previous high and the current low is above the previous low. It enters long when that bar's close is above its open and short when the close is below its open. Signals are placed on the pri

Strategy v5 Candlestick patterns Repaints
Updated 3 years ago · MIT GitHub repository of InSide Bar Strategy
13 stars

This strategy automates the TradingLatino methodology by evaluating Squeeze Momentum combined with the Average Directional Index (ADX). It executes long or short positions based on momentum shifts and directional strength. Risk management options include const

Strategy v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Ruckard Lupown TradingLatino A002

CRT State Engine

by alboogycOdR
6 stars

This overlay indicator tracks CRT models at 1:00, 5:00 and 9:00 and a session state machine covering CBDR, Asia, London, London lunch and the New York open. It analyzes draw-on-liquidity pivots, market structure, liquidity pools, volume profile and multi-pair

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT State Engine

GARY - Patterns

by g-moe
3 stars

GARY - Patterns is a multi-horizon chart pattern detection indicator that identifies wedge and triangle patterns across short-term, medium-term, and long-term lookback periods. It evaluates swing high and low pivot points using customizable lookback spans and

Indicator v5 Support & resistanceTrend
Updated 5 months ago · None stated GitHub repository of GARY - Patterns

ORB Indicator

by rosijay17-cmd
1 stars

An overlay indicator that records the high and low of a chosen opening session, by default five minutes starting at 09:15, and plots them as circles after the session ends. It prints a B label when price crosses above the range high and an S label when it cros

Indicator v5 BreakoutSessions & time
Updated 8 days ago · GPL-3.0 GitHub repository of ORB Indicator
1 stars

This indicator combines three dominant cycle lengths, pivot highs and lows, and candlestick pattern matching to project future turning prices and dates. Bollinger Band, Keltner Channel and volatility lengths are also available as inputs. Projected values appea

Indicator v5 Support & resistance Repaints
Updated 6 months ago · None stated GitHub repository of Price and Date Forecast V5.1
261 stars

SeasonalDecompositionByMovingAverage is a Pine Script v5 library designed to compute seasonal decomposition elements from array data. Its exported function, seasonal_mean, calculates the mean value for each period within a specified seasonal frequency cycle. I

Library v5
Updated 4 years ago · None stated GitHub repository of SeasonalDecompositionByMovingAverage

BB%B Strat

by hasnocool
106 stars

This strategy trades mean-reversion setups using the Bollinger Bands Percent Bandwidth (%B) oscillator plotted in a separate pane. It calculates upper and lower bands using a simple moving average and standard deviation multiplier. Long positions are entered w

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BB%B Strat

Inverted Hammer - Bullish

by TWODS-CAPITAL
37 stars

Detects bullish inverted hammer candlestick patterns directly on the price chart. It identifies candles with a small real body in the lower half of the range, an upper shadow at least twice the body length, and a minimal lower shadow occurring in a downtrend.

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Inverted Hammer - Bullish
13 stars

This strategy calculates the Volume Zone Oscillator (VZO) alongside volume spikes to detect directional momentum. It enters long positions when the VZO turns bullish accompanied by a volume spike, and enters short when the VZO turns bearish with elevated volum

Strategy v5 VolumeOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Neobutane VZO bA002

CRT State Engine

by alboogycOdR
6 stars

This overlay indicator runs a CRT state engine on the price chart. It can analyze draw-on-liquidity pivots, a session state machine, and optional 1AM, 5AM, and 9AM CRT models. Optional modules track market structure, liquidity pools, volume-profile levels, and

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT State Engine
3 stars

This indicator calculates and plots previous higher-timeframe structural levels directly onto the main price chart. It retrieves the prior high, low, and close levels for daily, weekly, and monthly periods using dashed horizontal reference lines and labels ext

Indicator v5 Support & resistanceSessions & time
Updated 5 months ago · None stated GitHub repository of GARY - Prior Levels

Session Liquidity

by rosijay17-cmd
1 stars

An overlay indicator that draws horizontal lines at the high and low of up to three user-defined daily time spans, such as Asia, London and New York. Each session has its own time range, day-start timezone, line colour, style, width and optional text label, an

Indicator v5 Sessions & timeSupport & resistance
Updated 8 days ago · GPL-3.0 GitHub repository of Session Liquidity

Dragon Strength Pro

by morindok
1 stars

Dragon Strength Pro is an overlay indicator that stores recent pivot highs and pivot lows confirmed by left and right bar lengths, keeping up to fifty of each. It averages the slope from those pivots to the current close and scores upward impact from lows and

Indicator v5 TrendOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of Dragon Strength Pro
1 stars

Overlay indicator of single-bar detections drawn on the price chart. It covers relative volume tiers named SAAB, Kratos, Grand Slam and MOAB, regular-at-time volume tiers, an all-time high volume marker, momentum LONG and SHORT tiers, high-volume ranks from 15

Indicator v5 VolumeOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Heavy Weapons Single v3

Supply and Demand MTF

by mikeyhu70
1 stars

Finds supply and demand zones from strong momentum candles and draws them as boxes on the price chart, with an option to pull zones from additional timeframes. Settings control momentum body multiple, momentum count and span, how far back zones are searched, w

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 6 months ago · None stated GitHub repository of Supply and Demand MTF
261 stars

This Pine Script library provides algorithmic helper functions to perform K-Means clustering calculations. It includes utilities for computing Euclidean distance between two-dimensional coordinates, identifying nearest cluster centers, executing bisection sear

Library v5
Updated 4 years ago · None stated GitHub repository of SignalProcessingClusteringKMeans

BBPullback

by hasnocool
106 stars

This strategy executes pullback trades based on internally computed Bollinger Bands and candle price action directly on the main price chart. It tracks breakout and pullback states to trigger long and short entries. Users can select among three distinct take p

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BBPullback

This indicator detects and draws the first Fair Value Gap (FVG) that forms in each hourly session based on a selected lower timeframe, with specialized handling for Regular Trading Hours (RTH) confluence windows. It draws FVG range boxes, midpoint lines, hourl

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints

Keltner Channels

by TWODS-CAPITAL
37 stars

This indicator plots Keltner Channels on the price chart. It builds a basis from an exponential or simple moving average of a chosen source, then places upper and lower bands a multiplier away from that basis. Band width uses average true range, true range, or

Indicator v5 Volatility & bandsMoving averages
Updated 3 years ago · MIT GitHub repository of Keltner Channels
13 stars

This strategy calculates a Volume Zone Oscillator and plots it in a separate pane. It goes long when the oscillator shows green and a volume spike occurs, and goes short when it shows red with a volume spike. A reverse mode and optional start and stop times co

Strategy v5 Oscillators & momentumVolume
Updated 1 year ago · None stated GitHub repository of Ruckard Neobutane VZO cB003

CRT State Engine

by alboogycOdR
6 stars

CRT State Engine is an overlay indicator that maps New York time-based CRT models at 9PM, 1AM, 5AM, and 9AM. It tracks market structure, liquidity sweeps, change-in-state delivery, and unmitigated order blocks that stay drawn until mitigated. Optional modules

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT State Engine
3 stars

This indicator identifies and plots bullish and bearish Fair Value Gaps (FVGs) directly on the price chart using box drawings. It detects three-bar price imbalances, adjusting sensitivity via user settings. The script can dynamically minimize box boundaries as

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 5 months ago · None stated GitHub repository of GARY Fair-Value GAPS
1 stars

Dual MA Detrended Price calculates two detrended price series by subtracting simple moving averages from a chosen price source. It derives the moving average lengths by applying Golden Ratio multipliers of 1.618 and 0.618 to a configurable base length setting.

Indicator v5 Oscillators & momentumMoving averages
Updated 7 weeks ago · None stated GitHub repository of Dual MA Detrended Price

Supply and Demand MTF

by mikeyhu70
1 stars

Finds supply and demand zones from strong momentum candles and draws them as boxes on the price chart, with an option to pull zones from additional timeframes. Settings control momentum body multiple, momentum count and span, how far back zones are searched, w

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 6 months ago · None stated GitHub repository of Supply and Demand MTF

StringEvaluation

by ricardosantos79
261 stars

This utility library evaluates mathematical expressions formatted as strings within Pine Script v5. It parses raw input strings, removes whitespace, extracts operators and numeric values, and handles operator precedence. The code includes support for transform

Library v5
Updated 4 years ago · None stated GitHub repository of StringEvaluation
106 stars

BEAM DCA Strategy Monthly calculates long-term risk bands around a moving average baseline to implement a monthly dollar-cost averaging strategy. It normalizes asset risk between 0 and 1, placing buy orders when risk falls below 0.5 on a specific day of the mo

Strategy v5 Moving averagesSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of BEAM DCA Strategy Monthly

Keltner Channels Strategy

by TWODS-CAPITAL
37 stars

This strategy builds Keltner-style bands around an exponential or simple moving average of the chosen source. Band width uses average true range, raw true range, or a smoothed high-low range, scaled by a multiplier. When the source crosses above the upper band

Strategy v5 Volatility & bandsBreakout
Updated 3 years ago · MIT GitHub repository of Keltner Channels Strategy
13 stars

This strategy plots a Noro trend ribbon on the price chart and uses ribbon side changes to choose long or short direction. A corridor built from recent high and low prices filters entries: longs open below the corridor while the bias is long, and shorts open a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon

CRT State Engine

by alboogycOdR
6 stars

Implements an institutional Candle Range Theory (CRT) framework aligned to New York market time windows at 1 AM, 5 AM, and 9 AM. It calculates Draw on Liquidity (DOL) levels using pivot points, manages session state machine boxes, and generates entry signals w

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT State Engine

GG - Levels

by g-moe
3 stars

This indicator tracks and visualizes key intraday session levels directly on the price chart. It calculates open, high, low, and close values for Regular Trading Hours (RTH), the Overnight Session (ON), and the Initial Balance (IB) period. It draws horizontal

Indicator v5 Sessions & timeSupport & resistance
Updated 5 months ago · None stated GitHub repository of GG - Levels

TD Sequential V2

by mikeyhu70
1 stars

A Pine Script v5 indicator on the price chart that counts consecutive closes against the close four bars earlier, separately for falling and rising markets, and adds a bonus count that compares closes with two bars earlier once the setup passes nine. The count

Indicator v5 Oscillators & momentum
Updated 6 months ago · None stated GitHub repository of TD Sequential V2

Chart CAGR

by ivansoft
1 stars

An indicator that reports the growth rate and compound annual growth rate between the first and last visible bars of the chart. It uses the open of the leftmost visible bar and the close of the rightmost visible bar, then shows both values as percentages in a

Indicator v5 Screeners & dashboards
Updated 1 year ago · None stated GitHub repository of Chart CAGR

Vector2Operations

by ricardosantos79
261 stars

Vector2Operations is a Pine Script v5 utility library that stores two-dimensional vectors as two-element float arrays and exposes helpers to read and write their components. It computes the fractional part of a number, an approximate atan2 angle in radians fro

Library v5
Updated 4 years ago · None stated GitHub repository of Vector2Operations

This strategy script provides a framework for backtesting custom trading rules with flexible risk and order management. It allows traders to configure fixed pip-based stop loss, take profit, and trailing stop levels, complete with custom partial exit percentag

Strategy v5
Updated 2 years ago · GPL-3.0 GitHub repository of BEST Strategy Template with Custom SL-TP Size

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