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 educational strategy demonstrates how to implement trailing stop losses in Pine Script. It executes a single mock trade in the chosen direction starting at a user-defined timestamp. The trailing stop is calculated using either Average True Range or percen
Plots higher-timeframe (HTF) candle overlays, pivot point levels, and time division markers directly on the price chart. It renders HTF candle bodies and wicks with configurable fills, alongside traditional pivot calculations, Central Pivot Range (CPR), and ex
ZigZag (Using Line Array) plots zigzag lines on the price chart to identify swing highs and lows. Bullish and bearish pivots are drawn with green and red lines respectively, while trap zones use orange and lime colors. Labels display pivot labels like HH or HL
Trendsignal plots buy and sell markers on the price chart when a short-term trend flips. It measures the average high-low range and the highest and lowest prices over a fixed nine-bar window, then builds inner thresholds from the RISK setting. A close above th
This strategy plots an exponential moving average on the price chart and opens a long position when the close crosses above that average, but only when no position is already open. It exits with a percentage stop loss and a percentage take profit measured from
This indicator overlays smart money liquidity analytics directly onto the price chart by reading imported micro-profile data. It displays primary support and resistance levels, zone strength badges, context bias metrics, and sweep or mitigation markers. User i
This strategy computes bullish flags for 1-minute bars using request.security_lower_tf on a 15-minute chart. It tallies the number of bullish sub-bars and enters a long position when the count reaches at least 9 and the 9-period EMA crosses above the 21-period
This indicator plots the close price series with an offset determined by bar index modulo 5. The offset creates a shifted visual series for plotting purposes on the chart. It draws the plot directly on the main price chart pane. No trading signals or exits exi
DEPV2 C5 Mod Secici is a signal mode selection indicator designed primarily for 15-minute timeframes. It evaluates market conditions across four primary dimensions: HLC3 moving average trend scores, momentum rate-of-change z-scores, volatility expansions via f
This indicator plots price candles reflected across a user-set mirror level and marks up and down fractals that form before a chosen reference time. Fractals need a swing high or low confirmed over a set number of periods on both sides, then appear as triangle
This strategy implements a six-state market regime classifier based on the Melgo Sequence, categorizing market action into bull and bear trends, rejections, indecision, distribution, and accumulation. Signals are derived using synthesized price data and requir
US Swing Entry Planner plans swing trading entries on daily price charts using dual entry models: pullback limit buys near the fast EMA and breakout buy-stop orders above pivot highs. It calculates ATR-based stop loss and profit targets along with position siz
This strategy computes the midpoint of the highest high and lowest low over a configurable lookback and enters long when price crosses above that line and short when it crosses below. An exponential moving average of each bar's high-low range is calculated but
This strategy plots 10, 55 and 200 period exponential moving averages on the price chart and calculates a smoothed stochastic oscillator from user K, D and smoothing periods. It opens a long when the K line crosses above D while K is below a fixed oversold lev
The Liquidation Heatmap indicator identifies potential liquidation zones on the price chart by detecting swing highs and lows, then calculates long and short liquidation volumes using selected sources such as volume, range, or their product. It extends bars to
Heikin Ashi Trend is a trend-following strategy that calculates Heikin Ashi candle values and moving averages directly on the main price chart. It generates long and short entry signals when a user-defined number of consecutive Heikin Ashi bars align with fast
ES Professional Fade is an overlay strategy aimed at the ES futures contract. This archived file is only a placeholder and contains no entry, exit, or order logic. Its changelog says the version adds opening-range calculation with freeze logic, session-boundar
Turtle Trading Rules is an indicator based on the classic Turtle Trading Channels system, customized to generate JSON payloads for the OKX Signal Bot. It calculates price breakout channels using configurable entry and exit lengths (defaulting to 20 and 10 peri
This indicator calculates the Chaikin Money Flow (CMF) using a 50-period length based on volume data. It provides signals for when CMF crosses its 50-line value upwards or downwards, and when CMF is above or below zero. The settings cmfcrossimportance and cmfl
This Pine Script indicator plots the 50 percent mark of the previous bar's range and detects Piercing Line bullish reversal and Dark Cloud bearish reversal candlestick patterns. It uses a 7-period RSI filter where signals require RSI below 30 for bullish and a
Bjorgum Reversal is an overlay indicator that combines Tillson T3 moving averages, Parabolic SAR, and the True Strength Index to identify trend direction and potential reversal points. It recolors candles to signal trends and potential crossovers, while plotti
This indicator measures how a linear regression of the close changes over a chosen shift, then measures how that slope itself changes. It plots the slope and a second difference in a separate pane with a zero baseline. The regression length sets how many bars
The Apirine Adaptive Moving Average calculates a dynamic moving average that adjusts its sensitivity according to price volatility and position within a recent range. It uses highest high and lowest low values over a selected lookback period to scale a smoothi
This overlay indicator screens a pasted list of up to forty symbols and draws a table on the price chart. It classifies bullish or bearish setups from the percent change between the current candle and the candle 250 bars back, then shows RSI with a simple movi
This mean-reversion strategy plots Bollinger Bands and a long-term moving average directly on the price chart. It enters trades when price candles penetrate the outer Bollinger Bands beyond a user-defined body percentage, anticipating a price reversal. Entries
Plots historical buy and sell transactions made by ARK Invest for Adyen (ticker: ADYEY) directly onto the price chart. The indicator visualizes institutional trade activity by generating green labels below bars for purchases and red labels above bars for sales
This indicator estimates a probability density from a stored set of observations using kernel density estimation. It offers several kernels, including Gaussian as the default, and plots the resulting density in a separate pane. Bandwidth controls smoothness an
This strategy combines Arnaud Legoux Moving Average percentage price change calculations with an adaptive Gaussian Moving Average to generate trend-following signals. Long and short entries are triggered when the ALMA change calculation crosses above or below
This educational script demonstrates custom candlestick rendering on the price chart using the plotcandle function. It calculates a 20-period Simple Moving Average and checks if the bar's low price remains strictly above it. When the condition is met, the indi
This strategy provides reusable building blocks for entries, exits, and risk management in Pine Script. It calculates profit and loss units, applies session filtering based on timezone, and handles backtest date ranges. It includes risk settings like stop loss
This indicator calculates a quadratic regression polynomial curve on price data to identify trend direction and potential dynamic support or resistance. It applies selected forecasting methods, such as seasonal naive or simple mean, to project future values. B
Identifies the 80-20 candlestick setup, triggering when a bar opens in the lower 20% of its total range and closes in the upper 20%, or opens in the upper 20% and closes in the lower 20%. Blue and red arrows plot above qualifying bars directly on the price cha
This indicator calculates the Balance of Power oscillator to gauge underlying buying and selling pressure by evaluating the position of the close relative to the open against the bar high-low range. It provides an option to smooth raw values using an exponenti
Holiday candles is a Pine Script v5 overlay indicator that recolors price candles. It builds a color from random red, green, and blue values and a random transparency level using color.rgb, then draws each bar with plotcandle from the open, high, low, and clos
This indicator plots a DeMarker oscillator in a separate pane. It compares positive changes in highs with negative changes in lows, smooths both series with a selectable moving average, and scales the result from 0 to 100. The line is colored when it is above
The script identifies market structure key levels by calculating pivot highs and pivot lows across a fixed fifteen-bar lookback and lookahead window. It plots confirmed resistance pivots as red circles and support pivots as green crosses directly on the price
This diagnostic utility injects missing (na) values into an input data series at regular cyclic intervals to test how indicators handle corrupted or interrupted data feeds. The user can configure the input source, the repetition interval, and the length of eac
This indicator marks a user-defined session, defaulting to 06:00-09:00 in the America/New_York time zone, and draws that session's high-low range on the price chart. It can show a session anchor, a session open line, a shaded range box, and horizontal levels a
This strategy executes trades based on price interactions with standard Bollinger Bands plotted on the price chart. It calculates a simple moving average basis line along with upper and lower standard deviation bands. Long entries are triggered when price cros
This indicator marks bars whose range exceeds a multiple of the average bar range, calculated as a simple average of prior ranges. On those bull or bear bars it draws the high-low midpoint and the midpoint between the close and the opposite extreme, as dotted
This script provides a foundational starter template for building custom Pine Script v5 trading strategies. It overlays on the main price chart and establishes the scaffolding for long and short positions, including bracketed exit orders. Configurable date inp
This overlay strategy trades Donchian breakouts in either direction. The first unit is sized from a risk percent of equity and an ATR-based initial stop; later units are added at fixed ATR steps and are progressively smaller, up to four units. Optional profit
Divergenced J001 is a price-chart strategy that finds squeeze-momentum divergences and can send Zignaly alert messages. It shorts when a light-green to dark-green squeeze section shows a smaller value while price is higher, and longs on the opposite red-sectio
This indicator plots a heuristic volume-balance oscillator in a separate pane. It estimates signed volume from the close location inside each bar, multiplies that by volume, and sums the proxy over a rolling window. The sum is scaled between minus one and plus
Volume Surprise plots volume against a historical summary for matching time periods in a separate pane. It groups past volume by minutes, hours, days, months, or quarters, then summarizes each group with a mean or a percentile. Length sets the sample window an
This indicator plots a smoothed stochastic, a Schaff Trend Cycle, and a WaveTrend oscillator in a separate pane. It draws percent K and percent D between fixed upper and lower bands and marks their crosses when percent D is under 30 or over 70. The STC is a do
This overlay indicator plots a volume-weighted average price on the price chart, anchored to a chosen period such as the session, week, month, or longer calendar and corporate events. It draws up to three standard-deviation bands around the VWAP, with multipli
This indicator plots momentum of a chosen price source over a user-set period in a separate pane. It calculates the difference between the current source value and the value that many bars earlier, then draws the result as a histogram. Positive values appear g
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.