Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 67)

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

MathComplexExtension

by ricardosantos79
261 stars

This Pine Script v5 library extends complex-number handling for other scripts. It treats a complex value as a two-element float array of real and imaginary parts. It exports get_phase, which returns the argument in radians or degrees with quadrant and axis spe

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

This strategy plots volume-weighted moving average volatility bands and standard deviation levels calculated from multi-timeframe price data directly on the price chart. It defines percentage-based stop-loss and take-profit exit targets for both long and short

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of V1.4 ESU2023 - Futures 1M No Repaint

Astor SMA20/60

by hasnocool
106 stars

This strategy plots SMA20 and SMA60 on the price chart for BTCUSDT. It generates long entries on close crossing above SMA20 and short entries on crossing below. Separate signals trigger on SMA60 crossovers. Backtest starts at user-defined year, month, and day

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Astor SMA20/60
46 stars

This overlay indicator marks swing highs and lows with Bill Williams fractals and draws them as offset labels and extended lines on the price chart. Fractal length can be 3, 5, 7, or 9 bars, and an optional filter reduces weaker fractal points. It also plots c

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · None stated GitHub repository of MTF Swing Highs and Lows with Key Levels

Donchian Channels

by TWODS-CAPITAL
37 stars

This indicator plots a Donchian channel on the price chart. It calculates the highest high and the lowest low over a user-set lookback, then draws those values as upper and lower bands with a midline equal to their average. The area between the bands is filled

Indicator v5 Volatility & bandsBreakout
Updated 3 years ago · MIT GitHub repository of Donchian Channels

FilledValueGap F002

by ruckard
13 stars

FilledValueGap F002 is a trading strategy that enters trades when a recent price gap is filled, operating under the assumption that price action will continue in the direction of the underlying trend. It plots Curie closing moving average lines directly on the

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of FilledValueGap F002
6 stars

Apex Protocol Assistant is an intraday technical indicator that overlays smart money concepts and trading session levels directly on the price chart. It evaluates higher timeframe EMA trends, change of character shifts, and fair value gaps. The tool highlights

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of Apex Protocol Assistant (Optimized)

Datsana V.1

by g-moe
3 stars

This indicator plots RSI divergence lines at resistance and support levels based on 14-period RSI crossing above 70 or below 30 within a search window of 141 bars. It displays dual EMA trend fill between periods 199 and 299, VWAP filter, TKPS tick pattern diam

Indicator v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of Datsana V.1
3 stars

This indicator overlays Smart Money Concepts (SMC) analysis directly onto the price chart. It detects and plots internal and swing market structures including Break of Structure (BOS) and Change of Character (CHoCH), highlights swing points and strong or weak

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 12 months ago · None stated GitHub repository of Smart Money Concepts [BY-AQEEL]

Liquidity Sweeps [UAlgo]

by alvinng214
2 stars

Calculates pivot highs and pivot lows over a customizable length to draw horizontal support and resistance lines on the price chart. When price spikes past a pivot level but closes back within the range, the indicator identifies a buy or sell liquidity sweep,

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Liquidity Sweeps [UAlgo]

NY

by wynnforthework
2 stars

This strategy combines a fast Hull Moving Average with Bollinger Bands to generate mean-reversion signals. It opens a long position when the calculated Hull Moving Average crosses above the lower Bollinger Band, and opens a short position when it crosses below

Strategy v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of NY

Engulfing Candle Micro-Gaps

by Web3Degenerate
2 stars

The Engulfing Candle Micro-Gaps indicator identifies bullish and bearish engulfing candlestick patterns filtered by recent swing highs and swing lows. It introduces a configurable point allowance setting that accommodates minor price gaps between adjacent bars

Indicator v5 Candlestick patternsSupport & resistance
Updated 2 years ago · None stated GitHub repository of Engulfing Candle Micro-Gaps
1 stars

Advanced Time Analyzer calculates time cycles based on a user-defined start and end timestamp. After measuring the bar count of the initial time window, the indicator projects future vertical time lines across the price chart using configurable Fibonacci ratio

Indicator v5 Support & resistance
Updated 7 weeks ago · None stated GitHub repository of Advanced Time Analyzer

Displacement 4x

by nishpa800
1 stars

Overlay indicator running four independent displacement engines on the price chart. Each engine measures candle range as open to close or high to low, compares it with a standard deviation multiple, and marks the candle when a fair value gap confirms on the ne

Indicator v5 SMC / ICT / price actionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Displacement 4x

A Pine Script v5 indicator in a separate pane, version A2.0 of a Hurst spectral oscillator. The chosen source, hl2 by default, is requested with lookahead on and filtered through bandpass filters for cycles from 1 day to 18 years. Every cycle has its own bandw

Indicator v5 Oscillators & momentum Repaints
Updated 6 months ago · None stated GitHub repository of Hurst Spectral Analysis Oscillator A2.0

An indicator component that computes a slow stochastic oscillator with 14, 3 and 3 settings and checks it for regular bullish and bearish divergence against price pivots. The stochastic plot and the divergence labels are commented out in the visible code, so l

Indicator v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Neural Network Sub 24 Stochastic

MathComplexOperator

by ricardosantos79
261 stars

MathComplexOperator is a Pine Script v5 library of utility functions for pseudo complex numbers stored as two-element float arrays of real and imaginary parts. It computes the conjugate by flipping the imaginary sign, adds two complex values, and subtracts one

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

Williams Strategy - Alert is a Pine Script v5 strategy that plots three-bar simple moving averages of high and low prices directly on the price chart. It detects upward and downward trend reversals by comparing the current bar's low and high with those from th

Strategy v5 TrendMoving averages
Updated 7 weeks ago · None stated GitHub repository of Williams Strategy - Alert

Astor SMA20/60 TW

by hasnocool
106 stars

This strategy calculates 20-period and 60-period simple moving averages (SMAs) plotted directly on the price chart. It executes long entries when the closing price crosses above either SMA, provided the bar is on or after the configured backtest start date. Po

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Astor SMA20/60 TW
46 stars

NQ Hourly Retracement Levels highlights NY, London, and Asia trading sessions directly on the price chart. It plots hourly open prices and midpoint retracement levels at the New York session open, filtering levels based on a configurable minimum hit rate thres

Indicator v5 Sessions & timeSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of NQ Hourly Retracement Levels

Double EMA

by TWODS-CAPITAL
37 stars

This indicator plots a double exponential moving average on the price chart. It first smooths the chosen source with an exponential moving average, then smooths that result again with the same length, and combines the two so the line responds faster than a sin

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Double EMA
13 stars

This overlay indicator is a reusable template for Ruckard indicators meant to work with Zignaly. The implemented logic sections are empty, so it does not plot signals or manage trades. It exposes a higher-timeframe trend filter built from a fast and a slow mov

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of IndicatorTemplate A002
6 stars

This Pine Script v5 indicator is an SMC trading engine that plots order blocks, fair value gaps, break of structure markers, market structure shifts, and Fibonacci retracements on the price chart. It supports customizable higher and lower timeframes along with

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of Apex Protocol The SMC Engine
3 stars

This indicator tracks the low of day and high of day during the specified RTH session hours in the New York timezone. It calculates the high at the current low of day (lod_h) and the low at the current high of day (hod_l). Horizontal lines are drawn at these l

Indicator v5 Sessions & timeSupport & resistance
Updated 5 months ago · None stated GitHub repository of Day Trading Reversal System
3 stars

This Pine Script indicator plots Smart Money Concepts market structure directly on the price chart. It identifies swing highs and lows, internal market structures, Break of Structure events, Change of Character shifts, and EQH/EQL levels. Breaker blocs are hig

Indicator v5 SMC / ICT / price actionCandlestick patterns Repaints
Updated 12 months ago · None stated GitHub repository of SMC & Breaker Blocs [Krishna]

LiquidityFinderLibrary

by alvinng214
2 stars

This Pine Script library exports a liquidity line detection function designed for Smart Money Concepts analysis. It identifies static and dynamic pivot highs and lows over customizable lookback periods, normalizing price differences between consecutive swing p

Library v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of LiquidityFinderLibrary

Fractal Engulfing Candles

by Web3Degenerate
2 stars

This indicator identifies bullish and bearish engulfing candlestick patterns filtered by fractal swing points and RSI momentum levels. It detects swing highs and lows over a configurable lookback period, requiring bullish signals to coincide with a swing low a

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Fractal Engulfing Candles

E3 F2 Cluster Signals

by nishpa800
1 stars

Overlay indicator that extracts six signal types from a larger signal study: cluster, E3 and First Two momentum-bar patterns, each in a bullish and bearish version, plus combined any-bull and any-bear markers. Visibility, alert switches and marker colours are

Indicator v5 Oscillators & momentumVolume
Updated 2 months ago · None stated GitHub repository of E3 F2 Cluster Signals

A Pine Script v5 indicator in a separate pane, version A3.0 of a Hurst spectral oscillator. It fetches a selectable source, hl2 by default, with lookahead on and runs it through bandpass filters for cycles from 1 day to 18 years. Bandwidth and period are set f

Indicator v5 Oscillators & momentum Repaints
Updated 6 months ago · None stated GitHub repository of Hurst Spectral Analysis Oscillator A3.0
1 stars

An indicator component that calculates 20-period Bollinger Bands with a 2.0 deviation multiplier and plots the basis, upper and lower bands with a shaded fill. It also converts band contact into a weighted score: a score when the close is below the lower band

Indicator v5 Volatility & bandsMean reversion
Updated 1 year ago · None stated GitHub repository of Neural Network Sub 31 Bollinger

MathComplexTrignometry

by ricardosantos79
261 stars

MathComplexTrignometry is a Pine Script library that provides trigonometric operations for complex numbers represented as float arrays. It implements standard, hyperbolic, arc, and hyperbolic arc trigonometric functions such as sinh, cosh, and tanh. As a devel

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

Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Athena Momentum Squeeze - Autoview

NQ Statistical Mapper

by TamaraKGreen
46 stars

NQ Statistical Mapper plots key trading sessions including New York, London, and Asia directly on the price chart. It visualizes session high and low ranges, displays configurable session and intraday levels, and presents session performance metrics in an on-s

Indicator v5 Sessions & timeSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of NQ Statistical Mapper
37 stars

This indicator detects the bearish Downside Tasuki Gap candlestick pattern on the price chart. It looks for a long red candle, a smaller red candle that gaps below it, and a green candle that closes inside that gap without filling it, while price is in a downt

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Downside Tasuki Gap - Bearish

Knn Filter A007

by ruckard
13 stars

Knn Filter A007 is a strategy that applies a K-Nearest Neighbors classification algorithm to evaluate historical feature performance and filter out low-probability trade setups. It executes long and short entries based on learned historical patterns. Risk mana

Strategy v5 AI / machine learningVolatility & bands
Updated 1 year ago · None stated GitHub repository of Knn Filter A007
6 stars

Apex Protocol v3.0 - The SMC Engine is an overlay indicator designed for Smart Money Concepts market structure analysis. It identifies and plots Break of Structure (BOS) and Market Structure Shift (MSS) markers, Fair Value Gaps (FVG), Order Blocks (OB), and se

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 7 months ago · None stated GitHub repository of Apex Protocol v3.0 - The SMC Engine
3 stars

DEBUG Lower TF Supertrend calculates a modified trailing Supertrend line and trend direction based on average true range bands applied around the bar mid-price. The custom function supports multiple moving average types, such as HMA, EMA, SMA, WMA, and VWMA, t

Indicator v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of DEBUG Lower TF Supertrend
2 stars

This indicator detects market structure breaks using a configurable ZigZag length to identify swing highs and lows. It marks bullish and bearish order blocks along with breaker blocks on the price chart. Breakouts are confirmed via a Fibonacci retracement fact

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of Market Structure Break & Order Block

Q-Trend Strategy

by wynnforthework
2 stars

Q-Trend Strategy builds a midpoint from the highest and lowest source values over a trend period and shifts it by an ATR band. It enters long when the source crosses or remains above the upper band and short when it crosses or remains below the lower band. Typ

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Q-Trend Strategy

FTB Strategy

by Web3Degenerate
2 stars

The FTB Strategy is a short-only overlay strategy targeting EURUSD during the European session from 0200-0700. It enters short positions when filters confirm RSI overbought, a bullish prior bar close, or a high price level within lookback bars, combined with a

Strategy v5 Mean reversionSessions & time
Updated 2 years ago · None stated GitHub repository of FTB Strategy

A Pine Script v5 indicator in a separate pane, version A4.0 of a Hurst spectral oscillator. The hl2 source, changeable in the settings, is requested with lookahead on and filtered with bandpass filters covering cycles from 1 day to 18 years. Each cycle can be

Indicator v5 Oscillators & momentum Repaints
Updated 6 months ago · None stated GitHub repository of Hurst Spectral Analysis Oscillator A4.0

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