Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 71)

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

3 stars

This strategy overlays three Simple Moving Averages, one Exponential Moving Average, and a dynamic trailing swing line directly on the price chart. It determines market direction by tracking recent highest highs and lowest lows over a customizable swing period

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of EMA Crossover Scott Strategy
2 stars

This Pine Script indicator detects Smart Money Concepts order blocks on the price chart using pivot highs and lows. It builds supply and demand zones based on configurable pivot periods and order block validity periods. The script offers refinement options to

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of SMC Setup Order Blocks 07 TFlab

Ichimoku Cloud

by Web3Degenerate
2 stars

This indicator calculates and overlays standard Ichimoku Cloud components on the price chart, including the Conversion Line, Base Line, Lagging Span, and Leading Spans A and B. It imports an external library to detect candlestick patterns like hammers and shoo

Indicator v5 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of Ichimoku Cloud
1 stars

The Complex Pattern Finder indicator scans price charts for specific sequences of bullish and bearish candlesticks encoded as binary strings. Users can enter a custom string of ones and zeros or enable an auto-generated Fibonacci sequence based on a chosen lev

Indicator v5 Candlestick patterns
Updated 7 weeks ago · None stated GitHub repository of Complex Pattern Finder

Fable Bull HTF v1.2

by nishpa800
1 stars

A bullish-side detection indicator for higher timeframe charts that places numbered signals on the price chart. It combines relative volume tiers, a standard deviation displacement test, a VWMA with ATR Supertrend latch, pocket pivots and fair value gap engine

Indicator v5 VolumeSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Fable Bull HTF v1.2
1 stars

A Pine Script v5 indicator in a separate pane, the fifth revision of a Hurst cycle trough marker, whose title spells trough as through. It filters the hl2 price with bandpass filters for cycles from 1 day to 18 years and labels cycle lows with lines. Each cycl

Indicator v5 Oscillators & momentumSupport & resistance
Updated 6 months ago · None stated GitHub repository of Hurst Through Marker V5

SMI Hist Divergence

by zhuzp98
1 stars

An oscillator in a separate pane based on the Stochastic Momentum Index. It plots the SMI, an EMA of it, and a histogram of how the gap between the two changes from bar to bar, coloured by direction and strength. Dashed bands sit at plus and minus 40 with grad

Indicator v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of SMI Hist Divergence

MathSearchDijkstra

by ricardosantos79
261 stars

This library provides Dijkstra's algorithm to compute shortest path distances in a weighted graph. It represents the graph as an adjacency matrix and calculates minimum costs from a start vertex to all others using a greedy approach. The min_distance function

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

This long-only strategy trades intra-range mean reversion using standard or augmented Bollinger Bands overlayed on the main price chart. It triggers long entries when price dips below the lower band, provided the band spread stays within a defined threshold. E

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of B.Bands | Augmented | Intra-range | Long-Only

Session Opening Bar Range

by TamaraKGreen
46 stars

This indicator plots the opening range of selected trading sessions directly on the price chart. Users can choose preset market sessions like New York, London, or Asia, or configure custom time windows. It draws high, low, and midline boundaries for the first

Indicator v5 Sessions & timeSupport & resistance Repaints
Updated 8 weeks ago · None stated GitHub repository of Session Opening Bar Range

Fisher Transform

by TWODS-CAPITAL
37 stars

Calculates the Fisher Transform oscillator based on the median price over a user-defined lookback length. By transforming prices into a Gaussian probability distribution, it highlights extreme price movements and potential trend reversals. The script plots the

Indicator v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Fisher Transform

This strategy plots on the price chart and combines Trend Indicator A-V2, Supertrend, and QQE Mod to choose long or short entries. Optional start and stop times limit when it trades. Percentage take profit and stop loss are enabled by default, while trailing t

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard AndresAristizibal Joya E002

CRT + Turtle Soup Scanner

by alboogycOdR
6 stars

Calculates CRT session range boundaries and detects Turtle Soup setups to identify potential breakout signals. The script tracks session high, low, and midpoint values to determine intraday bias while measuring price break distances against ATR thresholds. It

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT + Turtle Soup Scanner

This strategy executes trades based on price crosses over dynamic swing breakout levels filtered by a baseline moving average. It plots three simple moving averages and an exponential moving average directly on the price chart alongside buy and sell arrows. Lo

Strategy v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of EMA Crossover Scott Strategy v2

SW's Asia/London H/L's

by alvinng214
2 stars

This indicator draws high and low levels for the Asia, London, New York, and Sydney sessions on the price chart. Each session can be enabled separately, with its own line color, thickness, opacity, labels, and an optional vertical line at the session start. It

Indicator v5 Sessions & timeSupport & resistance
Updated 2 months ago · None stated GitHub repository of SW's Asia/London H/L's

Multiple Moving Averages

by Web3Degenerate
2 stars

Plots up to five configurable moving averages directly on the price chart. Users can individually select the period and calculation type for each line from EMA, SMA, HMA, WMA, DEMA, VWMA, or VWAP. A master setting enables overriding all moving average types at

Indicator v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of Multiple Moving Averages

Fable Bull HTF v1.3

by nishpa800
1 stars

A bullish-side detection indicator for higher timeframe charts that draws numbered signals on the price chart. It uses relative volume tiers, a standard deviation displacement test, a VWMA with ATR Supertrend latch, pocket pivots and fair value gap engines. A

Indicator v5 VolumeSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Fable Bull HTF v1.3
1 stars

Detects swing highs and swing lows from left and right bar counts and keeps the most recent ones, with their dates, in a table on the price chart. Settings choose the bar counts, how many swings to track, and the table position, size and text colours. Swings a

Indicator v5 Support & resistanceScreeners & dashboards
Updated 6 months ago · None stated GitHub repository of Last n Swing High Low Table

Strategy Template

by zhuzp98
1 stars

A blank Pine Script v5 strategy template with placeholder sections for inputs, indicators and conditions. It defines equity-based position sizing, commission and slippage, a percentage stop loss and take profit set from the entry price, and order blocks for lo

Strategy v5
Updated 1 year ago · None stated GitHub repository of Strategy Template

MathSpecialFunctionsGamma

by ricardosantos79
261 stars

MathSpecialFunctionsGamma is a Pine Script v5 utility library providing mathematical implementations of the Gamma function and its logarithm. It utilizes the Lanczos approximation to evaluate the natural logarithm of the Gamma function with high precision floa

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

Backtest Broken

by hasnocool
106 stars

Demonstration strategy designed to illustrate backtest execution mechanics and potential evaluation anomalies in Pine Script. When no position is open, the strategy uses a pseudo-random function to trigger long entries. Upon entering, it immediately establishe

Strategy v5
Updated 2 years ago · GPL-3.0 GitHub repository of Backtest Broken

Session Statistical Levels

by TamaraKGreen
46 stars

This indicator overlays statistical price range levels across key trading sessions, including Asia, London, NY Morning, and NY Afternoon, as well as an optional custom session. It calculates and plots symmetric percentile range bands such as the median (P50),

Indicator v5 Sessions & timeSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of Session Statistical Levels

Gravestone Doji - Bearish

by TWODS-CAPITAL
37 stars

This indicator scans price bars for a bearish gravestone doji on the price chart. It treats a candle as a doji when the body is small relative to the full range, then requires the lower shadow to be no larger than the body. On a match it draws a GD label above

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Gravestone Doji - Bearish
13 stars

The Ruckard Cuneyt OBVRSI A002 strategy combines On-Balance Volume (OBV) and Relative Strength Index (RSI) thresholds to generate trade entries, DCA rebuys, and exits. Built primarily for crypto automation via Zignaly webhooks, it opens positions when OBV RSI

Strategy v5 Oscillators & momentumVolume
Updated 1 year ago · None stated GitHub repository of Ruckard Cuneyt OBVRSI A002
6 stars

CRT Bias Scanner Optimized is a Pine Script v5 indicator that scans 16 assets including major forex pairs, indices, commodities and crypto at user-defined intervals. It calculates bias signals across symbols and displays results with last scan timestamp when e

Indicator v5 Sessions & timeScreeners & dashboards
Updated 7 months ago · None stated GitHub repository of CRT Bias Scanner Optimized
3 stars

This indicator identifies price action reversal setups by combining candlestick patterns with Exponential Moving Average (EMA) trend filters. It calculates two customizable EMAs (default 10 and 20 periods) and fills the area between them to form an EMA cloud.

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · None stated GitHub repository of Engulfing Patterns
2 stars

This indicator detects liquidity sweeps during the Asian session and identifies reversal opportunities in the New York session. It tracks the high and low of the Asia trading range using session timestamps in UTC+3. Sweep up and down are flagged when price bre

Indicator v5 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of Asian Liquidity Sweep + NY Reversal

Piercing Line & Dark Cloud

by Web3Degenerate
2 stars

This indicator identifies bullish Piercing Line and bearish Dark Cloud candlestick patterns directly on the price chart. It calculates the midpoint of the preceding candle and checks for directional candle closes along with opening gap conditions. To filter fa

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Piercing Line & Dark Cloud

Fable Bull LTF v1

by nishpa800
1 stars

The first release of a bullish-side detection indicator for lower timeframe charts. It draws numbered signals on the price chart from relative volume tiers, a standard deviation displacement test, a VWMA with ATR Supertrend latch, pocket pivots and fair value

Indicator v5 VolumeSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Fable Bull LTF v1

Detects swing highs and swing lows from left and right bar counts and lists the most recent ones in a compact table on the price chart. Settings choose the bar counts, how many swings to store and display, how many days into the past and future the display cov

Indicator v5 Support & resistanceScreeners & dashboards
Updated 6 months ago · None stated GitHub repository of Last n Swing High Low Table Compact
1 stars

An indicator that finds pivot highs and lows and groups nearby pivots into support and resistance channels drawn on the price chart. Settings cover pivot period, source, maximum channel width as a share of the recent range, minimum strength, number of channels

Indicator v5 Support & resistance Repaints
Updated 1 year ago · None stated GitHub repository of Support Resistance Levels

MathSpecialFunctionsLogistic

by ricardosantos79
261 stars

MathSpecialFunctionsLogistic is a Pine Script library that provides mathematical helper functions for logistic calculations. It includes exported functions to compute the standard logistic function and the logit function, which serves as the inverse of the sig

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

Backtester v5

by hasnocool
106 stars

This strategy plots a 50-period and a 200-period simple moving average on the price chart and trades their crosses. It opens a long when the fast average crosses above the slow average and closes that long on the opposite cross; shorts use the reverse crosses.

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Backtester v5

Session Statistical Levels + Extension Gauge calculates and plots statistical price projections, maximum favorable/adverse excursion (MFE/MAE) percentiles, and standard deviation range bands based on historical distribution data from NQ futures. It anchors sta

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · None stated GitHub repository of Session Statistical Levels + Extension Gauge

Greedy Strategy

by TWODS-CAPITAL
37 stars

The Greedy Strategy enters long or short positions based on price gaps and bar close conditions relative to current position direction. It places long entries when price gaps above the previous high and short entries on downward gaps below the previous low. Po

Strategy v5 Breakout
Updated 3 years ago · MIT GitHub repository of Greedy Strategy

Ruckard Curie B004

by ruckard
13 stars

Ruckard Curie B004 is a trend-following strategy designed for cryptocurrency trading. It generates signals by combining fast and slow moving averages calculated from high and low source prices with directional strength filtering using ADX and DI indicators. Th

Strategy v5 Moving averagesOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Curie B004

CRT Bias Scanner v4

by alboogycOdR
6 stars

This overlay indicator presents a multi-asset CRT bias scanner as a table on the price chart. It watches up to sixteen symbols, grouped by preset lists or custom slots, and refreshes the scan at a user-set interval in minutes. Optional alerts can fire for stro

Indicator v5 Screeners & dashboards
Updated 7 months ago · None stated GitHub repository of CRT Bias Scanner v4
3 stars

This indicator identifies pullback reversal setups by combining dual exponential moving averages with candlestick patterns. It plots two EMAs with a shaded cloud to define trend direction. When price touches or crosses the slower EMA and closes back in trend a

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · None stated GitHub repository of Engulfing Patterns

Plot Arrow

by Web3Degenerate
2 stars

This educational indicator demonstrates how to render chart arrows in Pine Script using the built-in plotarrow function. It calculates the difference between the open and close price of each bar, plotting an arrow directly on the price chart. When the value is

Indicator v5
Updated 2 years ago · None stated GitHub repository of Plot Arrow

Convergence Spirals

by morindok
1 stars

This indicator plots convergence spirals on the price chart using two user-defined points defined by time and price. It calculates spiral paths with options for symmetric spirals, extension, and mirroring of selected levels or endpoints. Inputs control divisor

Indicator v5 Support & resistanceDivergence
Updated 7 weeks ago · None stated GitHub repository of Convergence Spirals

Fable Bull LTF v1.4

by nishpa800
1 stars

A bullish-side detection indicator for lower timeframe charts that places numbered signals on the price chart. Its engines include relative volume tiers, displacement by a standard deviation multiplier, a VWMA with ATR Supertrend latch, pocket pivots, fair val

Indicator v5 VolumeSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Fable Bull LTF v1.4
1 stars

Detects swing highs and swing lows from left and right bar counts and lists the most recent ones in a table on the price chart. Settings choose the bar counts, how many swings to store and show, an option to trim future dates, and day ranges for the past and f

Indicator v5 Support & resistanceScreeners & dashboards
Updated 6 months ago · None stated GitHub repository of Last n Swing High Low Table V2
1 stars

This indicator tracks Tom DeMark TD Sequential setup counts in a separate pane. It compares the current close to the close four bars earlier, accumulating positive counts during upward momentum and negative counts during downward momentum. The values display a

Indicator v5 TrendMean reversion
Updated 1 year ago · None stated GitHub repository of TD Sequential Number
261 stars

This library provides implementations of standard mathematical test functions used for optimization algorithm evaluation. The Rosenbrock function creates a valley-shaped problem with a global minimum at (1,1), while its multi-dimensional version accepts array

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

Backtesting System

by hasnocool
106 stars

This strategy backtests long and short trades from an external source on the price chart. Users can wait for a deal to finish, reverse, reenter, or reopen positions. Take profit defaults to a risk-reward mode with optional partial exits, while stop loss defaul

Strategy v5
Updated 2 years ago · GPL-3.0 GitHub repository of Backtesting System

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