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 calculates and plots two moving averages, which can be configured as either exponential or simple, along with a shaded fill between them to highlight trend direction. It also derives and plots upper and lower deviation levels using a customizabl
This indicator overlays historical ARK Invest buy and sell activity for ticker 6301 on the price chart. It places green buy labels below bars and red sell labels above bars at fixed calendar dates, with each label showing a one-ETF count. The ETF input switche
This Pine Script library provides a helper function to calculate the Pearson correlation coefficient between two numeric datasets stored as float arrays. It evaluates the linear relationship between the samples by dividing their covariance by the product of th
This overlay indicator smooths a rolling highest low and lowest high with a rational quadratic kernel, then holds a step line that switches between those two smoothed levels when the selected source crosses them. It plots that line as crosses on the price char
STRG-BBForce is a Bollinger Bands trend-following strategy. It calculates standard Bollinger Bands and tracks directional alignment across the upper, lower, and basis lines. When all three lines slope upward, it opens a long position and closes short positions
This educational indicator demonstrates the usage of built-in time variables and timestamp calculations in Pine Script. It computes a UNIX timestamp based on the current bar's year, month, and day of the month using the built-in timestamp function and plots th
This indicator merges Fibonacci retracements and extensions onto the price chart from a single detected swing. Swings are identified using zigzag pivot detection with an optional ATR deviation filter, or anchored to completed higher-timeframe periods. When a n
This indicator compares two user-selected symbols by plotting the z-score of their log-price ratio in a separate pane. It averages the ratio with a chosen moving average, measures standard deviation over the same period, and marks a buy when the ratio falls be
This strategy identifies bullish and bearish Three Line Strike candlestick patterns combined with a dual moving average cloud and Volume Spread Analysis (VSA). It triggers long or short entries when a strike formation confirms in alignment with the moving aver
Calculates Vitali Apirine's Slow Relative Strength Index (SRSI), which measures price changes relative to an Exponential Moving Average rather than the previous bar close. It computes the distance between the source price and its EMA, then applies Wilder's smo
This indicator overlays options gamma-exposure levels, session VWAP bands, and intraday market structure tools directly on the price chart. It provides three modular components: strike walls with standard deviation bands and opening ranges, a gamma regime engi
Calculates the Commodity Channel Index (CCI) and plots it in a separate pane using dynamic color gradients. The script adjusts the signal line color smoothly across values ranging from -200 to +200. Additionally, it fills the background between the +100 and -1
Implements an automated testing framework designed to validate an EMA Ribbon and MACD hybrid strategy. It verifies indicator calculations, trend context filters, signal generation, suppression rules, and cooldown mechanics using custom assertions. Test results
This indicator identifies fractal-based pivot highs and lows to map out market structure directly on the price chart. It detects bullish and bearish structure breaks, automatically labeling Break of Structure (BOS) and Change of Character (ChoCH) events when p
This indicator plots a KDJ oscillator in a separate pane. It calculates a stochastic K value from the close, high, and low over the K period, then smooths it with a simple moving average. The D line is a simple moving average of K, and the J line equals three
Calculates and plots ICT Inversion Fair Value Gaps (IFVGs) directly on the price chart. It detects bullish and bearish fair value gaps and tracks when price passes through them, converting them into inversion zones. Users can customize the validity period in b
Calculates a finite impulse response moving average using Blackman window weighting. The Blackman window applies specific cosine constants to minimize spectral leakage, yielding a smooth trend-following curve. The calculation adapts dynamically during initial
This indicator plots multi-timeframe open, high, low, and close levels directly on the price chart. It draws horizontal lines for key price levels alongside vertical separators at each timeframe interval. In addition, the script displays Fibonacci retracement
This indicator calculates and plots the standard Directional Movement Index (DI+, DI-, and ADX) in an oscillator pane alongside colored horizontal zones representing trend strength stages: weak, medium, strong, and exhaustion. The ADX line dynamically shades b
This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.
The Planetary Ingress indicator identifies and marks when selected planets transition into new zodiac signs on the price chart. It plots historical ingress markers along with retrograde indicators and projects future ingress dates ahead of current price action
This indicator calculates blended Relative Strength (RS) Ratio and RS-Momentum metrics for the chart symbol relative to a benchmark asset such as SPY, inspired by Relative Rotation Graph principles. It combines fast and slow normalized relative strength and mo
Auto Fib Extension detects pivot highs and lows on the price chart and draws Fibonacci extension levels from the latest swing. Depth sets how many bars define a pivot, and Reverse flips the swing direction. Users can extend lines left or right, show prices and
This indicator identifies inside bars on the price chart. An inside bar is a candle whose high is at or below the previous high and whose low is at or above the previous low. Matching bars are recolored with a user-selected color, defaulting to yellow, while o
This indicator calculates the difference between a slow RSI and a fast RSI based on a selected price source. It plots the resulting oscillator value in a separate pane to display relative momentum changes between the two periods. Users can configure the source
Feature Matrix - strategy is a minimal Pine Script v6 strategy designed to verify basic strategy execution functionality. It evaluates whether the closing price is higher than the opening price on the current bar. When a bullish candle forms, the script trigge
This indicator plots On Balance Volume in a separate pane and marks regular and hidden divergences between price pivots and the volume oscillator. It builds OBV from cumulative signed volume, finds pivot highs and lows with left and right lookbacks, and compar
This overlay strategy combines a Cipher B WaveTrend oscillator with two optional moving averages on the price chart. It exposes WaveTrend channel and average lengths, overbought and oversold levels, buy, sell and gold dots, and regular or hidden divergence mar
Validation Test is a negative fixture indicator that plots the close in a separate pane using line, line-break and histogram styles. It also calculates the absolute value of a constant, the maximum of close and open, and a string form of the close. Later lines
This indicator calculates a deseasonalized centered moving average from the selected source data using chosen MA types like WMA, EMA, SMA or RMA. It plots the resulting value on the price chart and changes the color to green or red based on the direction of th
This indicator detects Spinning Top candlestick patterns based on body thickness relative to the candle range. It calculates upper and lower limits using the candle length, half candle, and user-defined range percentage. When a candle's body falls within the m
This indicator calculates dynamic pivot highs and pivot lows over a configurable period to track price change rates and retracement levels. It plots visual markers at detected pivots and draws lines with labels displaying percentage movements, prices, and retr
This strategy enters long or short when a chart-timeframe Donchian breakout agrees with a higher-timeframe confirmation, using breakout, moving average, or both. It exits on a shorter Donchian channel and can flatten on a time rule. Position size risks a set p
This overlay indicator plots a centered triangular moving average and upper and lower bands derived from average true range. It supports selectable price sources, band width, and a caution threshold based on the TMA angle. Optional labels and alerts mark band
This overlay indicator scores up to ten equal-weight conditions on the five-minute chart and marks a signal when the total meets a configurable threshold. It plots a 9/15/21 EMA ribbon with optional cloud fill, session-anchored VWAP and standard-deviation band
This strategy identifies trend-following engulfing setups filtered by a 200 EMA on the price chart. Long trades require price to be above the 200 EMA following three consecutive bearish candles engulfed by a bullish candle. Short entries mirror this structure
Tracks and visualizes active, swept, and closed-through swing points while measuring C3 continuation success rates following C2 candle closures based on ICT concepts. It draws customizable level lines directly on the price chart and compiles performance statis
This strategy replays a fixed list of historical trades on the price chart. It places limit orders with hardcoded quantities and prices when the bar close time matches stored timestamps, and it can add more size to the same order identifier before closing. Clo
This indicator generates standardized signal outputs using MACD logic designed to feed into the PineCoders Backtesting-Trading Engine via external inputs. It encodes filter states, entry signals, stop loss levels, and exit triggers into a single numerical seri
This indicator overlays Tom DeMark's TD Sequential methodology on the main price chart. It tracks consecutive price comparisons where current closes are higher or lower than the close four bars ago, incrementing setup counts from one to nine. Upon completing a
TPCharts Alert Levels evaluates price breakouts across multiple timeframes, ranging from two minutes up to monthly intervals. It checks whether the current close crosses above the previous bar high or crosses below the previous bar low using higher-timeframe s
This indicator scans price action on the main chart to identify broadening wedge patterns, including descending, ascending, and symmetric formations. It evaluates confirmed swing highs and lows within a sliding window, fitting upper and lower trendlines based
This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers
This indicator implements an L1 proximal regularized filter to smooth price action while preserving significant market trends. It calculates a dynamic noise threshold based on a 200-period ATR and applies soft-thresholding to estimated velocity updates. The in
This strategy plots a linear regression of close and deviation bands on the price chart. It enters long when price crosses up from the lower band in an uptrend defined by an EMA and a rising regression line, and enters short on a rejection from the upper band
This indicator estimates a simple Hurst exponent from the length of the scaled price path over a user-set lookback and plots it in a separate pane. A value above 0.5 is colored differently from a value below 0.5, with a dotted horizontal line at 0.5. An option
This overlay indicator plots a zigzag when price reverses by a chosen share of the last pivot, or by an ATR length times a multiplier. It draws zigzag lines, confirmed pivots, and optional price labels on the price chart. Separate toggles show harmonic and cha
This indicator calculates and plots Opening Range Breakout (ORB) levels directly on the price chart. It defines the high, low, and midpoint of an opening range based on a configurable duration and session time, with an optional Anchored VWAP (AVWAP) and extens
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.