Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 59)

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

PR Index

by JohnsonHsiao
1 stars

This indicator calculates a normalized price range oscillator in a separate pane. It computes the position of the current close relative to the highest and lowest close over a configurable lookback period. The output values range between zero and one, compleme

Indicator v5 Oscillators & momentum
Updated 3 years ago · None stated GitHub repository of PR Index
330 stars

This strategy combines triple exponential moving averages with a TTM Squeeze oscillator to capture trend-following momentum. It enters long or short positions when price aligns with all three EMAs (125, 680, and 2500 period) and the oscillator turns in the tre

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]

Function K-Means Clustering

by ricardosantos79
261 stars

Calculates K-Means clustering on two-dimensional float data arrays directly within Pine Script. The script initializes cluster centers randomly from data points and iteratively assigns points to clusters based on Euclidean distance calculations. User settings

Indicator v5 AI / machine learning
Updated 4 years ago · None stated GitHub repository of Function K-Means Clustering
257 stars

This overlay strategy is named for one-minute gold. It requests the daily low and several higher-timeframe opens with lookahead enabled, builds a synthetic source from recent opens, and plots a volume-weighted moving average of a higher-timeframe open with sta

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of GOLD 1M - No repaint

Accumulate

by hasnocool
106 stars

Accumulate identifies potential market accumulation and breakdown phases by combining four Simple Moving Averages (21, 50, 90, and 200 periods) with a Price Volume Trend (PVT) MACD indicator. Green buy arrows plot on the main price chart when price is above a

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Accumulate
65 stars

This strategy calculates the 20-period RSI and detects bullish and bearish crosses at the 50 level. On a bullish crossover it enters a long position using a stop set to the high price and sends a custom alert message with the stop value. On a bearish crossunde

Strategy v5 Oscillators & momentum
Updated 6 days ago · GPL-3.0 GitHub repository of Strategy using alert_message
55 stars

This indicator plots horizontal support and resistance from confirmed pivot lows and pivot highs, using ten bars on each side. When a new pivot appears, it replaces the previous line and extends it ten bars beyond the current bar. A translucent gray fill marks

Indicator v5 Support & resistanceVolume
Updated 6 months ago · Apache-2.0 GitHub repository of AAPL Structural Lines & Fills
47 stars

This indicator draws colored boxes for six four-hour New York sessions, from 6pm through 2pm, and tracks each window's open, high, low, and close. It marks the high of day and low of day and records whether those extremes are later eliminated. A checkpoint tab

Indicator v5 Sessions & timeSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of 4H HOD/LOD Checkpoint Analysis

Chande Momentum Oscillator

by TWODS-CAPITAL
37 stars

This indicator plots the Chande Momentum Oscillator in a separate pane. It splits bar-to-bar changes of a chosen source into positive and negative parts, sums each over a lookback length, and scales the difference of those sums by their total into a percentage

Indicator v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Chande Momentum Oscillator

Zen Z Bars V1

by Zen-Tim
29 stars

Zen Z Bars V1 analyzes bar-by-bar price action, candle range expansion, and internal bar strength (IBS). It identifies breakouts, inside and outside bars, climax candles based on range expansion factors, and tiered range multiple bars. The indicator draws brea

Indicator v5 Candlestick patternsBreakout
Updated 2 weeks ago · MIT GitHub repository of Zen Z Bars V1

Diverlong D002

by ruckard
13 stars

Diverlong D002 is a trading strategy designed for crypto assets that detects momentum divergences using state changes in the Squeeze Momentum Indicator. It triggers long or short entries when price and momentum diverge across indicator sections. Trade exits ar

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Diverlong D002

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX
7 stars

The RSI + BB Oscillator combines Relative Strength Index (RSI) and Bollinger Bands %B calculations across two timeframes into a single separate pane plot. It shifts RSI values around zero and measures %B bandwidth using selectable moving average types includin

Indicator v5 Oscillators & momentumVolatility & bands Repaints
Updated 4 months ago · None stated GitHub repository of RSI + BB Oscillator

2AM-Gold Swing Strategy

by alboogycOdR
6 stars

This indicator plots smart money concepts on the price chart, focusing on session setups initiated at a specified start hour. It calculates swing highs and lows, monitors liquidity sweeps, confirms market structure shifts, and identifies order blocks and fair

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of 2AM-Gold Swing Strategy

Simpleton GROK

by eltonaguiar
4 stars

This strategy plots on the price chart and combines up to seven optional modules that vote for long or short conditions. The modules use a 20-period simple moving average, a five-period RSI, Bollinger Band squeezes, a simplified prior-bar break, stacked expone

Strategy v5 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Simpleton GROK
4 stars

Calculates a standard Relative Strength Index (RSI) oscillator to trigger oversold and overbought signal conditions, then formats custom JSON alert payloads designed for webhook integration with external services. The script plots RSI in a separate pane and ge

Indicator v5 Oscillators & momentum
Updated 11 months ago · Custom licence GitHub repository of Webhook Alert Template [Lab]
3 stars

This indicator calculates 3-period and 13-period exponential moving averages (EMAs) and plots them on the main price chart. It checks whether a single candlestick's real body—the space between its open and close prices—intersects both EMAs on the same bar. Whe

Indicator v5 Moving averagesTrend
Updated 4 weeks ago · None stated GitHub repository of K-bar and EMA Crossover
3 stars

This indicator measures buyer and seller strength over a fixed twenty-bar lookback window and plots the result in a separate pane. It calculates bull force based on the distance from the lowest close and bear force from the highest close, incorporating the bar

Indicator v5 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of CSW Bull/Bear Force
3 stars

This indicator plots trading signals, swing levels, a trend cloud, and optional take-profit and stop-loss targets directly on the price chart. It calculates advanced historical volatility metrics, including Garman-Klass and Yang-Zhang estimators, to evaluate m

Indicator v5 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Elite Algo Modded By AlgoPoint
3 stars

The Volatility Clustering Estimator measures autocorrelation in logarithmic price returns across daily, weekly, and monthly timeframes. It calculates logarithmic returns for higher-timeframe close prices and evaluates their correlation with lagged returns usin

Indicator v5 Volatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Volatility Clustering Estimator

Vector Candles

by TamTH-Dev
2 stars

Vector Candles is an overlay indicator that recolors price bars according to relative trading volume and volume spread. It compares current volume against a 10-bar moving average and evaluates volume spread relative to recent highs. Bars are categorized and hi

Indicator v5 VolumeCandlestick patterns
Updated 6 weeks ago · None stated GitHub repository of Vector Candles

3C QFL Mean Reversal

by wynnforthework
2 stars

This strategy implements a Quickfinger Luc mean-reversion trading model tailored for automated execution. It calculates base support levels and volume moving averages across timeframes to identify sharp price dips below established base levels. The script incl

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of 3C QFL Mean Reversal

Stops & Targets

by Web3Degenerate
2 stars

This script demonstrates how to calculate and display ATR-based stop loss and take profit levels directly on the price chart. It detects hammer and shooting star candlestick patterns filtered by a 50-period EMA trend. When a setup occurs and no active trade is

Strategy v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Stops & Targets
1 stars

An extended strategy version that adds a strategy preset, a risk aggression choice and a pattern type filter to an AlphaTrend style core with MACD. It includes three consolidation layers with volume profile, candlestick and macro pattern drawings, a kinematic

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended
1 stars

VCP Volume Contraction is an indicator designed to identify Volatility Contraction Pattern setups by measuring both volume and price volatility tightness. It calculates a volume ratio by comparing current volume against its moving average, alongside an ATR-bas

Indicator v5 Volatility & bandsVolume
Updated 4 months ago · None stated GitHub repository of VCP Volume Contraction
1 stars

This strategy evaluates short-term trend momentum by summing price differences across a user-defined lookback period using a for loop. It combines this calculated average momentum with 9-period and 21-period Exponential Moving Average crossovers. A long trade

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of For Loop Accumulator
1 stars

This indicator marks swing highs and lows from pivot bars on the price chart and projects dates ahead using Gann and Hurst cycle timing ideas. Tables show the pivot dates and nearby future dates, with colours for bullish and bearish pivots. The left and right

Indicator v5 Support & resistance
Updated 6 months ago · None stated GitHub repository of Gann Hurst Pivot HL 2024 V1.2
1 stars

This strategy runs on the price chart and is titled for a percentile SuperTrend combined with OBV and DI, although the provided excerpt does not show those calculations. It restricts trading to bars after a user-chosen start time and can enable long entries, s

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Percentile_SuperTrend_OBV&DI

VP Scalper

by Tradehook-org
1 stars

A Pine v5 strategy that trades around point of control and value area levels. These are not a true volume profile: the code builds approximate levels from the previous session's high, low and close, taken from a daily, weekly or monthly timeframe and scaled by

Strategy v5 Support & resistanceScalping
Updated 8 months ago · None stated GitHub repository of VP Scalper

Momentum Breakout

by knectardev
1 stars

This strategy enters long when the close is above the upper Bollinger Band and volume exceeds a moving average multiplied by a threshold, and enters short when the close is below the lower band with the same volume condition. New entries occur only while the p

Strategy v5 Volatility & bandsVolume
Updated 9 months ago · None stated GitHub repository of Momentum Breakout

V5 Combination by yzz

by webcrack4
1 stars

This script combines a Volume Profile / Market Profile (TPO) tool with an overlay MACD indicator directly on the price chart. It calculates volume or time-at-price distributions across customizable ranges (Visible Range, Anchored Range, or All Range) to identi

Indicator v5 VolumeSupport & resistance
Updated 9 months ago · None stated GitHub repository of V5 Combination by yzz

Indicator Template

by zhuzp98
1 stars

An empty Pine Script v5 indicator template that sets up an overlay indicator with price formatting, two-decimal precision and timeframe gap handling. The visible code contains only section headers for parameters and indicators, with no inputs, calculations or

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

Price Oscillator

by JohnsonHsiao
1 stars

The Price Oscillator calculates the difference between two simple moving averages applied to close prices: a fast SMA using fast_len (default 20) and a slow SMA using fast_len plus slow_len_factor (default 60). It plots this oscillator value as a green line in

Indicator v5 Oscillators & momentumMoving averages
Updated 3 years ago · None stated GitHub repository of Price Oscillator
330 stars

This strategy generates crossover signals using two exponential moving averages calculated from multi-timeframe Heikin Ashi data. It enters long when the fast EMA crosses above the slow EMA and enters short on a crossunder, reversing the open position. Positio

Strategy v5 Moving averagesTrend Repaints
Updated 2 months ago · None stated GitHub repository of Javo v1 [Repaint] [Alorse]

Function Polynomial Regression

by ricardosantos79
261 stars

This indicator fits a quadratic polynomial regression through recent fractal pivot highs and lows and plots the result as a channel on the price chart. A reusable function returns fitted values plus maximum, minimum, and average absolute deviations from the cu

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Function Polynomial Regression
257 stars

Marks intraday swing tops and bottoms on the price chart with labels and short horizontal lines. After a morning session reset in the UTC-8 time zone, it tracks the running high and low, measures how far price has moved away from the extreme, and prints a labe

Indicator v5 Support & resistanceSessions & time
Updated 7 weeks ago · None stated GitHub repository of High Low Live Super
106 stars

This script executes long and short trades directly on the price chart by combining signals from multiple indicators, including MACD, RSI, Stochastic RSI, Supertrend, and moving average crosses. It aggregates indicator conditions using weighted scores and ente

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Acrypto - Weighted Strategy

This strategy calculates a 20-period Relative Strength Index and plots the oscillator alongside a centerline at 50 in a separate pane. It enters long positions when the indicator crosses above 50 and enters short positions on downward crosses. The strategy rev

Strategy v5 Oscillators & momentum
Updated 6 days ago · GPL-3.0 GitHub repository of Strategy with selective alert() calls
55 stars

This indicator draws diagonal trendlines from confirmed swing points on the price chart. It detects pivot highs and pivot lows using a fixed 15-bar lookback on each side. When a new pivot confirms, it connects the last two highs with a solid red line and the l

Indicator v5 TrendSupport & resistance
Updated 6 months ago · Apache-2.0 GitHub repository of Auto Diagonal Trendlines

This indicator builds a momentum score from the rate of change of close, using a lookback that expands or contracts with ATR relative to its standard deviation. It divides that rate of change by price standard deviation, scales the result, and weights it by vo

Indicator v5 Oscillators & momentumVolatility & bands Repaints
Updated 8 weeks ago · None stated GitHub repository of Adaptive Volatility-Adjusted Momentum Score

ChannelBreakOutStrategy

by TWODS-CAPITAL
37 stars

This strategy tracks price channels by calculating the highest high and lowest low over a customizable lookback period. It executes stop orders to enter long positions above the upper channel boundary and short positions below the lower channel boundary. Posit

Strategy v5 BreakoutTrend
Updated 3 years ago · MIT GitHub repository of ChannelBreakOutStrategy

Zen-DAX GX

by Zen-Tim
29 stars

This indicator calculates and plots session ranges and key breakout levels for DAX futures directly on the price chart. It defines the overnight Globex session, the Frankfurt pre-market range, and the regular trading hours open using European timezone settings

Indicator v5 Sessions & timeBreakout
Updated 2 weeks ago · MIT GitHub repository of Zen-DAX GX

Diverlong E002

by ruckard
13 stars

Diverlong E002 is a trading strategy that identifies momentum divergences using state changes in the Squeeze Momentum Indicator. It triggers long and short entries when price action diverges from momentum transition phases. Position exits are determined by Cur

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Diverlong E002
7 stars

This indicator overlays two Bollinger Band sets from two timeframes on the price chart. It centers RSI on zero and classifies the second timeframe as up, sideways, or down. A buy appears when that trend is down or sideways and the first timeframe percent B is

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 months ago · None stated GitHub repository of RSI + BB Signal Alert
6 stars

The 2AM-Gold Swing Strategy+hist indicator plots Smart Money Concepts (SMC) elements for gold trading overlayed directly on the price chart. Starting at a user-defined session hour (default 2:00 AM UTC+2), it tracks liquidity sweeps, market structure shifts, o

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 7 months ago · None stated GitHub repository of 2AM-Gold Swing Strategy+hist

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