Pine Library · 4,367 open-source scripts

Free Pine Script v6 Scripts (page 68)

Scripts written for Pine Script version 6, the current version of TradingView's language. They paste into the Pine Editor and run as they are.

Pine scripts4,367
Code shown here2,412open licence
Updated in a year4,021
No repaint flag3,857

Pine Script v6: Indicators, Strategies and Libraries

1 stars

A strategy for gold futures based on the initial balance, the high and low of a set New York time window that starts at 9:30 and ends at 10:30 by default. Ranges outside a minimum and maximum percent of price are skipped. After price breaks the range, it waits

Strategy v6 BreakoutSessions & time
Updated 2 months ago · None stated GitHub repository of TN Gold IB Retracement
1 stars

A strategy that trades breaks of swing points. It detects pivot highs and pivot lows using left and right bar counts, then places a long stop order one tick above the latest pivot high and a short stop order one tick below the latest pivot low. A pending order

Strategy v6 BreakoutSupport & resistance
Updated 1 year ago · None stated GitHub repository of Pivot Reversal Strategy

RSI Basic Template

by TradersPost
228 stars

This indicator plots a classic Relative Strength Index in a separate pane. It calculates RSI from a chosen price source and length, then draws dashed oversold and overbought levels plus a dotted midline at 50. Background shading highlights when RSI is above th

Indicator v6 Oscillators & momentum
Updated 3 months ago · None stated GitHub repository of RSI Basic Template

Connors RSI (CRSI)

by mihakralj
99 stars

The Connors RSI indicator calculates a composite momentum oscillator as the average of standard RSI on the input source, RSI on directional price streaks, and percent rank of one-bar rate of change. It plots this value in a separate pane below the price chart.

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Connors RSI (CRSI)
16 stars

This strategy implements a trend-following Donchian channel breakout system with momentum-based position sizing. It enters an initial scaled position on a channel breakout to minimize false breakout risk, then adds to the position if RSI confirms directional s

Strategy v6 TrendOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Seykota Alt 47: Momentum Sized

This strategy evaluates the dynamic relationship between price and a chosen moving average across six diagnostic dimensions: trend, respect, extension, compression, acceleration, and exhaustion. It plots a normalized relationship oscillator bounded between -10

Strategy v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Market–Average Relationship Engine [WavesUnchained]
7 stars

The indicator calculates total volume for the IMOEX Russian index by summing volumes of 30+ constituent stocks fetched via request.security. Dollar volume is normalized by multiplying close prices with volumes. The script detects index mode and plots the resul

Indicator v6 Volume
Updated 3 months ago · None stated GitHub repository of Dollar Normalized Volume & IMOEX
4 stars

This strategy executes trades based on Stochastic Oscillator crossovers combined with a trend filter and ATR-based risk management. It calculates smoothed %K and %D lines alongside an Exponential Moving Average (EMA). A long signal triggers when %K crosses abo

Strategy v6 Oscillators & momentumTrend
Updated 2 months ago · MIT GitHub repository of Stoch Strategy [trugurpala]

This indicator creates a heatmap table in a separate pane showing cointegration strength between a user-defined list of symbols. It calculates aligned returns from sum and difference spreads for each symbol pair, then derives a cointegration proxy as the resid

Indicator v6 Mean reversionScreeners & dashboards Repaints

Mass Index (MASSI)

by mushroom-men-Trading
2 stars

The Mass Index indicator measures volatility and potential trend reversals by examining the range between high and low prices. It calculates a single exponential moving average (EMA) and a double EMA of the high-low difference, computes their ratio, and sums t

Indicator v6 Volatility & bands
Updated 9 months ago · None stated GitHub repository of Mass Index (MASSI)

Open-Prep Daily Panel

by skipp-dev
1 stars

This indicator renders a top-right table dashboard with a baked-in snapshot of the last open-prep run. It lists up to ten watchlist symbols, their playbook labels, directional bias, composite scores, tier tags, gap percentages, and relative volume. A freshness

Indicator v6 Screeners & dashboardsSMC / ICT / price action
Updated 4 days ago · None stated GitHub repository of Open-Prep Daily Panel
1 stars

This long-only strategy identifies trend-following entries using moving average crossovers filtered by higher-timeframe trend alignment. It plots directly on the main price chart. Entries trigger when a fast exponential moving average crosses above a slow movi

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of MTF probe 10 - HTF bracket static

P_fmt_crlf

by GammaExpansion
1 stars

P_fmt_crlf is a basic test indicator that calculates a custom formula using the closing price and plots the result directly on the main chart area. It defines a user-defined function that doubles the input value and adds one, then executes this on the current

Indicator v6
Updated 7 days ago · MIT GitHub repository of P_fmt_crlf

SMC NQ Pro v3 - Auto SL/TP

by rosijay17-cmd
1 stars

An overlay indicator for smart money concepts on Nasdaq futures. It marks order blocks, fair value gaps, break of structure and change of character, liquidity sweeps and premium and discount zones, with lookbacks for each. London, New York and Asian sessions c

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 8 days ago · GPL-3.0 GitHub repository of SMC NQ Pro v3 - Auto SL/TP

DEPV2 DEBUG S27

by YuceSezar89
1 stars

DEPV2 DEBUG S27 is a multi-asset signal evaluation indicator designed to monitor up to twenty cryptocurrency pairs simultaneously. It classifies market behavior into four analytical dimensions: trend, momentum, volatility, and volume. The script supports multi

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S27

ATSYS Keep It Simple

by vedkanani123
1 stars

A price-chart indicator with Portuguese labels that combines Bollinger Bands, a fast 13 and slow 34 exponential average, and coloured clouds. Bands default to an exponential basis and can use simple, smoothed or weighted types. The average cloud changes colour

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of ATSYS Keep It Simple

TN HFT Engine

by raybird
1 stars

A smart money style strategy that scores setups from 0 to 100 using market structure, momentum, range context and liquidity sweeps, with fair value gaps and order blocks drawn on the price chart. Trades need a minimum score, optional higher-timeframe agreement

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN HFT Engine
1 stars

An indicator in a separate pane that shows how far each bar's high, low, close and optionally open, size or high-low combinations moved from the previous bar, as columns. Percentile levels over a chosen number of bars mark unusually large moves, and a cumulati

Indicator v6 Volatility & bands
Updated 1 year ago · None stated GitHub repository of Price Impulse Detector

RSI Divergence Scanner

by TradersPost
228 stars

The RSI Divergence Scanner calculates the Relative Strength Index and identifies regular and hidden bullish or bearish divergences against price using pivot high and low points. It plots divergence lines and customizable labels directly on the price chart. Inp

Indicator v6 Oscillators & momentumDivergence
Updated 3 months ago · None stated GitHub repository of RSI Divergence Scanner
99 stars

This indicator computes the Continuous Wavelet Transform magnitude of a chosen source series using a Morlet wavelet at one scale. It applies a Gaussian-windowed sine and cosine kernel over a window of about three scales, then plots the resulting power in a sep

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Continuous Wavelet Transform (CWT)
47 stars

This indicator plots a Hull Moving Average on the price chart. It computes weighted moving averages of the selected source over half the period and the full period, subtracts the full average from twice the half average, then smooths that difference with a wei

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Hull Moving Average (HMA)
16 stars

This strategy trades an asymmetric long and short trend system on the price chart. Longs use shorter Donchian entry and exit lengths, tighter ATR stops, more pyramid units, and a higher risk percent per unit than shorts. Each unit is sized from equity and stop

Strategy v6 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Seykota Alt 4: Asymmetric L/S

Markov State Engine classifies market conditions into six distinct regimes, including strong trends, weak trends, compression, and expansion. It evaluates historical state transitions using an exit-conditional Markov model with Laplace smoothing to estimate re

Indicator v6 AI / machine learningTrend
Updated 3 days ago · MIT GitHub repository of Markov State Engine [WavesUnchained]

Dual Super Trend Indicator

by eddiebelaval
7 stars

The Dual Super Trend Indicator calculates and evaluates Supertrend values across two customizable timeframes to determine combined trend direction. A bullish signal triggers when both timeframes register a bullish Supertrend direction, while a bearish signal t

Indicator v6 TrendVolatility & bands Repaints
Updated 3 months ago · None stated GitHub repository of Dual Super Trend Indicator

Supertrend [trugurpala]

by trugurpala
4 stars

This indicator calculates the ATR-based Supertrend line overlaid directly on the price chart to identify market trend direction. It computes upper and lower bands around the median price using Average True Range (ATR) scaled by a configurable multiplier. The s

Indicator v6 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of Supertrend [trugurpala]

Cycles Analysis

by regalouisei
2 stars

This indicator segments market history into bull and bear cycle periods based on user-defined percentage movements or elapsed time duration. It overlays cycle stages directly on the price chart using colored background highlights, peak and trough labels, and d

Indicator v6 TrendScreeners & dashboards
Updated 8 months ago · None stated GitHub repository of Cycles Analysis

McGinley Dynamic Indicator (MGDI)

by mushroom-men-Trading
2 stars

The McGinley Dynamic Indicator calculates an adaptive smoothed value that responds dynamically to recent price changes. It plots one line on the price chart to show trend direction and strength. Users set the lookback period for the initial average and the fac

Indicator v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of McGinley Dynamic Indicator (MGDI)
1 stars

This Pine Script strategy identifies trend changes by checking for crossovers between fast and slow EMAs on the current timeframe. It confirms the trend with a higher timeframe EMA confluence gate set to 60 minutes. The strategy draws its signals directly on t

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of MTF probe 11 - HTF bracket manual trail

P_fmt_long_line

by GammaExpansion
1 stars

The P_fmt_long_line indicator calculates a complex expression on a separate pane. It sums open, high, low, close values and derived ranges like hl2, hlc3 and ohlc4 across the current bar and the prior nine bars, plus their maximum and minimum. The result is as

Indicator v6
Updated 7 days ago · MIT GitHub repository of P_fmt_long_line
1 stars

An indicator in a separate pane that splits each bar's volume into a buy part and a sell part, drawn as stacked columns. The split is estimated from lower-timeframe sub-bars, each classed as up or down by its own close versus open, so it approximates order flo

Indicator v6 Volume
Updated 8 days ago · GPL-3.0 GitHub repository of Stacked Buy/Sell Volume Columns

DEPV2 DEBUG S28

by YuceSezar89
1 stars

DEPV2 DEBUG S28 is a Pine Script v6 indicator that draws in a separate pane. It watches up to twenty user-chosen symbols, defaulting to Binance perpetual crypto pairs, and combines four method classes: trend, momentum, volatility, and volume. Signal mode can u

Indicator v6 TrendOscillators & momentum Repaints
Updated 13 days ago · None stated GitHub repository of DEPV2 DEBUG S28
1 stars

An ICT-style strategy on the price chart that requires two confirmations before entering: an inverse fair value gap flip and a change in state of delivery, which is a structure break from recent swing levels. Optional filters are an EMA trend check, a liquidit

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN IFVG CISD Double Confirm

Price Spike Detector

by ivansoft
1 stars

An indicator in a separate pane that measures candle wick sizes, the distance from the body to the high and to the low, and shows them as columns for the chart timeframe along with 15-minute and 60-minute versions requested with lookahead. Percentile levels ov

Indicator v6 Volatility & bandsCandlestick patterns Repaints
Updated 1 year ago · None stated GitHub repository of Price Spike Detector

RSI Divergence Template

by TradersPost
228 stars

This indicator plots the Relative Strength Index in a separate pane and marks regular and hidden bullish and bearish divergences. It compares confirmed price pivots with RSI pivots within a lookback window: regular divergence contrasts a price extreme with the

Indicator v6 Oscillators & momentumDivergence
Updated 3 months ago · None stated GitHub repository of RSI Divergence Template

Coppock Curve

by mihakralj
99 stars

This indicator calculates the Coppock Curve as a weighted moving average of the sum of a long and a short rate of change of a chosen source. It plots that oscillator in a separate pane and draws a dotted zero line. Inputs set the source, the long ROC lookback,

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Coppock Curve
47 stars

This indicator applies the hyperbolic tangent to a chosen source series and plots the result in a separate pane. It centers the transform on a 200-bar simple moving average of that source, multiplies the deviation by a steepness factor, and maps the output int

Indicator v6 Moving averagesMean reversion
Updated 8 months ago · MIT GitHub repository of Hyperbolic Tangent (TANH)
16 stars

This strategy trades Donchian breakouts measured on weekly bars while orders execute on the chart timeframe. It allows long and short entries when price breaks the prior weekly channel and exits against the shorter weekly channel. Position size risks a set per

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 4: Weekly Donchian
9 stars

MFI Advanced is a separate pane volume-and-momentum oscillator that enhances the traditional Money Flow Index with pluggable smoothing options such as JMA, KAMA, and SuperSmoother. It plots a smoothed fast MFI line, a signal line, a slow trend context line, an

Indicator v6 Oscillators & momentumVolume
Updated 3 days ago · MIT GitHub repository of MFI Advanced [WavesUnchained]
4 stars

This trend-following strategy calculates the Supertrend indicator using average bar prices and Average True Range (ATR). It plots a color-coded trend line directly on the price chart along with buy and sell shapes. The strategy enters a long position when the

Strategy v6 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of Supertrend Strategy [trugurpala]

MESA Adaptive Moving Average (MAMA)

by mushroom-men-Trading
2 stars

The MAMA indicator calculates the MESA Adaptive Moving Average and Filtered Adaptive Moving Average using Ehlers' MESA algorithm. It plots both lines in yellow directly on the price chart as a smoothed trend indicator. Main settings include the source series a

Indicator v6 TrendMoving averages Repaints
Updated 9 months ago · None stated GitHub repository of MESA Adaptive Moving Average (MAMA)
1 stars

This indicator identifies bullish Change of Character (CHoCH) structure shifts directly on the price chart using pivot swing points. It tracks swing highs and lows governed by configurable left and right lengths and maximum swing age. The script highlights CHo

Indicator v6 SMC / ICT / price actionBreakout
Updated 4 days ago · None stated GitHub repository of REV Ladder (Best Bullish CHoCH)

Multi Indicator Score

by pineforge-4pass
1 stars

A strategy that builds a score from minus three to plus three using RSI against 50, price against an EMA, and price against the Bollinger mid line. It enters long when the score reaches two or more and short when it reaches minus two or lower. Positions close

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Multi Indicator Score

P_fmt_number_literals

by GammaExpansion
1 stars

P_fmt_number_literals is a test indicator that evaluates number literal syntax and formatting in Pine Script v6, including scientific notation, standard decimals, integers, and hexadecimal color definitions. It calculates a combination of variable assignments

Indicator v6
Updated 7 days ago · MIT GitHub repository of P_fmt_number_literals

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