Version 5 was the main Pine version for several years, so many of the best-known open-source scripts use it. A v5 script declares //@version=5 on its first line and keeps working in TradingView.
If you want to edit or extend one, the Pine Editor can convert it to version 6. Check the converted script on a chart afterwards: a few behaviours changed between versions.
592 of these 4,643 scripts are marked Repaints, or read higher-timeframe data with lookahead on.
Before You Use One
Run it as it is before converting it.
After any conversion, compare the plots with the original.
Read the Risk Notes for repainting and lookahead.
Pine Script v5: Indicators, Strategies and Libraries
Range Volume Change compares volume inside a chosen session window with the same window on the previous day and plots that change as a percentage. It accumulates volume during the window and, when enabled, volume outside it, drawing growing columns in a separa
This indicator classifies each bar as bull, bear, or sideways from a rolling log return compared with adjustable percentage thresholds. It paints a regime ribbon on the price chart, shows a current-regime banner, and labels state changes after a minimum hold.
This indicator plots five custom moving averages on the price chart, using EMA, SMA or WMA types with periods of 10, 55, 200, 20 and 100. It highlights multiple crossovers between the MAs including MA1-MA2, MA1-MA3, MA1-MA4, MA1-MA5, MA2-MA3, MA2-MA4, MA2-MA5,
This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can
This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk
AIActivationFunctionsBipolarSigmoid is a Pine Script library that provides mathematical implementations of the bipolar sigmoid activation function and its derivatives for machine learning algorithms. It calculates bipolar sigmoid values bounded between -1 and
The Body Mass Indicator highlights candles with exceptionally large body ranges relative to recent price movement. It calculates the absolute distance between open and close prices. When enabled, it identifies bars where the body range achieves a new high over
Storm Gauge calculates annualized realized volatility and compares it against a historical percentile lookback window to classify market volatility regimes into calm, normal, or storm conditions. Based on a target volatility input, it calculates dynamic positi
This indicator combines Bollinger Bands, RSI, Stochastic RSI, and volume spike detection to identify mean-reversion conditions during range-bound market regimes. It calculates Bollinger Band width to identify low-volatility states and triggers buy or sell sign
TriexDev - SuperBuySellTrend is an ATR-based trend indicator that plots dynamic trailing bands and trend direction directly on the main price chart. It calculates trend levels using customizable ATR multipliers to identify trend direction and potential reversa
Generates simulated order signals and tracks dollar-cost averaging (DCA) cycles to test webhook execution software. It marks buy signals on bearish candles and sell signals on bullish candles, with optional DCA logic that requires lower consecutive entries and
This indicator measures market consolidation and breakout phases by computing a scaled Relative Strength Index (RSI) on normalized price data. It identifies chop zones when the RSI oscillates between 40 and 60, highlighting tight consolidation between 45 and 5
This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy combines three Exponential Moving Averages with Williams Fractals to execute trend-following or mean-reverting trades. It analyzes price structure using short, medium, and long-term EMAs along with fractal highs and lows. Entries trigger when fra
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem
This indicator plots the 20-period RSI on the chart along with a horizontal line at 50. It detects crossovers above 50 for long signals and crossunders below 50 for short signals. Entries are controlled by two input booleans allowing longs and shorts separatel
Forex Sessions highlights specific global trading hours directly on the main price chart using background colors. It tracks three major market sessions using predefined time ranges: Tokyo, London, and New York. Active session hours are distinguished by distinc
Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open
Copilot is an order flow range-reversal indicator designed to overlay trading setups directly on the price chart. It evaluates four criteria: market context (sideways vs trending regime based on ATR height), structure (double top or double bottom retests), abs
This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req
This indicator tracks and visualises cryptocurrency derivatives positioning data across major perpetual exchanges, including Binance, BitMEX, and Kraken. It calculates net longs, net shorts, delta, or position ratios and plots them in a separate pane as candle
This overlay strategy targets one-minute ATOM scalps. It tracks pivot highs and lows as resistance and support, compares a three-period EMA with a multi-stage smoothed close, and flags long or short when price crosses that curve in the matching direction. Dail
This strategy trades longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian
This overlay indicator estimates realized volatility from log returns and annualizes it with a user-chosen periods-per-year setting. It ranks that volatility against a trailing lookback to label calm, normal, or storm regimes, and it converts a target volatili
This indicator plots a rolling 24-hour volume total as columns in a separate pane. On each bar it builds a running sum of volume over the last 24 hours, using a one-minute, five-minute, or hourly series depending on the chart timeframe. When the symbol's volum
This strategy enters directional trades based on MACD histogram zero-line crossovers filtered by a safety threshold. Users toggle long or short trading modes independently. MACD lines can be calculated using simple or exponential moving averages. Exits execute
This indicator calculates forex position sizing in lots based on hardcoded risk and stop-loss parameters. It queries the 5-minute closing price of a user-configurable conversion currency pair using a security call to convert risk across currencies. The script
This indicator scans up to thirty symbols simultaneously against selected technical strategies, such as moving average crosses, price strength, or volume momentum. It displays long and short signals using shapes, labels, and horizontal lines directly inside a
This indicator plots an exponential moving average on the price chart and formats structured JSON alert payloads on confirmed bar closes. It is designed to export real-time market data to external webhook receivers or AI assistant backends. Inputs allow users
This indicator plots the Average Directional Index with plus and minus directional indicators in a separate pane. It builds directional movement from true range using Wilder's smoothing, then draws ADX, plus DI and minus DI against a dotted trend-strength line
This script serves as a boilerplate strategy template featuring modular trade execution and order management. It includes placeholder buy and sell signals intended to be completed by the user. The template provides customizable risk management features includi
The Hedge Scalp indicator calculates an Exponential Moving Average (EMA) and generates four long grid levels and one hedged short grid level at user-defined percentage distances below the EMA. It models grid entry execution and average entry take-profit levels
This indicator computes several classic studies in a separate pane: Bollinger Bands from a simple moving average and standard deviation, an inverse-Fisher transform of the CCI smoothed by a weighted moving average, RSI, MACD with a histogram, and Stochastic RS
LuxAlgo Hybrid Gold Scalper is a price-chart strategy aimed at gold. It stacks a fast, slow, trend and 200-period bias EMA to mark trend direction, then filters strength with RSI, ADX and an intraday VWAP. Swing highs and lows are marked from pivot length. Set
This multi-indicator modular strategy evaluates market entries by requiring consensus across a selectable suite of technical tools, including Absolute Strength, SSL Channel, Squeeze Momentum, and WaveTrend. Once conditions are met, it executes entries and scal
A diagnostic utility that tests floating-point precision and epsilon limits in Pine Script. It evaluates multiple arithmetic comparisons using tiny numeric offsets against runtime calculations to avoid compile-time folding. The script formats the boolean test
This indicator identifies Qullamaggie-style momentum trading setups, including Breakout, Episodic Pivot (EP), and Parabolic reversals. It evaluates prior moves, consolidation tightness, volume expansion, moving average alignment (50 SMA and 20 EMA), and stretc
3hr Stoch is a short-only trading strategy based on a smoothed Stochastic Oscillator. It calculates the %K and %D lines using configurable period and smoothing settings. The strategy enters a short position when the %K line crosses below the %D line while drop
The Adaptive Money Flow Index indicator dynamically adjusts its lookback length using John Ehlers dominant cycle measurement technique. It filters the input source using a high-pass filter and a SuperSmoother filter, applying Pearson correlation and spectral a
Marubozu Finder identifies classic bullish and bearish Marubozu candlestick patterns based on the previous completed bar. It detects a bullish Marubozu when the previous bar's high equals its close and its low equals its open. Conversely, a bearish Marubozu is
This indicator highlights Inner Circle Trader (ICT) killzones and key session pivot points directly on the price chart. It projects shaded boxes for specific trading sessions, including Asia, London, NY AM, NY Lunch, and NY PM, to help traders identify high-li
Indicatorv5SMC / ICT / price actionSessions & time
This indicator calculates the Relative Strength Index (RSI) alongside a simple moving average to generate directional momentum signals in a separate pane. It supports Break Flip and Break Continuous scanning modes for long and short setups. A wide array of opt
This strategy calculates a standard moving average convergence divergence oscillator and executes trades directly on the main price chart. It opens a long position when the histogram delta crosses above zero and enters a short position when it crosses below ze
This overlay indicator plots the 100-period and 200-period exponential moving averages on the price chart and marks buy or sell triangles after an EMA crossover when the next two candle opens stay on the correct side of the 100 EMA and price stays within a sym
P404 Smoke is a price-chart strategy that sequences an optional higher-timeframe EMA bias, a liquidity range from recent pivots, a sweep of buy-side or sell-side liquidity, and a market structure shift within a set bar window. Comments state it then looks for
This indicator detects bullish and bearish engulfing candlestick patterns on the main price chart based on configurable bar fullness and height filters. It identifies specific pattern variations, including 3-Strike reversals and 180-degree turnarounds, marking
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.