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 plots TradingView's On Balance Volume in a separate pane. It optionally overlays an EMA or SMA signal line and colors both lines by whether OBV is above or below that signal. Users can change the smoothing type and length, hide the signal, fill
This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and
This strategy enters long when price is above a long moving average and the RSI falls below an oversold level. It closes the long position when the RSI rises above an overbought level or price drops below the moving average. The RSI length, oversold and overbo
This indicator plots three moving averages on the price chart alongside colored fills between the lines to visualize trend structure. Internally, it calculates a Stochastic RSI oscillator to detect oversold reversals. When the Stochastic %K line rises above 10
Plots historical buy and sell transactions made by ARK Invest funds directly on the price chart. The indicator places visual labels above or below price bars on specific timestamps corresponding to trade execution dates, indicating transaction direction and th
This Pine Script v5 library provides basic arithmetic operations for integer arrays. It exports helper functions to add, subtract, multiply, and divide two integer arrays element by element. When the secondary array is shorter than the primary array, operation
AI Trend is an indicator that plots pivot points, trend lines, and support and resistance levels directly on the price chart. It marks high and low pivots based on user-defined length, draws trend lines that check for violations at specified points, and identi
MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us
This indicator identifies local swing highs and swing lows to construct a Zig Zag pattern on the main price chart. It evaluates pivot points based on a customizable number of surrounding left and right bars. Using persistent variables, the script tracks previo
Sick Sigma detects extreme statistical standard deviation moves (sigma events) to execute trades directly on the main price chart. The strategy supports both momentum and mean-reversion trading styles. Traders can configure calculation lookback periods, sigma
This indicator implements an artificial neural network using a single-layer perceptron model trained from scratch directly in Pine Script. It processes price features combined with a custom directional movement index across a rolling sample window to generate
This overlay strategy backtests a dollar-cost-averaging bot on the price chart. It opens a long base order when the selected oscillator signals: MACD line cross, MFI or RSI below a threshold, or Stochastic RSI K crossing above D. Further orders average down by
This overlay strategy combines a Nadaraya-Watson envelope, an RSI calculation, and an ATR stop-loss finder. With repainting off, it plots yellow upper and lower bands from a Gaussian endpoint estimate; with repainting on, it redraws the envelope on the last ba
The Augmented Dickey-Fuller indicator calculates statistical stationarity and tests for unit roots in price series over a rolling window. It performs ordinary least squares regression on differenced historical price data to compute a t-statistic and an estimat
This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow
This indicator plots the Commodity Channel Index in a separate pane and surrounds it with a Donchian channel whose lookback length changes with volatility. It measures volatility as a ratio of short and long ATR values, then ranks that ratio and shortens or le
This educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro
This strategy combines an exponential moving average ribbon with MACD momentum indicators to identify trend-following entry and reversal signals. It draws in a separate pane, tracking MACD signal crossovers, zero-line crosses, and EMA structural alignments. En
This indicator marks forex trading sessions and opening ranges on the price chart. It can draw Sydney, Tokyo, Frankfurt, London, and New York session boxes or five- and fifteen-minute opening ranges, plus an optional opening channel and a day-open range. Day r
The Ichimoku Cloud indicator plots key components of the traditional Ichimoku Kinko Hyo system directly on the price chart. It calculates the Conversion Line over 9 periods and the Base Line over 26 periods using Donchian midpoints. It projects Leading Span A
Fibonacci Auto Buy/Sell Signals calculates dynamic Fibonacci retracement levels (0.236, 0.382, 0.5, 0.618) and extension levels (1.618, 2.618) based on 50-period swing highs and lows. It plots dotted retracement and extension lines directly on the price chart.
This Pine Script indicator identifies market structure pivots and plots a ZigZag line on the price chart. It calculates high and low pivot points using built-in pivot functions based on a configurable pivot strength input. When a pivot high or low is confirmed
The AFIRMA indicator calculates a weighted moving average via FIR filter coefficients from Hanning, Hamming, Blackman or Blackman-Harris windows. It optionally applies least-squares cubic polynomial fitting for autoregressive prediction. The script plots the A
This indicator plots the initial balance high, low, midpoint and optional Fibonacci levels for a user-defined session on the price chart. It tracks a separate break session and includes settings groups for extension lines, percentile lines and tables. Users ca
This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng
This indicator plots a relative strength index in a separate pane. It calculates RSI from the average of the previous ten opens rather than the current bar, so that source does not change during the live candle. A moving average of the RSI is plotted and can b
Moon Declination & More calculates and plots the astronomical declination of the Moon, Sun, and lunar nodes in a separate pane. Based on ELP2000-82 and VSOP87 ephemeris models, it tracks celestial motion with optional lunar phase coloring, zodiac sign transiti
Normalized Volatility Adjusted Relative Strength compares the chart symbol against a benchmark instrument such as SPY while adjusting for price volatility. The indicator calculates individual ATR-normalized price changes for both assets over a specified lookba
This indicator plots the Arnaud Legoux Moving Average of the closing price on the price chart. It uses TradingView's built-in ALMA calculation with a user-set window size, offset, and sigma. Those three inputs change how much history the average includes and h
Calculates and plots both the Relative Strength Index (RSI) and the Commodity Channel Index (CCI) together inside a single separate pane. The indicator tracks maximum and minimum RSI values over a customizable lookback window to evaluate bullish and bearish mo
The Zen Consecutive Bar Streak indicator calculates and tracks consecutive directional candle streaks directly on the main price chart. It determines whether each bar is bullish, bearish, or neutral based on its close relative to its open. When two or more con
This overlay indicator builds trend ranges from a Donchian midpoint. It takes the highest high and lowest low over a user length, averages them, and holds that basis until the midpoint changes. When the basis updates, it sets a range from the close standard de
This feature matrix test script demonstrates the execution of a guarded runtime.error call in Pine Script v6. It uses an unreachable conditional statement based on the bar index to verify that the runtime error isn't triggered unexpectedly. The indicator plots
This overlay indicator marks bullish and bearish engulfing candles with teal and orange arrows on the price chart. An optional volume-weighted moving average can filter those marks: a bullish signal requires the close at or below the primary VWMA, and a bearis
This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa
Test Plot Parsing is a minimal test script designed to verify scope detection and syntax parsing in Pine Script v6 development environments. It plots basic price values, including close, open, and high series, in a separate indicator pane. The script intention
This indicator plots John Ehlers' simple decycler on the price chart. It applies a high-pass filter to the chosen source, subtracts that component from the source, and draws the remaining low-frequency line. The line is green when the decycler rises for two co
HTF Statistical Zones plots historical percentile bands around the 18:00 New York day open, plus session boxes, opening-range lines, and projected targets on the price chart. Upper and lower day zones use selectable inner and outer percentiles, with optional p
This indicator marks paper umbrella candles on the price chart. It flags a green or red pattern when the upper wick is small relative to the body side and the body thickness stays between set minimum and maximum percentages of the range. On a match it draws a
The Greeffer RSI Strategy is a basic momentum-based trading strategy that plots a 14-period Relative Strength Index (RSI) in a separate indicator pane. It generates long entry signals when the RSI falls to or below an oversold threshold of 29, and short entry
A trend-following strategy based on Ed Seykota's Donchian breakout framework, modified to take a single full-risk entry instead of pyramiding multiple units. It enters long or short on 55-bar channel breakouts with ATR-based position sizing and an initial stop
This indicator plots RSI, stochastic, and a scaled MACD together in a separate pane. It calculates RSI and stochastic %K and %D, then shifts the stochastic values upward by 100 so they sit above the RSI scale. The MACD line is normalized against its running mi
This intraday overlay establishes directional bias and high-conviction swing setups for SPY on the 15-minute timeframe. It computes a weighted confluence score combining an EMA ribbon, a 50 EMA anchor, session VWAP bands, RSI divergence, ADX, TTM Squeeze, cand
Crossing EMAs D is a moving average crossover strategy designed to automate trade execution through Zignaly webhook and email integration. It detects simple moving average crossovers (14-period and 28-period) and formats detailed payload alert messages for cry
This indicator draws custom higher-timeframe period separators and opening price horizontal lines directly on the price chart. Users can select the target timeframe, such as monthly, to display vertical separator lines alongside a horizontal line marking the h
This script executes hardcoded historical trade entries and exits based on exact Unix timestamps. Designed for backtesting the Lazarus3 model on Bitfinex BTC-USD 2-hour data from January to February 2018, it places fixed-size buy and sell orders at predetermin
This strategy plots five exponential moving averages of typical price on the price chart and treats a fully ordered stack as a trend signal. It enters long when the averages rise in order or when the 14-period RSI crosses above 60.5, and short on the opposite
The script is a Pine Script v5 indicator that emulates strategy backtesting directly on the price chart. It evaluates modular entry strategies, trade directions, entry stop-loss types such as ATR multiples or fixed percentages, and a wide variety of trade filt
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.