8,340 free, open-source indicators, strategies and libraries for TradingView. Copy any script and paste it into the Pine Editor to use it on your chart.
This indicator calculates the range of each bar as high minus low and smooths those ranges into an average daily range. The user chooses a lookback length and a smoothing method: simple, exponential, or weighted moving average. It plots the resulting value as
Hulk Grid Algorithm V2 is a grid trading strategy designed for price charts. It establishes ten distinct grid levels around a user-defined mid price, spaced apart by a fixed dollar grid step. The strategy places long limit orders across these levels with scale
Zebra Week paints alternating background stripes on the price chart so consecutive time periods are easier to see. On a daily chart it shades even weeks; on a 15-minute chart it shades every other trading day using the week number and weekday. A single toggle
QQE MOD is a separate-pane oscillator that builds two smoothed RSI-based QQE trails. The primary trail uses a fast factor and Bollinger bands around the centered line; the secondary trail uses a smaller factor and a fixed threshold. It plots the secondary QQE
DailyLevels library supplies functions to fetch open, high, low and close values from daily bars using a daysPrior parameter. It supports daily and intraday charts while respecting session boundaries to prevent lookahead bias. The library tracks session start
The PIN BAR indicator identifies strong and weak pin bar candlestick patterns, including hammers and shooting stars, directly on the price chart. It evaluates pattern validity using major and minor wick-to-bar ratios, ATR volatility filters, volume thresholds,
This strategy enters long when price closes above the prior channel high and a longer EMA filter, the bar is bullish, volume rises versus the previous bar, and average volume and turnover clear set thresholds. It exits the long when price closes below a shorte
This indicator plots higher-timeframe candles and pivot point levels directly on the main price chart. It visualizes multi-timeframe price action through custom candle bodies, wicks, and central pivot range zones. As an analytical overlay, it provides visual r
This indicator calculates pivot highs and lows using a custom depth and deviation threshold to draw zigzag swing lines directly on the price chart. At each swing reversal, it plots labels displaying the reversal price, price change in absolute or percentage te
This strategy combines Momentum, Chande Momentum Oscillator, and Commodity Channel Index alongside standard deviation Bollinger Band bounds. It calculates oscillator values across customizable timeframes and lengths to track market momentum and volatility in a
The Range Filter indicator filters out minor price fluctuations directly on the price chart to provide a clearer view of underlying market trends. Inspired by QQE volatility concepts, it calculates a smooth range using methods such as ATR, Average Change, Stan
This overlay indicator plots a simple moving average on the crude oil chart and colors it according to RSI extremes and whether price sits above or below the average. It marks buy and sell labels when a prior bar crosses the average and the current candle conf
Supertrend is a trend-following overlay indicator that computes dynamic trailing bands based on the Average True Range and price action. It calculates the standard Supertrend line using customizable ATR length and factor multiplier inputs. Green lines plot bel
This indicator draws the 5-minute closing price on the chart for multi-timeframe analysis. It takes the number of bars for prediction as an input and initializes an array of predictors with recent close prices. A matrix is prepared for heuristic logic but rema
The Engulfing Candles indicator automatically identifies and highlights bullish and bearish engulfing candlestick patterns directly on the price chart. It checks whether the current bar fully wraps around the body of the previous bar and exceeds a customizable
This library builds real-time Smart Money Concepts context frames on each bar. It derives StructureFrame using engine primitives for BOS, CHoCH, trend and S-R levels. ImbalanceFrame tracks FVG lifecycle, BPR overlap, liquidity void and zone-bias. ZoneFrame man
This strategy stores a line inside a user-defined type and keeps an alias to the same drawing. It plots an 18-period simple moving average as a line on the price chart and reads that line's end price back through the alias. When the level is ready, it enters o
Plots a wide array of built-in Pine Script volatility calculations in a separate pane. It outputs true range variations, average true range across multiple periods, standard deviation, variance, mean absolute deviation, Bollinger Bands and Bollinger Bands Widt
This reference script demonstrates multiple usage examples of Pine Script's request.security function. It plots higher-timeframe data directly on the price chart, including the daily close, weekly high and low levels, daily 20-period EMA, and the previous day'
This Pine Script strategy plots pivot points and a SuperTrend-style trailing line based on ATR and center line derived from pivots. It calculates trend direction and generates buy and sell signals on trend reversals. Signals are filtered by a user-selected mov
This indicator implements a multi-metric confirmation engine that validates trading signals across four core dimensions: trend level scores based on an HLC3 SMA, momentum z-scores derived from rate of change, volatility expansion ratios comparing fast and slow
Calculates the WaveTrend oscillator using channel and average exponential moving averages alongside a simple moving average signal line in a separate pane. It plots the dual oscillator lines, their difference area, and configurable overbought and oversold thre
This Pine Script indicator detects pivot highs and lows on the price chart using the specified left and right pivot periods. It computes mirror levels based on two Fibonacci multiplier sets with an optional logarithmic scale for visualization. Auto-adjust scal
Higher Close Demo is a Pine Script v6 teaching indicator drawn on the price chart. It checks whether the current close is greater than the previous close. When that condition is true, it plots a green upward triangle below the bar. The script has no user input
This strategy trades Bitcoin mean reversion on the one-minute chart. It enters at Bollinger Band extremes when a short RSI is stretched, then requires ranging ADX on the one- and five-minute charts, a neutral five-minute RSI, and a flat five-minute EMA. Wick s
This overlay indicator tracks a multi-checkpoint setup built from trending exponential moving averages, Bollinger Band percent B, and a stochastic RSI crossover. A three- or five-bar fractal marks an unconfirmed signal, then the script stores breakout prices,
This strategy executes trades based on Triangular Moving Average (TMA) crossings, support and resistance structures, and breakout logic. It evaluates multiple confluence conditions including daily pivots, anchored VWAP, and multi-day moving averages alongside
This Smart Money Concepts (SMC) strategy identifies market structure, order blocks, imbalances, and premium or discount zones directly on the price chart. It executes long trades in discount zones and short trades in premium zones based on order block retests,
The 8_KLSE_Quality_Overlay is a Pine Script v5 indicator that overlays quality grades on the price chart for KLSE stocks. It combines user inputs from KC Chong 8-Criteria, Cold Eye 8-Criteria, Tong Kooi Ong tiers, and Tradeview MONEY equation to assign grades
This strategy plots a 12-period and a 26-period exponential moving average on the price chart. It enters long when the fast average crosses above the slow average and enters short when the fast average crosses below the slow average. Opposite signals reverse t
This strategy generates buy and sell signals on the SP500 4H chart using EMA crossovers confirmed by MACD, filtered by ADX trend strength, RSI levels, and active London or New York sessions. It plots EMA 9, EMA 21, and EMA 200 on the price chart. Buy signals e
This indicator identifies shooting star candlestick reversal patterns directly on the price chart. It checks for a small real body, an extended upper shadow, and a minimal lower shadow following an uptrend of user-defined length. The script also requires a pri
BTC ATH Scaling tracks the all-time high price and calculates the percentage drawdown from that peak. It displays a real-time label offset to the right of the latest price candle showing the ATH level, current price, and percentage drop. The label color dynami
This strategy looks for mean-reversion entries when RSI crosses back through the oversold or overbought levels, or recovers from more extreme RSI readings. Optional divergence confirmation can require a price and RSI mismatch before entry. It opens one long or
This indicator automatically detects support and resistance levels using pivot point analysis on historical price data. It identifies potential resistance at pivot highs and support at pivot lows, storing up to the maximum number of unique levels (default 3 ea
RSGAlgo identifies consolidation ranges, support and resistance pivot levels, and price gaps directly on the chart. It calculates range bounds using a percentage threshold over a custom lookback period and highlights consolidation zones with background colorin
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
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
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
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
This indicator calculates the MACD histogram from the fast and slow exponential moving averages. It plots the MACD line, signal line, and a histogram divergence column on a separate pane. The histogram divergence uses green columns for positive changes and red
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
Squeeze Panel plots a volatility squeeze in a separate pane. It marks a squeeze when Bollinger Bands sit inside a Keltner Channel and marks when the bands expand outside it. The user chooses Money Flow Index or linear regression to color likely breakout direct
This indicator calculates the Stochastic oscillator (%K and %D) and scans for divergences between price swings and oscillator swings. It detects pivot highs and lows on both price and the stochastic lines using user-defined lookback intervals and tolerance thr
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
TRXBTC EMA Cross Strategy is a trend-following cryptocurrency strategy that executes trades based on single Exponential Moving Average price positioning and candle color. It plots a customizable EMA on the main price chart and triggers a long position when a b
The Quick Moving Average calculates a triangular-weighted moving average on the price chart. It plots the average line and can color it green when rising or pink when falling. Price bars and chart background receive matching colors based on slope. Settings con
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
The ForexR Pine Script Library collects open-source TradingView indicators, strategies and libraries that are published on GitHub. Every script links to its repository, so you can see the author's latest version, issues and licence. Where the licence allows it, the full code is on the script's page, ready to copy into TradingView's Pine Editor. Stars, updates and licences are synced from GitHub every day, and new scripts are added every week.
Each script is read automatically before it is listed: it must declare an indicator, strategy or library for Pine Script version 4 or later, and copies of the same code are listed only once. The summaries and tags are written automatically from the code and the README. They describe what a script does; they are not a recommendation, and nothing here is tested or endorsed by ForexR.
Indicators and backtests describe the past. Check any strategy in the Strategy Tester and on a demo account before you trade with it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.
Pine Script Library FAQ
What is Pine Script?
Pine Script is the programming language of TradingView. Indicators, strategies and libraries written in it run directly on TradingView charts: an indicator draws lines, zones or signals, a strategy places simulated trades that the Strategy Tester reports on, and a library holds functions other scripts can import.
How do I add a Pine Script to my TradingView chart?
Open a script here and press Copy script. In TradingView, open the Pine Editor at the bottom of the chart, create a new indicator or strategy, select all of the template text and paste over it. Press Save, then Add to chart. A strategy's trades appear in the Strategy Tester tab.
Are these Pine Scripts free?
Yes. Every script listed here is published on GitHub, so you can read and use it at no cost. ForexR shows the full code only when the author published it under an open licence, such as MIT, GPL or the Mozilla Public License that TradingView adds to new scripts. For other scripts the Copy button reads the file straight from GitHub. Check the licence before reusing code in your own work.
Why are there no Pine Script v3 or older scripts?
Pine Script versions 1 to 3 are years out of date and miss most of the functions current scripts rely on. The library lists scripts written for versions 4, 5 and 6, and you can filter by version. Version 6 is the current one.
What does "Repaints" mean?
A repainting script can change its signals after the fact: on the live bar, or when it reads a higher timeframe before that bar has closed. Its history then looks better than it would have traded in real time. Scripts where the code or the author says so are marked Repaints, and the "Hide repainting" filter leaves them out.
How does ForexR choose which scripts to list?
A crawler searches GitHub every week for Pine Script files, reads each one and keeps scripts written for Pine version 4 or later in repositories with at least one star. Copies of the same code are listed once, under the most-starred repository. Repositories that ship programs, hide downloads behind passwords or show signs of bought stars are left out. Stars, updates and licences are refreshed from GitHub every day, and the summaries are written automatically from each script's code and README.
Trade on TradingView With a Regulated Broker
Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.