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.
A long-biased signal indicator for the price chart built on a Hull moving average. A buy is shown when price is above a rising HMA, provided volume agrees through a price-volume trend filter or a momentum override based on RSI applies. After a buy, a trailing
This strategy detects three-bar reversal patterns in normal, enhanced or both forms, derives support and resistance from them as levels or zones, and trades the reversals on the price chart. An optional trend filter uses a moving average cloud, Supertrend or D
This template indicator provides a baseline framework for building custom Pine Script market screeners. It sets up a standard configurable length parameter and offers structured comment blocks for adding calculations, filtering conditions, and outputs. Designe
An indicator that plots a Hull moving average on the price chart, with a choice of Hma, Thma or Ehma variants, an adjustable length and multiplier, and an option to take the average from a higher timeframe. The line is coloured by trend direction and can be dr
A multi-timeframe overlay indicator that compares an EMA 12 with an EMA 26 on weekly, daily, 6-hour, 4-hour, 2-hour and 1-hour data and shades the area between them on the chart. The fill is green when the fast average is above the slow one and red otherwise.
This strategy calculates fast and slow simple moving averages to identify trend direction changes on the price chart. It enters a long position when the fast simple moving average crosses above the slow simple moving average and opens a short position when it
A scalping strategy that goes long when a 9 EMA crosses above a 21 EMA while price crosses above VWAP, and short on the opposite pair of crosses. Exits close the trade at 1.5 ATR from the average entry price or on a MACD cross with a new five-bar extreme. A br
This strategy measures volatility as the standard deviation of closes and compares it with its own moving average multiplied by a threshold. When volatility is expanding and the close is beyond a Bollinger Band (20 periods, 2 deviations, fixed in the code), it
A separate-pane indicator that calculates the True Strength Index with fast, slow and signal lengths and detects regular and hidden divergences between price and the oscillator. Pivot lookback and range inputs control how far apart pivots may be, and each dive
A Pine Script v6 library that wraps data requests for external series. It supports economic series identified by a code, and Commitment of Traders data selected by metric name, direction and an optional CFTC code, building on the LibraryCOT library for the met
A long-side strategy that combines a Stochastic Momentum Index, a fast and slow EMA pair and MACD histogram. It enters long when the SMI crosses above its EMA while below the overbought level, and exits on the opposite SMI cross or when the fast EMA crosses un
This indicator demonstrates custom user-defined functions in Pine Script v5 and plots their results in a separate pane. It defines a one-line addition function, a multi-line function that multiplies two numbers and then scales the product by a fixed multiplier
A separate-pane indicator that shows two trend states as colored histogram bars, a slow one from 3, 8 and 20 period simple averages and a fast one from 21, 55 and 89 period averages. Green means the averages are stacked bullishly, yellow a pullback, light red
A strategy-type script for the price chart built around a fast and slow moving average pair, exponential or simple, whose lines and fill change colour with the direction of the gap. It prints B and S labels at crossovers and builds text messages for an externa
This indicator calculates a stochastic momentum reading in a separate pane. It compares the close with the midpoint of the highest high and lowest low over a percent-K lookback, then smooths that relative range with nested exponential moving averages using the
A teaching script from a Pine Script course that explains conditional logic through comments and examples: the ternary operator, the iff function and the if statement. The examples compare close to open to choose buy or sell values, build a colour picker with
This indicator plots Stochastic RSI %K and %D lines over the price chart. It detects bullish and bearish divergences by comparing price highs and lows to those of Stochastic RSI within a lookback period. Users set divergence range (short, medium, long), price
A Pine v4 indicator in a separate pane that computes a rolling Sharpe-style ratio over a 200-bar window and compares it with a benchmark symbol, SPY by default. An optional reference interest rate series can be subtracted, a Hull moving average smooths the out
This indicator calculates the difference between the current closing price and historical closing prices across six selectable lookback periods. It plots each detrended series in a distinct color along with a zero baseline in a separate indicator pane. Users c
A separate-pane tool that plots a very long RSI, 500 periods by default, with a ribbon of five exponential moving averages of the RSI at 1 to 5 bars. Dashed guide levels are set at 85, 70, 50, 20 and 10 and can be changed. A lookback period setting is also pro
Simple Short Term RSI is an unfinished Pine v4 learning strategy, marked as such by its author. It calculates a 2-period and a 14-period RSI and plots both in a separate pane. Its only trading rule is a long entry whenever the 2-period RSI is above 50, which d
This indicator combines three tools on the price chart: a Supertrend built from Heikin Ashi data with a one-bar ATR and a multiplier of 1.85, an Ichimoku cloud, and a chop candle colouring based on an arctangent measure of price movement. Each part has its own
The EMA Cross Strategy calculates an exponential moving average of close prices over a user-defined length. It enters a long position when a green candle opens above the moving average line, simultaneously closing any active short position. Conversely, it open
This indicator plots a Sharp Modified Moving Average on the price chart. It calculates the line as three times a weighted moving average minus twice a simple moving average of the selected source. The line turns green when it rises and pink when it falls. Opti
This overlay indicator scans a pasted list of symbols for ICT liquidity sweep patterns using prior swing sweeps. The screening method looks back one, two, or three swings and can list long and short signals in a results table with adjustable rows, position, an
This indicator plots candle range and open-to-close movement as percentages in a separate pane. Range is the high-low difference divided by the low, and change is the close-open difference divided by the open. Both series draw as columns. Teal columns show ran
Calculates realized volatility by smoothing squared log returns with an exponential moving average annualized by periods per year. It projects expected upper and lower price boundaries across a user-defined forward horizon, plotting them as step lines or displ
8473-Tracker visualizes historical buying and selling transactions executed by ARK Invest funds for specific stock holdings. It plots green buy labels below price bars and red sell labels above price bars on specific historical trade dates. An input setting al
This script defines a helper function to generate colors via triangular interpolation using TradingView's color.from_gradient. The function blends between minimum, mid, and maximum color points based on an input value. It applies the function to the RSI indica
Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows
Wick Power Shift calculates and plots the smoothed average sizes of upper and lower candlestick wicks in a separate pane. It measures lower wick length (distance from the lower body to the low) and upper wick length (distance from the upper body to the high),
This educational script draws a vertical line on the price chart at 9:30 AM New York time to mark the standard US equity market open. It uses the line.new function to plot a thick, semi-transparent gray vertical line extending from above the bar high to below
This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl
22-MA Strategy plots a selectable center moving average on the price chart and marks upper and lower levels a fixed pip distance from that average. It supports twenty-two average types, from SMA, EMA, and HMA variants through filters such as Kalman and JMA-sty
This strategy plots on the price chart and enters when three smoothed moving averages are aligned, RSI is on the matching side of 50, and a Williams fractal appears. An upward stack with RSI above 50 and a down fractal opens a long; the opposite setup opens a
This indicator calculates Aroon Up and Aroon Down from the bars since the highest high and the lowest low inside a chosen period. It plots both series in a separate pane with horizontal lines at 30, 50 and 70. The period input sets the lookback used for those
This indicator estimates gamma exposure levels and intraday context for index instruments like SPY and ES. It calculates VWAP with standard deviation bands as a gamma flip proxy, highlighting market regimes through background colors. It plots prior day high, l
This educational script demonstrates Pine Script dynamic coloring techniques by plotting the closing price in a separate pane. It evaluates whether the current bar is bullish or bearish by comparing the close price to the open price. If the bar is bullish, it
This script implements an automated unit testing suite for a 4-hour swing trading system based on market structure and MACD. Utilizing a custom PineUnit framework with user-defined types, it validates mock functions for change of character, break of structure,
This indicator maps Smart Money Concepts (SMC) features directly on the price chart. It detects and visualizes internal and swing market structure breaks (BOS and CHoCH), bullish and bearish order blocks, equal highs and lows, and strong or weak swing points.
This indicator plots the Parabolic SAR on the price chart as crosses. It computes SAR with a start of 0.02, an increment of 0.02, and a maximum of 0.2, then colors each point green when the SAR value sits below the close and red otherwise. Those acceleration v
This strategy implements Larry Connors' 2-period RSI mean-reversion algorithm overlaid on the price chart. It filters trades using a long-term Simple Moving Average (SMA), entering long positions when the price trades above the SMA and the short-term RSI drops
Calculates and plots a second-order Butterworth low-pass infinite impulse response filter on the price chart. It smooths price series data by attenuating high-frequency market noise according to a specified cutoff period. Users can adjust the length setting an
NQ Stats - Initial Balance calculates and displays the Initial Balance range, including the session high, low, and midpoint, for a customizable intraday time window. Once the defined calculation period ends, the indicator overlays a shaded box and a midpoint l
This indicator calculates the Relative Strength Index using a volume-weighted moving average of the closing price as its source. It plots the resulting oscillator in a separate pane alongside configurable overbought and oversold threshold lines. The plot line
This overlay strategy is written for the SOLUSDT perpetual on the one-minute chart. It tracks confirmed pivot highs and lows as resistance and support circles, then marks strong buy or sell states when close crosses those levels. Long and short conditions comp
Planetary Retrograde Periods calculates and visualizes planetary retrograde motion directly on the price chart using geocentric ephemeris speed algorithms. It supports planets from Mercury through Pluto and divides retrograde cycles into two distinct phases wi
This indicator calculates the relative strength of the current asset compared to a benchmark symbol such as SPY. It stores the price ratio across a configurable lookback window, ranks the current ratio as a percentile from 0 to 100, and plots the result as a c
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.