Synced with GitHub · updated today

Free TradingView Pine Scripts

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.

New scripts by RSS
8,340 scripts
318 stars

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

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of TVT Short Term (1h)

6301-Tracker

by Allen1212
303 stars

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

Indicator v4
Updated 2 years ago · None stated GitHub repository of 6301-Tracker

ArrayStatisticsPearsonR

by ricardosantos79
261 stars

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

Library v5
Updated 4 years ago · None stated GitHub repository of ArrayStatisticsPearsonR
257 stars

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

Indicator v5 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Donald - Highest-Lowest Visual

STRG-BBForce

by harryguiacorn
219 stars

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

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of STRG-BBForce
219 stars

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

Indicator v4
Updated 5 years ago · None stated GitHub repository of 教學-時間變數解說
114 stars

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

Indicator v5 Mean reversion
Updated 1 year ago · None stated GitHub repository of Pair Trading - Cointegration

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

Strategy v5 Candlestick patternsTrend Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3LS 3 Line Strike Strategy [Kintsugi Trading]
99 stars

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

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Apirine Slow RSI (SRSI)

CCI Line Gradient

by be-thomas
65 stars

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

Indicator v5 Oscillators & momentum
Updated 4 days ago · GPL-3.0 GitHub repository of CCI Line Gradient
57 stars

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

Strategy v6 Moving averagesOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Test Suite v1.5
56 stars

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

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of Market Structure (Fractal)

KDJ

by dcaoyuan
55 stars

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

Indicator v6 Oscillators & momentum
Updated 6 months ago · Apache-2.0 GitHub repository of KDJ

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

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Inversion Fair Value Gaps IFVG ICT Signals
47 stars

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

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Blackman Moving Average (BLMA)

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

Indicator v6 Support & resistanceBreakout
Updated 7 weeks ago · None stated GitHub repository of MTF OHLC Lines with Breakout, Retracement & Fibs
43 stars

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

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Directional Movement Index
43 stars

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.

Strategy v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m Strategy Candle Bar

Planetary Ingress

by blueprintresearch-dev
42 stars

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

Indicator v6
Updated 2 weeks ago · None stated GitHub repository of Planetary Ingress

Auto Fib Extension

by TWODS-CAPITAL
37 stars

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

Indicator v5 Support & resistance
Updated 3 years ago · MIT GitHub repository of Auto Fib Extension

Zen Inside Bar

by Zen-Tim
29 stars

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

Indicator v6 Candlestick patterns
Updated 2 weeks ago · MIT GitHub repository of Zen Inside Bar

IndicatorExample

by nersent
29 stars

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

Indicator v5 Oscillators & momentum
Updated 11 months ago · Custom licence GitHub repository of IndicatorExample
26 stars

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

Strategy v6 Candlestick patterns
Updated 2 months ago · AGPL-3.0 GitHub repository of Feature Matrix - strategy

OBV Divergences

by tistaharahap
25 stars

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

Indicator v4 DivergenceVolume
Updated 6 years ago · None stated GitHub repository of OBV Divergences
24 stars

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

Strategy v5 Oscillators & momentumMoving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B + EMAs Strategy

Validation Test

by jpantsjoha
23 stars

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

Indicator v6
Updated 3 weeks ago · Custom licence GitHub repository of Validation Test
20 stars

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

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Modified Deseasonalized/Centered MA

Spinning Top Finder

by shibisuriya
18 stars

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

Indicator v4 Candlestick patterns
Updated 4 years ago · None stated GitHub repository of Spinning Top Finder

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

Indicator v4 Support & resistanceTrend
Updated 6 years ago · None stated GitHub repository of Price Change Rate by Pivot Points - Dynamic
16 stars

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

Strategy v6 TrendBreakout
Updated 11 months ago · None stated GitHub repository of Seykota Alt 17: Dual TF Confluence

SPY 0DTE Scalper - 5m

by chris-c-thomas
14 stars

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

Indicator v6 ScalpingMoving averages
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 5m

DI Engulfing B002

by ruckard
13 stars

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

Strategy v5 TrendCandlestick patterns
Updated 1 year ago · None stated GitHub repository of DI Engulfing B002
12 stars

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

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of C2 Next Candle Statistics Tracker

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

Indicator v5 Oscillators & momentumMoving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Signal for Backtesting-Trading Engine [PineCoders]

TD Sequential

by davro
10 stars

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

Indicator v4 TrendOscillators & momentum
Updated 5 years ago · None stated GitHub repository of TD Sequential

TPCharts Alert Levels

by TPCharts
10 stars

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

Indicator v4 Support & resistanceBreakout
Updated 5 years ago · GPL-3.0 GitHub repository of TPCharts Alert Levels

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

Indicator v6 Support & resistanceBreakout
Updated yesterday · MIT GitHub repository of Broadening Wedge Scanner Pro [WavesUnchained]

QFA Pro Elite Refined

by JasonTeixeira
9 stars

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

Indicator v6 Oscillators & momentumVolatility & bands
Updated 12 days ago · Custom licence GitHub repository of QFA Pro Elite Refined
9 stars

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

Indicator v6 TrendVolatility & bands
Updated 4 months ago · MIT GitHub repository of L1 Proximal Filter [LuxAlgo]

Linear Regression Channel - Eterna

by EternaHybridExchange
9 stars

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

Strategy v5 TrendMean reversion Repaints
Updated 7 months ago · MIT GitHub repository of Linear Regression Channel - Eterna

Simple Hurst Exponent

by Anderson-ALGO
9 stars

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

Indicator v4 TrendMean reversion
Updated 5 years ago · None stated GitHub repository of Simple Hurst Exponent

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

Indicator v4 Support & resistanceVolatility & bands

LunarTick ORB

by lunarticktrading
7 stars

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

Indicator v6 Sessions & timeBreakout Repaints
Updated 2 weeks ago · None stated GitHub repository of LunarTick ORB

About the Pine Script Library

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.

Compare brokers