10,850 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.
Calculates up to four customizable Supertrend indicators using Average True Range (ATR) and user-selected price sources. It generates long and short trade signals when designated Supertrend instances switch direction, provided other configured Supertrend trend
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.
This demonstration script illustrates the usage of the array sorting function in Pine Script v4. It creates two float arrays with fixed numerical values and evaluates the final bar state on the chart. If the last bar is bullish, it sorts the first array in asc
This indicator calculates John Ehlers' Hilbert Transform Trend Mode algorithm to classify whether the market is trending or cycling. It computes in-phase and quadrature components from a smoothed price input to determine dominant cycle phases, an instantaneous
Plots trading session ranges for New York, London, and Asia directly on the price chart. The indicator draws customizable boxes highlighting the high and low of each session, with options for dotted borders, background transparency, and identifying labels. It
This overlay indicator marks a bullish dragonfly doji on the price chart. It treats a candle as a doji when the range is positive and the body is no larger than five percent of the range, then requires the upper shadow to be no larger than the body. On a match
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
This strategy applies k-nearest neighbors machine learning to fast and slow moving average crossovers to filter entry signals. It overlays directly on the price chart and incorporates built-in Zignaly alert triggers for automated execution. Traders can configu
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
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
Apex Protocol v3.0 - The SMC Engine is an overlay indicator designed for Smart Money Concepts (SMC) trading strategies. It detects market structure shifts (MSS), breaks of structure (BOS), M5 Fair Value Gaps (FVG), Order Blocks (OB), and Asian session ranges.
This long-only strategy template provides boilerplate logic for building custom Pine Script trading systems on the price chart. It features built-in risk management that calculates target exits and stop-loss levels using either percentage-based distances or Av
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
Calculates buy and sell volume pressure alongside the Awesome Oscillator to scan for market divergence opportunities. It initiates long and short strategy entries when divergence signals meet conditions, optionally filtered by New York trading session hours an
This overlay indicator combines SuperTrend, RSI, MACD, and an EMA to mark labeled tops and bottoms on the price chart. Optional filters hide repeating signals and keep only relevant exits, and a Krypton fear-and-greed filter can limit bottoms and tops to overs
MTF FVG indicator detects fair value gaps across multiple user-selected timeframes and plots them as colored boxes directly on the price chart. Bullish FVGs form when recent lows exceed prior highs while bearish FVGs form when recent highs fall below prior low
Calculates a 24-period Volume-Weighted Moving Average (VWMA) and RSI divergence using 60-minute timeframe data, accompanied by percentage-based envelope bands and Williams Fractal logic. The indicator plots the VWMA line alongside customizable upper and lower
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
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
The Q-Trend Strategy is a trend-following overlay strategy that identifies directional bias using dynamic price channels combined with an ATR volatility buffer. It calculates highest highs and lowest lows over a chosen trend period to establish a baseline midp
This Pine Script indicator generates alerts based on bar close conditions. It defines hc as close greater than high[1] and lc as close less than low[1], then computes RSI with length 14. The script calls alert() with dynamic messages that include close price a
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
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
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
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
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
Atomic Tick Predictor — Statistical Next-Candle Engine estimates the likelihood of the next candle direction by combining a K-Nearest Neighbors algorithm with live tick updates. It tracks up and down ticks, tick volume, and price pressure within the active bar
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
The first release of a bearish-side detection indicator for higher timeframe charts. It draws numbered signals on the price chart from relative volume tiers, displacement using a nine standard deviation default multiplier, a VWMA with ATR Supertrend latch, poc
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
Squeeze2backtester is an indicator-based backtester that identifies volatility squeezes by comparing Bollinger Bands with Keltner Channels. It simulates trade executions directly on the price chart, tracking entry prices, stop-loss thresholds, breakeven levels
A Pine Script v5 indicator in a separate pane, the second revision of a Hurst spectral oscillator. It passes the hl2 price through bandpass filters for cycles from 1 day upward and draws the cycle waves with a composite line. A single bandwidth value applies t
This indicator identifies regular and hidden divergences across up to ten technical oscillators simultaneously, including RSI, MACD, Stochastic, CCI, Momentum, OBV, VW-MACD, CMF, MFI, and an external source. It plots divergence lines and text labels directly o
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
This indicator plots a Relative Volatility Index in a separate pane. It compares exponential moving averages of upward and downward close-price standard deviation and scales the result from 0 to 100. Horizontal lines mark 80 and 20. Regular bullish and bearish
A Pine v4 strategy that plots a 66-period weighted moving average and combines a 12/26 MACD, a 14-period RSI, candle sizes and rolling highs and lows over a long lookback. Inputs set take-profit and stop-loss percentages for each side, the long lookback and th
Moving Median calculates the 50th percentile value of a specified price source over a user-defined lookback period using the nearest rank method. It plots directly on the main price chart as a single line. When trend highlighting is enabled, the plot changes c
This momentum strategy combines the Moving Average Convergence Divergence and Directional Movement Index indicators to generate long trading signals. It enters a long position when the MACD line crosses above its signal line while positive directional movement
This indicator plots historical buy and sell transactions executed by ARK Invest funds for Alibaba stock directly on the price chart. It renders green upward labels below price bars for purchases and red downward labels above price bars for sales, displaying t
This Pine Script library provides a collection of atomic and nuclear physical constants based on CODATA reference values. It exports functions returning fundamental physical measurements, including the fine-structure constant, Rydberg constant, Bohr radius, Ha
This indicator builds a footprint of estimated buy and sell volume across price rows and plots it in a separate pane. It fills rows from bar low to high, stores volume per row, and draws buy and sell volume boxes, volume-profile boxes, row labels, and cumulati
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
This indicator builds an aggregate oscillator in a separate pane. It scales open, high, low, close, and volume into a 0 to 1 range, then averages scaled readings from MACD, a MACD histogram, RSI, stochastic, CCI, momentum, OBV, a directional index, volume-weig
This strategy identifies mean reversion opportunities using ATR bands on the price chart. It enters long positions when price touches the lower band (open minus ATR) with no open position and within the set time filter. Positions exit on the upper band breach,
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
This script calculates a 14-period Average True Range (ATR) indicator and displays its current value inside a single-cell table positioned at the top right of the price chart. To ensure accurate historical calculation while optimizing table performance, the AT
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
This indicator tracks regular trading hours for Nasdaq futures on the price chart. It stores the current session open, high, and low and keeps yesterday's RTH high and low. It can draw those levels as lines with labels shifted a chosen number of bars to the ri
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.