Synced with GitHub · updated today

Free TradingView Pine Scripts

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.

New scripts by RSS
10,850 scripts

Moving Average Ribbon

by TWODS-CAPITAL
37 stars

This indicator plots up to four customizable moving averages directly on the price chart to create a ribbon visualizer for tracking trends. Users can independently toggle each line, choose from multiple calculation types including SMA, EMA, SMMA, WMA, and VWMA

Indicator v5 Moving averagesTrend
Updated 3 years ago · MIT GitHub repository of Moving Average Ribbon
13 stars

This strategy monitors section height changes within the Squeeze Momentum Indicator to identify momentum shifts and divergence entry signals. It uses high and low closing moving averages to evaluate price trends and overlay a visual ribbon on the price chart.

Strategy v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Ruckard Squeezed D004

Trade Permission Engine evaluates whether market structure currently permits long or short trades, alongside a decoupled Position Health score for managing existing positions. It analyzes alternating confirmed swing legs, Fibonacci retracement depths, time mat

Indicator v6 SMC / ICT / price actionTrend
Updated 2 days ago · MIT GitHub repository of Trade Permission Engine [WavesUnchained]

Volume Candle Coloring

by eddiebelaval
7 stars

This indicator colors price chart candles according to trading volume relative to a simple moving average. It classifies volume into five distinct tiers ranging from low to ultra using customizable multiplier thresholds. Candles are painted directly on the mai

Indicator v6 VolumeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Volume Candle Coloring

ICT State Machine

by alboogycOdR
6 stars

This indicator tracks a sequential smart money concepts workflow using a state machine on the price chart. It monitors higher-timeframe four-hour bias, Asian session ranges, liquidity sweeps, market structure shifts, change in state of delivery, and fair value

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of ICT State Machine

ID50

by g-moe
3 stars

The ID50 indicator identifies pullback opportunities to the 50-period exponential moving average (EMA) within an established trend. It plots a fast EMA and a slow EMA with a color-coded cloud between them to define trend direction. When price touches the slow

Indicator v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of ID50
2 stars

This indicator simulates and backtests candlestick pattern performance directly on the price chart. Utilizing an imported pattern recognition library, it calculates theoretical trade outcomes based on user-defined entry modes, stop-loss methods (ATR or pattern

Indicator v5 Candlestick patternsScreeners & dashboards
Updated 8 months ago · None stated GitHub repository of Candlestick Patterns on Backtest

Weighted Moving Average (WMA)

by mushroom-men-Trading
2 stars

The Weighted Moving Average indicator computes a weighted average of price data using an optimized circular buffer for efficient calculation. It plots the WMA line on the price chart as an overlay. The period setting determines the lookback window, and the sou

Indicator v6 Moving averagesTrend
Updated 9 months ago · None stated GitHub repository of Weighted Moving Average (WMA)

PF poc exit-while-flat true

by pineforge-4pass
1 stars

This strategy is a validation probe designed to test order execution behavior when issuing bracket exit orders while flat alongside a pending limit entry. It calculates 9-period and 21-period exponential moving averages on price data. On a bullish EMA crossove

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF poc exit-while-flat true

Trend Breakout

by GammaExpansion
1 stars

Trend Breakout is a price-chart strategy that builds a simple moving average and upper and lower bands from a multiple of standard deviation. It enters long when close crosses above the upper band and short when close crosses below the lower band. Position siz

Strategy v6 TrendBreakout
Updated 6 days ago · MIT GitHub repository of Trend Breakout

Golden Spiral

by morindok
1 stars

The Golden Spiral indicator calculates and draws logarithmic Fibonacci spiral projections in a separate pane. Centered at a user-defined bar timestamp, it plots forward and backward spiral curves using customizable turns, step resolution, and X/Y axis scaling.

Indicator v5 Support & resistance
Updated 7 weeks ago · None stated GitHub repository of Golden Spiral

NO.1 Major Daily Signal

by vedkanani123
1 stars

A price-chart indicator that marks only buy and sell labels, with no trail, cloud or dashboard. A signal closes any opposite position and flips direction. It combines a fast zero-lag EMA, slow EMA, Hull average and macro EMA with slope, separation, ADX, DMI sp

Indicator v6 TrendSessions & time Repaints
Updated 2 months ago · None stated GitHub repository of NO.1 Major Daily Signal

HV+D PBJ PPD

by nishpa800
1 stars

Overlay indicator that combines several detection pipelines on the price chart: high-volume candles with large displacement, a PBJ trend filter built from a moving average and Supertrend, and relative-volume lanes. Markers appear when these conditions coincide

Indicator v5 VolumeBreakout
Updated 2 months ago · None stated GitHub repository of HV+D PBJ PPD
1 stars

Tn Sovereign FlowZone v6 is a strategy script that plots signals on the price chart using EMA crossovers combined with confluence scoring. The script calculates confluenceScore from trend EMA, volume SMA comparison, and RSI momentum to confirm EMA20/50 crossov

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Tn Sovereign FlowZone v6
1 stars

This indicator applies an RSI-style oscillator smoothed with a cyclic filter, based on the dominant cycle idea from a published trading book. A Fast Fourier Transform library measures cycle strength, and a table lists the strongest cycle periods. This second v

Indicator v5 Oscillators & momentum
Updated 6 months ago · None stated GitHub repository of RSI Cyclic Smoothed Auto2

ATR Compare

by ivansoft
1 stars

Compares normalised volatility across a fixed list of Moscow Exchange stocks and funds in a separate pane. For each symbol it requests a 14-period ATR expressed as a percentage of close and plots it as a line, drawing the line more strongly when the value is a

Indicator v5 Volatility & bandsScreeners & dashboards
Updated 1 year ago · None stated GitHub repository of ATR Compare

DSM-tracker

by Allen1212
303 stars

DSM-tracker is an overlay indicator that marks ARK Invest activity on the price chart. In the supplied code it draws one green label below the bar on 17 January 2020 reading Buy X1 when the ETF input is ALL. That input offers only the ALL choice, so it does no

Indicator v4
Updated 2 years ago · None stated GitHub repository of DSM-tracker

f_push()

by ricardosantos79
261 stars

This demonstration script implements a custom FIFO array push function in Pine Script v4. It maintains a fixed-length array of closing prices by popping the oldest value and inserting the newest close at the front index. The script plots the newest price eleme

Indicator v4 Moving averages
Updated 4 years ago · None stated GitHub repository of f_push()
114 stars

This strategy calculates normalized price or on-balance volume differentials across a user-defined timeframe and passes them through an activation function such as Swish, Step, or LeakyReLU. It opens long positions when the activated vector crosses above a pos

Strategy v4 Oscillators & momentumAI / machine learning Repaints
Updated 1 year ago · None stated GitHub repository of Scaled Normalized Vector Strategy

This long-only strategy enters when a 14-period simple moving average crosses above a 28-period average and closes that long when the faster average crosses back below. While a position is open, it sets a stop a configurable percent below the entry, then moves

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Break even stop loss (% of instrument price)
99 stars

This indicator calculates market cycle phase using John Ehlers' Phasor Analysis methodology. It correlates the price series against cosine and negative-sine reference waves via dual Pearson correlation to extract real and imaginary phasor components. From thes

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers Phasor Analysis (HT_PHANA)

exit Demo

by be-thomas
65 stars

This strategy demonstrates staged long entries and a bracket exit on the price chart. It opens a first long of five units when the position is flat and the year is after 2014. When size reaches five, it adds a second long of ten units with a stop price ten per

Strategy v4
Updated 5 days ago · GPL-3.0 GitHub repository of exit Demo
47 stars

This indicator plots a trimmed mean moving average of the close on the price chart. It sorts each lookback window, drops a user-set percentage of the lowest and highest values from each tail, and averages the remaining middle portion. Period sets the window le

Indicator v6 Moving averages
Updated 8 months ago · MIT GitHub repository of TRIM: Trimmed Mean Moving Average

Moving Average Weighted

by TWODS-CAPITAL
37 stars

This indicator calculates a weighted moving average of a chosen price source and plots the result on the price chart. It uses TradingView's built-in weighted moving average function, so more recent bars receive greater weight than older bars. Length sets the n

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Moving Average Weighted
13 stars

Ruckard Squeezed E004 is a price-chart strategy that compares successive Squeeze Momentum colour-section changes. A smaller squeeze value with a higher price opens a short; a higher squeeze value with a lower price opens a long. Direction can be limited to lon

Strategy v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Ruckard Squeezed E004

This overlay indicator detects a trading range from clustered pivots, falling back to the highest and lowest prices over a lookback, and scores it with eight weighted factors. The score moves the range through Inactive, Building, Confirmed, Mature, and Breakin

Indicator v6 Support & resistanceVolatility & bands
Updated 2 days ago · MIT GitHub repository of Trading Range State Machine [WavesUnchained]

ICT State Machine

by alboogycOdR
6 stars

This overlay indicator walks price through a configurable ICT state sequence on the chart. It can require a four-hour CRT bias, an Asian range, manipulation, a New York macro window, a liquidity sweep, a market structure shift, CISD, a fair value gap, and a re

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of ICT State Machine

Imagegpt Test 1

by g-moe
3 stars

Imagegpt Test 1 is a comprehensive chart overlay indicator that plots buy, sell, and reversal signals along with supply and demand zones. It calculates key levels using volume pivots and features integrated Bollinger Bands alongside entry, exit, stop-loss, and

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 5 months ago · None stated GitHub repository of Imagegpt Test 1
2 stars

This indicator draws an equity factor dashboard in a separate pane. It can show a correlation table over a chosen length and a performance table based on rate of change or Sharpe ratio. Optional implied correlation plots, including single and double normalizat

Indicator v5 Screeners & dashboardsOscillators & momentum
Updated 8 months ago · None stated GitHub repository of CE - 42MACRO Equity Factor Table

Wilder's Moving Average (RMA)

by mushroom-men-Trading
2 stars

This script calculates and plots Wilder's Relative Moving Average (RMA) of a chosen source over a user-defined period. It applies an optimized exponential warmup compensator to ensure accurate early bar values while maintaining O(1) computational complexity. T

Indicator v6 Moving averages
Updated 9 months ago · None stated GitHub repository of Wilder's Moving Average (RMA)
1 stars

The strategy applies the Parabolic SAR indicator to detect trend reversal flips. It monitors when the SAR crosses from above to below the close (bullish flip) to enter long positions or from below to above (bearish flip) to enter short positions. Opposite posi

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 101 - parabolic sar flip

Language support probe r1

by GammaExpansion
1 stars

This indicator acts as a test probe to verify Pine Script v5 language features within an offline engine. It tests custom enum declarations, enum inputs, string formatting, functions, collections, and historical enum referencing. In addition, it constructs symm

Indicator v5
Updated 6 days ago · MIT GitHub repository of Language support probe r1

Golden Spiral

by morindok
1 stars

This overlay indicator draws golden and optional symmetric spirals between two user-selected time and price anchors on the price chart. It measures the selected range, counts green, red, and total candles, and sums their high-to-low heights, then uses the chos

Indicator v5 Support & resistance
Updated 7 weeks ago · None stated GitHub repository of Golden Spiral

NO.1 Major Daily Signal v2

by vedkanani123
1 stars

A price-chart indicator that prints buy and sell labels aimed at one larger intraday price move per UTC day, with the target size set in price units. A first signal can come from a trend breakout or a completed Asia range break, optionally preferring the day-o

Indicator v6 TrendBreakout Repaints
Updated 2 months ago · None stated GitHub repository of NO.1 Major Daily Signal v2
1 stars

Overlay indicator that looks for co-occurrence of high-volume displacement candles and a PBJ trend filter, then marks the result on the price chart. Both bullish and bearish pattern families are included, with toggles for UUUU, UUU, UU and Omega variants. Sett

Indicator v5 VolumeBreakout
Updated 2 months ago · None stated GitHub repository of HV+D PBJ PPD v1 (No HTF)
1 stars

The TN Sovereign Footprint POC v6 strategy calculates a simulated Point of Control by identifying the highest volume node in a lookback period using the average of high, low, and close prices. It plots on the price chart as an overlay and signals buy or sell e

Strategy v6 VolumeBreakout
Updated 2 months ago · None stated GitHub repository of TN Sovereign Footprint POC v6

RSI Cyclic Smoothed v2

by mikeyhu70
1 stars

This indicator plots a cyclic smoothed RSI in a separate pane, with a dominant cycle length, a maximum cycle and a divider as inputs, plus vibration and leveling values. Two signal lines use selectable moving average types with automatic or manual lengths, and

Indicator v5 Oscillators & momentumMoving averages
Updated 6 months ago · None stated GitHub repository of RSI Cyclic Smoothed v2

ATR Delta

by ivansoft
1 stars

Draws step-line bands around each candle on the price chart, sized from a rolling median of previous true range or candle body range. Two divisors set the band width for the high and low range and for the body range; the body version is shown by default and th

Indicator v5 Volatility & bands
Updated 1 year ago · None stated GitHub repository of ATR Delta

DSY-tracker

by Allen1212
303 stars

DSY-tracker is an overlay indicator that marks recorded ARK Invest purchases of DSY on the price chart. When the ETF input is set to ALL, it places green buy labels below bars on a fixed list of dates beginning in November 2019. The ETF setting switches the di

Indicator v4
Updated 2 years ago · None stated GitHub repository of DSY-tracker

Function K-Means Clustering

by ricardosantos79
261 stars

This indicator implements a K-means clustering algorithm in Pine Script to partition two-dimensional data points into user-defined clusters. It features an internal pseudo-random number generator for centroid initialization and computes Euclidean distances acr

Indicator v4 AI / machine learning
Updated 4 years ago · None stated GitHub repository of Function K-Means Clustering

Sequential Indicator

by capissimo
114 stars

Sequential Indicator normalizes price data within a configurable lookback window using min-max scaling and applies linear regression smoothing. It tracks the number of bars elapsed since the smoothed values crossed upper, middle, or lower threshold conditions.

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Sequential Indicator

Breakeven Line Demo

by hasnocool
106 stars

The Breakeven Line Demo strategy is a Pine Script demonstration tool designed to visualize the average position price of stacked trades. It enters long positions after seven consecutive bearish candles and short positions after seven consecutive bullish candle

Strategy v5 Mean reversionSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Breakeven Line Demo

Calculates John Ehlers' Recursive Median Filter, a nonlinear filter combining a 5-bar running median with exponential smoothing to reduce impulsive noise while maintaining responsiveness. The smoothing factor is calculated from the cycle period setting using E

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of Ehlers Recursive Median Filter (RMED)

Exit Once Demo

by be-thomas
65 stars

This strategy demonstrates a partial bracket exit. It enters a long position of four units when the current position size is zero or negative. It then places an exit for two of those units, with a ten-point profit target and a ten-point stop. There are no user

Strategy v4
Updated 5 days ago · GPL-3.0 GitHub repository of Exit Once Demo

TRIX

by mihakralj
47 stars

The TRIX indicator calculates the percentage rate of change of a triple-smoothed exponential moving average (EMA) applied to a selected price source. It incorporates explicit warm-up logic to ensure stable runtime initialization without relying on uncompensate

Indicator v6 Oscillators & momentumMoving averages
Updated 8 months ago · MIT GitHub repository of TRIX

MovingAvg Cross

by TWODS-CAPITAL
37 stars

This strategy calculates a simple moving average of closing prices to detect trend shifts directly on the price chart. It enters a long position when the price remains above the moving average for a specified number of consecutive confirmation bars, and enters

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of MovingAvg Cross
13 stars

Calculates divergence between price movement and the Squeeze Momentum Indicator transitions to identify entry conditions. A short position is opened when the squeeze value decreases while price makes a higher high during bullish momentum decay. A long position

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Ruckard Squeezed F001

Browse by Category

Learn to Use Pine Scripts

Free, plain-English guides: add a script to TradingView, read what it does, test it and avoid the common traps.

  1. 1Using this librarySearch, filters, licences and what the badges mean.
  2. 2Add a script to TradingViewCopy, paste into the Pine Editor, save and add to chart.
  3. 3Indicators, strategies and librariesWhat each type does and how to tell them apart.
  4. 4Spot a script that repaintsWhy some signals change after the bar closes.
  5. 5Backtest a strategyStrategy Tester settings that keep results honest.
  6. 6Send alerts to MT4 or MT5From a TradingView alert to an order in MetaTrader.

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