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.
This overlay strategy looks for long pullbacks in an established uptrend. It requires the short entry EMA to sit above the trend EMA by a minimum slope, price to stay within a set pullback of that short EMA, and close to remain above a fixed 60-period EMA. It
This indicator classifies the current bar by comparing its feature vector with historical bars using Lorentzian distance and a k-nearest-neighbors vote. Configurable features include RSI, WaveTrend, CCI, and ADX. Optional volatility, regime, ADX, and EMA filte
This indicator plots reference levels and session markers directly on the price chart. It calculates and draws lines for the daily open, weekly open, monthly open, previous day OHLC, and previous week extremes, along with a selectable day-of-week range and ini
This indicator calculates a 20-period RSI of the close and plots it in a separate pane with a horizontal line at 50. It marks an RSI cross above 50 with a small up triangle and a cross below 50 with a small down triangle. On those same crosses it calls alert w
This indicator calculates Bollinger Bands from the close, using a chosen length and standard-deviation multiplier, then reads the middle, upper, and lower values from a user-selected timeframe. It plots those three bands on the price chart. The timeframe input
Nonsense is a mock Pine Script strategy script designed as a syntax testing script within a code editor extension repository. It defines custom type declarations, matrix and array object creations, and placeholder function logic using obfuscated variable names
BTC MACD Basic Tests implements a Pine Script unit-testing framework designed to validate components of a long-only Bitcoin MACD trading system. It constructs structured test cases to evaluate mock functions for MACD crossover calculations, volume threshold ch
Trading Sessions is an overlay indicator that highlights major market trading sessions such as Tokyo, London, and New York directly on the price chart. It draws customizable session boxes along with optional open and close price lines, average session prices,
Bgcolor Example is a minimal demonstration indicator written in Pine Script v6 that visualises bar polarity across the price chart. It checks whether the current close is lower than the open and dynamically tints the chart background red for bearish bars or gr
This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en
This script calculates and plots an Exponential Moving Average (EMA) directly on the price chart. It uses Pine Script's built-in moving average calculation over a customizable period length and input price source, defaulting to a 9-period close price. The resu
This indicator calculates and plots Acceleration Bands directly on the main price chart. It computes simple moving averages of high, low, and close prices using circular buffers. The middle line displays the close moving average, while upper and lower envelope
This strategy calculates a Relative Strength Index (RSI) applied to the Volume Weighted Average Price (VWAP) rather than standard close values. It plots dedicated long and short RSI-VWAP lines with customizable overbought and oversold thresholds, alongside an
The Daily Floor Pivots indicator calculates standard daily pivot points alongside support and resistance levels up to five tiers. In addition to standard pivot lines, it projects Fibonacci Golden Zone channels between adjacent pivot levels such as PP to R1 or
This indicator measures how extreme current Average True Range is versus recent history. It calculates ATR, converts it to a percentile rank over a lookback window, and smooths that rank with an EMA. Both series plot in a separate pane, with a color gradient f
BTC Multiples calculates and displays Bitcoin macro valuation metrics in a separate pane, including the Mayer Multiple, Stock-to-Flow Multiple, Difficulty Multiple, and Puell Multiple. Each valuation multiple features configurable overvalued and undervalued th
This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price
Natal & Transit Planetary Aspect Table displays an on-screen table comparing natal planetary positions with live or historical transit positions based on financial astrology principles. It calculates positions using geocentric or heliocentric coordinates and h
This strategy overlays two exponential moving averages on the price chart to trade reversals using custom Fair Value Gaps and the Relative Strength Index. It enters long trades when price closes bullishly below both moving averages with an oversold RSI and a g
This indicator fetches and plots weekly Commitment of Traders (COT) net position data in a separate pane using TradingView's official COT library. It displays positioning breakdowns for selected futures markets under either Legacy or Financial (TFF) reporting
This indicator maps a composite macro risk score onto Vietnamese indices and sectors in a separate pane. It combines liquidity stress, curve shape, the international yield spread, and the ten-year versus policy-rate spread, then groups regimes with hysteresis.
This indicator identifies the Bullish Abandoned Baby candlestick pattern directly on the price chart. The three-bar reversal pattern consists of a strong down candle during an established downtrend, followed by a lower gapping doji candle, and completed by an
NostalgiaForInfinityV2 is a multi-timeframe mean-reversion strategy derived from the popular Freqtrade algorithmic trading framework. It evaluates price behavior using dual Bollinger Bands, RSI, exponential moving averages, and ATR volatility metrics sampled a
This overlay indicator plots Bollinger Bands around a simple moving average, three exponential moving averages, and RSI-based markers on the price chart. Triangles mark RSI below the oversold level or above the overbought level, and arrows mark RSI crossing th
This indicator marks confirmed swing highs and swing lows on the price chart. It uses TradingView pivot high and pivot low functions with separate strength settings for highs and lows. When a pivot is confirmed, it draws a label above or below the bar showing
This indicator plots a Bollinger-style envelope on the price chart. It calculates a simple moving average of the selected source and a standard-deviation band width set by the multiplier. It draws the basis, two lines offset by a small fraction of the basis as
This indicator tracks and plots open profit and loss in a separate pane for a custom crypto hedge scalping strategy. It calculates an exponential moving average and establishes four long grid levels and one hedged short grid level at user-defined percentage di
The Zen ABR Range Bands indicator calculates an 8-bar average range from high-low differences and an exponential moving average of close prices. It plots the EMA on the price chart along with optional bands at multiples of the ABR (1x, 2x, 3x, 4x) centered on
This indicator calculates the Amazing Oscillator using 5-period and 34-period simple moving averages of the median price, then applies an RSI-style relative strength formula over a configurable smoothing period. The resulting oscillator fluctuates between -50
This indicator plots the instrument close in a separate pane. The source imports a user library as Lib but never calls it, so the import does not change the plotted series. There are no inputs, alerts, or trade signals, and it does not define entries, exits, s
Supply & Demand marks pivot highs and pivot lows on the price chart and draws translucent demand and supply boxes when a three-bar price imbalance appears between those pivots. Demand zones form after an upward imbalance when the stored pivot high precedes the
This Pine Script strategy calculates Bayesian probabilities of price breaking up or down relative to Bollinger Bands and a Simple Moving Average. It plots these breakout and breakdown probability lines as oscillators in a separate pane. Long entries trigger wh
Calculates and plots Smart Money Concepts elements directly on the price chart. It identifies internal and swing market structure shifts, including Break of Structure (BOS) and Change of Character (CHoCH). The indicator plots bullish and bearish order blocks,
This strategy calculates ADX and plus and minus directional movement and adds a Bollinger Band Width Percentile filter. It tracks positive or negative DMI, rising or falling ADX, and an optional recent DMI flip within a set lookback. Settings change ADX length
This indicator builds a global liquidity composite in a separate pane. It requests monthly M2 series for the United States, euro area, China and Japan, normalizes each against a simple moving average, and combines them with user weights. Settings choose whethe
This strategy plots a comparative relative strength line against a benchmark symbol in a separate pane. It calculates price and volume simple moving averages alongside a multi-period highest high. Long trades enter using full equity when price exceeds its movi
This indicator implements J. Welles Wilder's Parabolic SAR (Stop and Reverse) methodology directly on the price chart. It calculates the trailing SAR level based on user-defined initial, increment, and maximum Acceleration Factors. In addition to plotting the
This indicator demonstrates a library import. It imports a library named mylib under the alias lib, calls the function add with the constants one and two, and plots the returned value. It does not read price, volume, or time, and it does not produce trading si
This indicator combines RSI, Awesome Oscillator (AO), and Stochastic readings to calculate divergence and momentum signals. It identifies regular and hidden divergences while analyzing price pivots, momentum thresholds, and AO filters. The script draws in a se
This indicator implements John F. Ehlers adaptive stochastic and is declared for a separate pane. It high-pass filters the chosen source to keep shorter cycles, smooths that series with a super smoother, and measures Pearson correlation over lags from zero to
This indicator detects Smart Money Technique (SMT) intermarket divergences across multiple timeframes, ranging from one minute to one week. It compares the current chart symbol against up to two benchmark symbols to identify non-confirmations in swing highs an
The Harami Pattern Finder indicator identifies two-bar bullish and bearish Harami candlestick patterns directly on the main price chart. It calculates pattern validity based on the open and close price relationships between consecutive bars. Optional input set
This strategy combines Bollinger Bands, Bollinger Band Width, and the Relative Strength Index (RSI) for mean-reversion trades. It enters long when price crosses below the lower band with oversold RSI, or when band width contracts under low volatility. Short en
This script plots Vegas Tunnel exponential moving averages directly onto the price chart. It calculates two pairs of EMAs: a fast tunnel using 144 and 169 periods displayed in green, and a slow filter tunnel using 576 and 676 periods displayed in red. Although
PHASE 404 v2 is a Smart Money Concepts (SMC) indicator that plots structure directly on the main price chart. It identifies Buy Side Liquidity (BSL) and Sell Side Liquidity (SSL) levels, highlights Market Structure Shifts (MSS) after liquidity sweeps, and mark
This strategy plots Donchian channels, trailing stops, and profit targets directly on the price chart. It enters breakout trades using a 55-bar Donchian channel and sizes positions according to an ATR-based risk percentage per unit. The system adds units as pr
Calculates and plots key financial metrics including the Price-to-Earnings ratio, Price-to-Book Value ratio, and Earnings Per Share in a separate pane. The script retrieves financial data through standard financial requests based on customizable reporting peri
Alighten Pattern A is an overlay indicator that calculates market structure pivots and identifies price patterns directly on the main price chart. It plots a ZigZag line to track price highs and lows, rendering horizontal dashed levels and directional signal m
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.