Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 41)

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

EMA Crossover Strategy

by knectardev
1 stars

This strategy plots a fast and a slow exponential moving average on the price chart. It opens a long position when the fast EMA crosses above the slow EMA and closes that long when the fast EMA crosses back below. There is no short entry and no stop loss. Posi

Strategy v5 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of EMA Crossover Strategy

MACD-X by DGT

by webcrack4
1 stars

This indicator provides multiple MACD calculation methods including traditional, histogram, leader, and source-based variants. It plots the MACD line, signal line, and histogram on the price chart with SMA or EMA smoothing options. Crossover signals generate l

Indicator v5 Oscillators & momentumMoving averages
Updated 9 months ago · None stated GitHub repository of MACD-X by DGT

Volume Spike Detector

by surajmateti
1 stars

The Volume Spike Detector is a separate-pane indicator designed to highlight unusually high trading volume. It calculates a simple moving average of volume over a user-defined length and flags a spike whenever the current volume exceeds this average multiplied

Indicator v5 Volume
Updated 11 months ago · None stated GitHub repository of Volume Spike Detector

RSI Price Action

by feliperazeek
1 stars

This indicator calculates a 14-period RSI and marks overbought and oversold conditions directly on the price chart, using labels on candles, shaded background zones and an optional RSI line. It can show the current RSI value, print RSI values at set bar interv

Indicator v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of RSI Price Action

New Strategy Template

by NakliTechie
1 stars

New Strategy Template provides a basic Pine Script v5 boilerplate structure for developing custom automated trading strategies. It includes pre-configured inputs for lookback period, source price, and trade position sizing, as well as conditional structures fo

Strategy v5
Updated 1 year ago · MIT GitHub repository of New Strategy Template
1 stars

An EMA crossover strategy that allows up to three entries in the same direction. A fast EMA crossing above a slow EMA opens a long, and crossing below opens a short with a size taken from a risk percentage of equity divided by price. Every opposite cross close

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Pyramid Strategy with EMA Cross
1 stars

This strategy fades false breakouts of a rolling high and low. It goes long when the bar's low pokes below the prior lowest low of the lookback window but the close finishes back above it, and short in the mirror case at the highest high. Each trade has an ATR

Strategy v5 Mean reversionBreakout
Updated 1 year ago · None stated GitHub repository of Turtle Soup Strategy

Supertrended RSI

by munlit
1 stars

A separate-pane indicator that computes an RSI, smooths it with a selectable moving average type, and applies a Supertrend-style ATR band to it. The trend line flips when the RSI crosses the band, and colours show direction. Inputs set the RSI length, smoothin

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Supertrended RSI
1 stars

An overlay indicator that flags bars where volume jumps well above its recent average and the candle body is also much larger than the previous one. A signal needs volume above a multiple of the prior average, above its moving average by a set percentage, and

Indicator v5 Volume
Updated 1 year ago · None stated GitHub repository of Volume Multiplier Alert

RSI with Boll

by zhuzp98
1 stars

An indicator that plots a centred RSI, shifted so that the midline is zero, in a separate pane with reference lines at plus and minus twenty. It adds a moving average of the RSI and Bollinger-style bands around it, using an adjustable standard deviation multip

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of RSI with Boll

Hello world

by fiji-solutions
1 stars

This indicator requests external data from Quandl using the BCHAIN/CPTRV ticker and plots the resulting value as a line in a separate indicator pane. It functions as a basic educational example demonstrating how to retrieve external dataset series using the re

Indicator v5
Updated 2 years ago · None stated GitHub repository of Hello world

HH, LL, HL, LH Indicator

by akash-yellgetti
1 stars

A strategy-type script that draws the high, low and midpoint of an opening window each day, plus pivot-based support and resistance lines from left and right bar settings. It prints buy or sell labels when the close breaks a pivot level while an EMA-based volu

Strategy v5 Support & resistanceBreakout
Updated 2 years ago · None stated GitHub repository of HH, LL, HL, LH Indicator
1 stars

This small indicator demonstrates the PineTradingbotWebhook library on the price chart. On each confirmed bar it builds a sample webhook message for a long entry with example limit and stop levels, a quantity and an order reference, shows the message text in a

Indicator v5
Updated 2 years ago · MPL-2.0 GitHub repository of Testing PineTradingbotWebhook
1 stars

The Detrending Net Distance Ratio indicator computes the difference between current close and close prices at ten different lookback periods ranging from seven to three hundred sixty bars. It sums the positive differences to create a net value and sums their a

Indicator v5 DivergenceMean reversion
Updated 3 years ago · None stated GitHub repository of Detrending Net Distance Ratio
1 stars

A separate-pane tool that plots an RSI, 14 periods by default, in orange and overlays five exponential moving averages of the RSI at 3, 5, 8, 13 and 15 bars in different colors. Five dashed horizontal guide levels at 80, 70, 50, 20 and 10 can be edited or disa

Indicator v5 Oscillators & momentumMoving averages
Updated 4 years ago · None stated GitHub repository of RSI+EMAs for Bootsie Strat
1 stars

This indicator adapts a chop zone calculation, which measures the angle of an average price line, to colour the candles on the price chart instead of drawing a separate oscillator. It also plots a selectable moving average, with options SMA, EMA, ALMA, HMA, RM

Indicator v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Moving Average Chopzone Color

This indicator calculates and plots external range liquidity levels by identifying swing highs and swing lows across up to three configurable timeframes. Plotted directly on the main price chart, it highlights key pivot levels using high/low or open/close pric

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT External Range Liquidity Static Multi-timeframe (Swing High and Low)

Omar MMR [Alorse]

by Alorse
330 stars

Omar MMR is a long-only price-chart strategy that combines three exponential moving averages, RSI, and MACD. It enters long when price is above the slowest average, the fastest average is above the middle one, the MACD line crosses above its signal, and RSI is

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

VIX Term Structure

by namuan
318 stars

This indicator plots the implied volatility term structure for US equities in a separate pane. It requests close data for four Cboe volatility indexes: VIX9D (9-day), VIX (30-day), VIX3M (3-month), and VIX6M (6-month) on the current timeframe. For each index,

Indicator v5 Volatility & bandsMoving averages
Updated 2 months ago · MIT GitHub repository of VIX Term Structure

BinaryDecimalConversion

by ricardosantos79
261 stars

BinaryDecimalConversion is a Pine Script utility library designed for converting data between decimal integers and binary string representations. It exports functions to convert an integer value into a binary string and to parse a binary string back into a dec

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

This indicator uses a Lorentzian distance k-nearest neighbors classification algorithm to predict market direction based on up to five technical features, such as RSI, WaveTrend, CCI, and ADX. It compares current feature values against historical bar patterns

Indicator v5 AI / machine learningOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of Donald - Machine Learning Options

Swoosh Indicator

by harryguiacorn
220 stars

Swoosh Indicator is an overlay that marks directional conditions on the price chart. It checks whether four simple moving averages are stacked in order and whether the MACD line is above or below its signal line. When both agree, it plots a green up arrow belo

Indicator v5 Moving averagesOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Swoosh Indicator

Williams %R (v.4)

by capissimo
114 stars

Williams %R (v.4) is a custom momentum indicator displayed in a separate pane that calculates a scaled Williams %R oscillator over a user-defined lookback period. It enhances standard analysis by layering a secondary confirmation feature—selectable among CCI,

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Williams %R (v.4)
106 stars

A multi-timeframe Dollar Cost Averaging (DCA) trading strategy that combines signals from three RSI indicators, three CCI indicators, and Bollinger Bands. It places up to five weighted scale-in safety orders to lower the average entry price. The script offers

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of 3RSI 3CCI BB 5orders DCA Strategy+

Moon Dev GEX Sweep & CVD

by moondevonyt
92 stars

The indicator detects liquidity sweeps across key price levels and calculates a cumulative volume delta proxy. It uses pivot high and low lookbacks to identify swing points, marking sweeps when price breaks beyond a level and quickly closes back inside. Featur

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Sweep & CVD

Color picker showcase

by be-thomas
65 stars

This indicator plots the close price in a separate pane and colors each value by the current candle. When the close is above the open it uses teal, and when the close is at or below the open it uses red. It has no user inputs and does not generate entries, exi

Indicator v5
Updated 6 days ago · GPL-3.0 GitHub repository of Color picker showcase
56 stars

This indicator calculates an Exponential Moving Average and a Zero-Lag Moving Average to identify market trends on the price chart. It plots both moving averages and fills the space between them with color to highlight trend direction. Upon a crossover or cros

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of No-Lag MA Trend Levels

This strategy designed for Binance SOLUSDTPERP futures trading generates entries based on pivot high and low support or resistance levels, a 3-period EMA, and a custom smoothed trend filter line. It opens long or short positions when price confirms movement re

Strategy v5 TrendBreakout Repaints
Updated 2 years ago · None stated GitHub repository of SOLUSDTPERP - Strategy Candles Bar

Auto Fib Retracement

by TWODS-CAPITAL
37 stars

Auto Fib Retracement finds swing pivots on the price chart and draws Fibonacci retracement lines between the latest significant high and low. Deviation, scaled from ATR relative to price, and Depth decide how large a move must be before a new pivot replaces th

Indicator v5 Support & resistance
Updated 3 years ago · MIT GitHub repository of Auto Fib Retracement

Ta

by nersent
29 stars

This Pine Script v5 library exports thin wrappers around built-in technical analysis functions. It covers moving averages, momentum measures such as RSI and CCI, volatility tools including ATR and standard deviation, range extremes, cross detection, and runnin

Library v5
Updated 11 months ago · Custom licence GitHub repository of Ta
24 stars

This indicator plots a Cipher B-style oscillator in a separate pane and can source its calculations from Heikin Ashi candles when that option is on. It draws WaveTrend lines with optional buy, gold, sell, and divergence dots, plus overbought and oversold level

Indicator v5 Oscillators & momentumDivergence
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B Heikin Ashi
23 stars

MTF State of Delivery tracks lower timeframe and higher timeframe orderflow delivery states by identifying bullish and bearish delivery levels across timeframes. It plots confirmed and pending orderflow lines directly on the price chart and provides an optiona

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 4 weeks ago · Custom licence GitHub repository of MTF State of Delivery by traderprimez
20 stars

This indicator calculates a base moving average (EMA, SMA, WMA, or HMA) and projects multiple symmetrical envelope bands around it directly on the price chart. Users can adjust the length, source, moving average type, and initial envelope multiplier. Additiona

Indicator v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Multiple Moving Average Envelope

DI Engulfing C003

by ruckard
13 stars

This strategy trades bullish and bearish body engulfing patterns on the price chart. It allows longs only when price is above the 200-period exponential moving average and shorts only when price is below it. A long needs three consecutive red candles followed

Strategy v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of DI Engulfing C003

My ICT Concepts

by dbruce1990
12 stars

This indicator identifies core Smart Money Concepts on the main price chart, focusing on Fair Value Gaps (FVGs), market structure, swing points, and Change in State of Delivery (CISD). It highlights bullish and bearish imbalances using dynamic boxes that can a

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of My ICT Concepts

Study Alert Plot Example

by f-cksociety
11 stars

This indicator is a minimal example of dynamic alert messages. It plots the symbol's closing price in a separate pane under the title priceClose. It also declares one alert condition named Alert Close whose message inserts that plotted value and the ticker thr

Indicator v5
Updated 4 years ago · MPL-2.0 GitHub repository of Study Alert Plot Example

MFI Strategy - Eterna MCP

by EternaHybridExchange
9 stars

This strategy calculates the Money Flow Index (MFI) to identify momentum shifts, overbought or oversold states, and price divergences. It opens long entries when MFI crosses above the oversold level or displays bullish divergence while under the midline. It en

Strategy v5 Oscillators & momentumDivergence
Updated 7 months ago · MIT GitHub repository of MFI Strategy - Eterna MCP

Supertrend + ADX

by muammeryldrm42
7 stars

This strategy combines Supertrend direction with an ADX strength filter. It enters long when Supertrend flips to an uptrend and ADX is above the threshold, and enters short on a downtrend flip under the same filter, only while the position is flat. The Supertr

Strategy v5 TrendOscillators & momentum
Updated 3 months ago · MIT GitHub repository of Supertrend + ADX
7 stars

This indicator calculates and displays the aggregated profit and loss (PnL) for manual positions in EUR/USD, USD/JPY, and BTC/USDT. It requests hourly market close prices for each asset and computes individual and total returns based on user-entered entry pric

Indicator v5 Screeners & dashboards
Updated 4 months ago · None stated GitHub repository of My Position and PnL
7 stars

This strategy calculates standard Ichimoku Kinko Hyo components including the Tenkan-Sen, Kijun-Sen, Chikou-Span, and Senkou Spans A and B to plot the Ichimoku cloud directly on the price chart. It enters long positions when price and Kijun-Sen are above the K

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo: Basic Strategy
7 stars

This indicator calculates the ratio of bar volume to the absolute relative price change between the open and close prices. It plots the resulting values as a histogram column chart in a separate pane to help identify bars where high trading volume occurred alo

Indicator v5 Volume
Updated 3 years ago · MIT GitHub repository of Volume / Abs(Close/Open - 1)

SuperTrend

by trsdn
6 stars

This indicator plots the classic SuperTrend line on the price chart. It builds upper and lower bands from an ATR of the chosen source, then trails the band that stays active for the current direction. Direction turns up when price closes above the lower band a

Indicator v5 TrendVolatility & bands
Updated 7 days ago · MIT GitHub repository of SuperTrend

Triple MA Trend

by latentwill
4 stars

This strategy trades alignment of three simple moving averages on the price chart. A long opens when the short average crosses above the middle average while price stays above the long average. The opposite cross closes that long and opens a short. Length, sto

Strategy v5 TrendMoving averages
Updated 8 days ago · None stated GitHub repository of Triple MA Trend

Market Structure Tool [Lab]

by mitchell-917
4 stars

Calculates swing highs and lows using pivot point detection to map market structure on the price chart. It categorizes pivots as Higher Highs, Lower Highs, Higher Lows, or Lower Lows, while connecting swing points with trend lines. A top-left dashboard label d

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 11 months ago · Custom licence GitHub repository of Market Structure Tool [Lab]
4 stars

This indicator scans up to ten user-selected symbols for regular RSI divergence and for RSI extremes. It compares confirmed pivot lows and highs in price and a 14-period RSI, then sends a bullish alert on a price lower low with an RSI higher low and a bearish

Indicator v5 Oscillators & momentumDivergence

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