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 library calculates arrays of daily price deviations from the open to the high, low, and close over a user-specified number of days. It optionally filters outliers using a maximum deviation threshold. The fromOpen function returns a normalized value showin
This indicator draws a volume profile on the price chart over a configurable lookback. It splits price into rows, colors up and down volume, and can mark the point of control, value area, value area high, and value area low. Peak and trough volume nodes are fo
MA Based Trend BarColor plots three configurable moving averages directly on the price chart. Users can customize the calculation type (SMA, EMA, or VWMA), source price, and lookback length for fast, medium, and slow periods. The script evaluates the stacked a
This indicator plots daily trading range lines on the price chart using higher timeframe data. It detects new trading days and draws the open price line in white, upper and lower ATR bands in aqua based on the ATR length and multiplier, yesterday's high in red
This indicator overlays high time frame candles and pivot points on the current price chart. It plots candles from selected higher timeframes using open-close, high-low or both display styles with optional wicks and bar colors. Pivot points follow traditional
This indicator calculates pivot highs and lows using a defined period to draw ZigZag lines directly on the price chart. It projects customizable Fibonacci retracement levels and ratio labels across identified pivot swings. It also displays real-time retracemen
This strategy evaluates low timeframe range breakouts filtered by higher timeframe inside bar conditions. It uses security calls to fetch higher timeframe price data to detect inside bars and color-code the chart background and bars. A customizable session fil
Trading Rush Choppy Market identifies trending versus choppy market conditions based on consecutive bar close price movements. It evaluates sequences of higher or lower closes over the previous six bars to assign trend strength levels. When conditions indicate
This indicator detects trend changes and divergences using a Zigzag tool combined with an oscillator such as RSI or external sources. It plots zigzag lines on the price chart to mark potential trend reversals and identifies regular and hidden divergences. The
This indicator plots smart money concept structures directly on the price chart. It detects and visualizes market structure elements including change of character, break of structure, swing points, inducements, and liquidity sweeps. Additionally, it identifies
This indicator draws price data on the chart. It uses a plot budget function to limit the number of plots and displays close, high, and low prices. The script also provides functions to draw dynamic boxes and lines on the price chart. Arrays manage these objec
Calculates a 9-period fast EMA, 21-period slow EMA, and 200-period trend EMA overlaid on the price chart. It enters long positions when the fast EMA crosses above the slow EMA while price is above the 200 EMA, and short positions when the fast EMA crosses belo
This indicator builds a smart-money context frame in a separate pane by calling a private context engine. It exposes hidden numeric plots for schema version, readiness, bias, quality, market structure including break of structure and change of character, imbal
This validation strategy monitors price crosses against a dynamic level derived from a 20-period simple moving average drawn as a line object. It enters a long position when the closing price crosses over the line level and exits when price crosses under it. A
This Pine Script v6 indicator plots results from string functions including length, position, substring, replace, trim, split, upper, match, and contains. It also demonstrates type conversions with int, float, and tonumber, plus operator precedence examples su
This script is a simple moving average crossover strategy. It calculates and plots two SMAs on the price chart: a fast MA of length 9 and a slow MA of length 21. It generates long signals on the crossover of fast MA above slow MA and exits positions on the cro
This strategy compares Bollinger Bands and Keltner Channel to detect volatility regimes. It plots the bands and their difference along with the RSI of the difference on the price chart. Entries and exits occur on transitions in the volatility state, controlled
The script calculates a weighted average of Heikin Ashi score values across four multi-timeframe periods derived from the signal timeframe. It also counts bullish and bearish signals from each timeframe and checks whether the required number of confirming sign
Calculates retracement grid levels on the price chart using confirmed swing pivot highs and lows based on a user-defined pivot lookback. It allows traders to compare traditional Fibonacci levels against alternative ratio sets, such as thirds or an arbitrary 0.
TradeModeLibrary is a helper Pine Script library providing standardized trade state management logic for custom trading strategies. It exports functions representing different execution modes that accept position active status and signal directions. Based on t
This indicator projects mirrored price and time targets based on user-defined reference points and detected swing pivots. It calculates mirror levels across linear or logarithmic scales, factoring in volatility ratios via short- and long-term ATR comparisons.
First Line is an introductory Pine Script v6 indicator that draws a constant horizontal value of 50 in a separate pane. It does not calculate price, volume, or oscillator data and does not generate buy or sell signals, entries, exits, or alerts. There are no i
This strategy calculates the Z-score divergence of return spreads between two forex assets such as EURUSD and GBPUSD. It enters long positions when the Z-score falls below the entry threshold with confirmed uptrend from EMA, RSI and MACD filters plus sufficien
This indicator overlays multiple smoothed moving averages, candlestick reversal patterns, and trading session highlights directly onto the price chart. It calculates 21, 50, optional 100, and 200-period smoothed moving averages alongside a short-term moving av
This strategy implements directional trading plans inspired by small-cap momentum patterns, incorporating Triangular Moving Average (TMA) crossings, VWAP thresholds, and breakout logic. It enters trades based on customizable combinations of price triggers, TMA
The SMC Market Structure Indicator identifies swing points and market structure on the price chart using Smart Money Concepts. It detects higher highs, higher lows, lower lows, and lower highs based on seed mode settings and pivot length. The script plots Brea
KLSE Market Regime Dashboard displays a macro market regime overview and sector relative strength metrics in an on-chart table. It retrieves daily data from global macro benchmarks (FBMKLCI, Dow Jones, S&P 500, VIX) and key Malaysian sector leadership proxies
Multi Variable Declaration is a strategy designed to demonstrate multiple variable declaration syntax within a trading model. It calculates a 12-period price channel midpoint alongside an exponential moving average spread (EMA 9 minus EMA 21) to establish tren
This strategy detects Opening Range Breakouts on indices during the New York trading session. It captures the high and low of the initial 30-minute bar from 9:30 to 10:00 AM ET. Signals trigger on price crossing above the range high when combined with an EMA 2
This indicator identifies high and low pivot points based on a user-defined leg length. It stores historical pivot prices and timestamps within custom object arrays. On the final confirmed historical bar, the script renders text labels displaying price values
BTC ATH Golden Cycle v5 is a Bitcoin-focused strategy that models long-term market trends based on Bitcoin halving cycles. It combines a ZigZag pivot library, Neo-Ichimoku Cloud, Rainbow ribbon visualizer, Geometric Mean Index, and automated Supply and Demand
Calculates classic support and resistance pivot levels using Traditional, Fibonacci, or Camarilla formulas from a higher timeframe. The strategy offers two execution modes: Bounce mode trades reversals within a customizable percentage buffer of support and res
Supertrend Enhanced plots a classic ATR Supertrend on the price chart and marks trend flips as buy and sell signals. It builds upper and lower bands from an ATR or a simple moving average of true range, then flips direction when price crosses the opposite band
The HybridAlgo Multi-Indicator Strategy calculates signals from moving average crossovers, RSI, MACD, and Bollinger Bands. Long and short entries trigger when at least three signals align for confluence. It sets stop loss at three times ATR below entry and tak
This indicator calculates the RSI and detects regular and hidden divergences between price and RSI pivots. It plots the RSI on the price chart overlay and marks bullish regular, bearish regular, bullish hidden and bearish hidden divergences with labels. Horizo
This overlay indicator plots up to four independent sets of higher-timeframe pivot support and resistance lines on the price chart. Each set has its own on/off switch, pivot length, timeframe, line style, and color. Defaults use 240-minute, 720-minute, daily,
This strategy plots the Relative Strength Index in a separate pane and fades extremes. It opens a long when RSI crosses back above the oversold level and a short when RSI crosses back below the overbought level. Open trades exit at a percentage stop loss or ta
This script serves as a starter template for building custom TradingView Pine Script indicators. It defines basic input settings including a length value and source selection, then provides empty sections for adding calculations and plot statements. The script
This indicator tracks DeMark's TD Sequential 9 and 13 setup and countdown conditions directly on the price chart. It compares the current close price to the close four bars prior to determine setup counts, switching direction when price crosses. When setup or
Demonstrates symbol information functions alongside basic Average True Range (ATR) conversions. It calculates a 14-period ATR, converts the values into mintick points and pips, and plots each metric in a separate pane. Additionally, on the most recent historic
This indicator calculates the Relative Strength Index (RSI) applied to various volume-weighted indicators, including Accumulation/Distribution, Elder's Force Index, Money Flow Index, On Balance Volume, and Price Volume Trend. The resulting volume-RSI values ar
This indicator detects RSI failure swing patterns and projects corresponding support, resistance, and swing levels onto the chart. It calculates a standard Relative Strength Index across a configurable lookback window to identify pivot highs and lows, drawing
The indicator computes bias and mbias curves from typical price relative to highest and lowest closes across periods 3, 6, 9, 12, and 20. It sums the positive and negative biases then negates and plots them as b (red) and s (green) lines in a separate pane to
SlimTrades 2h is an intraday strategy overlaying short-term high and low price channels alongside momentum measurements from MACD and RSI. It tracks local highs and lows over a user-defined lookback period, plotting them directly on the price chart. The script
The RSI-ADI-Combo indicator combines Relative Strength Index (RSI), Money Flow Index (MFI), and Average Directional Index (ADX) into a single separate pane visualizer. It plots RSI and MFI line graphs along with a color-coded ADX column histogram that highligh
This indicator measures the chart symbol’s percentage change from the opening price at the start of each US presidential term and plots those values as histogram columns in a separate pane. Columns are offset so each administration appears separately, with a s
This indicator plots ICT Fair Value Gaps and internal external range imbalances on multiple high timeframes. It detects liquidity pools and potential reversal zones by analyzing range structures. Three customizable timeframes allow selection of colors and bar
Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma
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.