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

Stochastic

by TWODS-CAPITAL
37 stars

This indicator plots a classic stochastic oscillator in a separate pane. It calculates %K from the close relative to the high-low range over a set length, then smooths that value, and calculates %D as a moving average of %K. It draws the %K and %D lines plus h

Indicator v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Stochastic

Trailering A004

by ruckard
13 stars

Trailering A004 is an automated trading strategy designed to optimize entry and exit points while minimizing stop loss and maximizing take profit. It calculates signals using high and low closing moving averages and supports strict long or short filtering. The

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Trailering A004

Mizan Trinity Oscillator

by eddiebelaval
7 stars

The Mizan Trinity Oscillator synthesizes normalized Commodity Channel Index (CCI), Chaikin Money Flow (CMF), and On-Balance Volume Rate of Change (OBV ROC) into a single composite oscillator plotted in a separate pane. Each component is scaled from 0 to 100 an

Indicator v5 Oscillators & momentumVolume
Updated 3 months ago · None stated GitHub repository of Mizan Trinity Oscillator

NY SMC Suite Strategy

by alboogycOdR
6 stars

This Smart Money Concepts strategy identifies trading setups based on Order Blocks, Fair Value Gaps, market structure alignment, and defined session killzones directly on the price chart. It calculates a confluence score combining active killzones, order block

Strategy v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of NY SMC Suite Strategy

M&M Trading

by g-moe
3 stars

M&M Trading is an overlay indicator that combines momentum calculations with moving averages and a visual dashboard. It calculates a modified Chande Momentum Oscillator with adjustable multipliers to identify bullish and bearish momentum triggers, optionally c

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of M&M Trading
2 stars

Calculates and displays a miniature higher timeframe candlestick chart directly on the price chart using a TradingView table element. It retrieves OHLC data for a user-selected timeframe and symbol via security calls, rendering bodies and wicks onto an adjusta

Indicator v5 Screeners & dashboards
Updated 8 months ago · None stated GitHub repository of Higher Time Frame Chart Overlay

PF Probe 76 Dual Side No Cancel

by pineforge-4pass
1 stars

A test strategy from a reference corpus that lets a long stop entry and a short stop entry exist at the same time. During the first 45 minutes of the 02:00 hour it places a buy stop one tick above the bar high, and during the 14:00 hour a sell stop one tick be

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 76 Dual Side No Cancel

Naga Disp v2

by nishpa800
1 stars

Marks a candle when a very high volume reading and a large displacement happen on the same bar. Volume tiers compare the bar against lookbacks of 1000, 2000, 3000 and 4000 bars, and displacement compares the candle range to a standard deviation multiple with a

Indicator v5 VolumeSessions & time
Updated 2 months ago · None stated GitHub repository of Naga Disp v2

Tn Sovereign VWAP

by raybird
1 stars

A mean reversion strategy built on an anchored VWAP with standard deviation bands, drawn on the price chart. The anchor resets each session, day or week. It buys when price crosses below the lower band with RSI oversold while above a 200 EMA, and sells short o

Strategy v6 Mean reversionVolume
Updated 2 months ago · None stated GitHub repository of Tn Sovereign VWAP
1 stars

This indicator draws Future Line of Demarcation lines on the price chart: the price source is shifted forward by half a cycle for up to three cycle periods, with automatic or manual periods and bar multipliers based on the chart timeframe. Projected forward an

Indicator v4 Support & resistance Repaints
Updated 6 months ago · None stated GitHub repository of FLD with Projection Simple V2a

HEN-tracker

by Allen1212
303 stars

HEN-tracker marks historical ARK Invest activity for the HEN stock directly on the price chart. The visible script places one green buy label below the bar at a fixed January 2020 date, with text showing a single buy. The only input is an ETF selector that off

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

test-018-error_input_ITEM_AT

by ricardosantos79
261 stars

This indicator is a Pine Script v4 test of updating a global float array from inside a function. It stores a one-element seed array and a local generator that pops the seed, mixes it with fixed constants, and pushes a new seed back. It calls the generator twic

Indicator v4
Updated 4 years ago · None stated GitHub repository of test-018-error_input_ITEM_AT

(IK) Grid Script

by hasnocool
106 stars

This strategy overlays an automated grid trading system directly onto the price chart. It defines upper and lower boundaries either manually or dynamically using recent price extremes or a simple moving average with deviation bands. An array of evenly spaced g

Strategy v4 Support & resistanceMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of (IK) Grid Script
99 stars

This indicator calculates the geometric mean of a user-selected source over a lookback window and plots the result on the price chart. It sums the natural logs of positive values, then exponentiates their average. Missing and non-positive values are skipped, a

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Geometric Mean (GEOMEAN)

My Script

by be-thomas
65 stars

This indicator plots the closing price of each bar in a separate pane. It is a minimal Pine Script version 4 study titled My Script, used as a language-structure example. There are no input settings and no calculated series beyond the raw close. It does not ge

Indicator v4
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Stochastic RSI

by TWODS-CAPITAL
37 stars

This indicator calculates and plots the standard Stochastic RSI oscillator in a separate pane. It derives a Relative Strength Index from the selected price source, applies the Stochastic oscillator formula to those RSI values, and smooths the results into %K a

Indicator v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Stochastic RSI

Trailering B001

by ruckard
13 stars

Trailering B001 is an automated trading strategy designed to generate trade alerts and integrate with Zignaly copy-trading platforms. It utilizes custom moving average bounds (Curie High and Low closing MAs) to gauge price excursions and trigger long or short

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trailering B001

ORION: Hybrid Strategy

by eddiebelaval
7 stars

This strategy identifies volatility breakout opportunities by constructing dynamic ATR-based price boxes and detecting volatility squeezes. Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger up

Strategy v5 Volatility & bandsBreakout
Updated 3 months ago · None stated GitHub repository of ORION: Hybrid Strategy

MA Trend Percent Target Strategy is a trend-following overlay strategy that executes trades based on price crossovers with a moving average. It supports multiple moving average types, including SMA, EMA, WMA, VWMA, and HMA. Trades enter when price crosses abov

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of MA Trend Percent Target Strategy

Higher-timeframe requests

by regalouisei
2 stars

This indicator calculates and plots higher-timeframe source data directly on the main price chart. It allows users to request higher-timeframe values using either a fixed timeframe setting or a dynamic multiplier of the chart's current timeframe. Users can tog

Indicator v5 Repaints
Updated 8 months ago · None stated GitHub repository of Higher-timeframe requests
1 stars

This Pine Script strategy is a test probe designed to evaluate order engine execution around pending stop orders and position closures. On a 15-minute timeframe, it submits a long stop order above the current high at 02:15 UTC and closes open long positions at

Strategy v6 Sessions & timeBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 77 - Stale Stop After Close
1 stars

Mirror Oscillator Pro is a momentum oscillator plotted in a separate pane. It detects pivot highs and lows on a user-selected timeframe and price source using specified pivot lengths. The indicator builds multiple bands including highest-lowest ranges, ATR ban

Indicator v5 Oscillators & momentumVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of Mirror Oscillator Pro by Morindok

SuperTrend Recovery

by vedkanani123
1 stars

A SuperTrend variant for the price chart using ATR bands around the midpoint of each bar. When price moves against the level where the trend last switched by more than a threshold in ATRs, the band moves toward price by a small percentage weight, so the trend

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of SuperTrend Recovery

Naga Disp v2 (Tick)

by nishpa800
1 stars

Marks a candle when a very high volume reading and a large displacement happen on the same bar. Volume tiers compare the bar against lookbacks of 1000, 2000, 3000 and 4000 bars, and displacement compares the candle range to a standard deviation multiple with a

Indicator v5 VolumeSessions & time
Updated 2 months ago · None stated GitHub repository of Naga Disp v2 (Tick)

MD Range Finder 2

by mikeyhu70
1 stars

A Pine Script v4 indicator that finds a recent price range over a set period and draws its baselines at 0, 0.5 and 1 on the price chart, then projects Fibonacci-style extension lines from it at ratios such as 0.382, 0.618, 2, 3 and 4. The timeframe can be auto

Indicator v4 Support & resistance
Updated 6 months ago · None stated GitHub repository of MD Range Finder 2

HEXAB Tracker

by Allen1212
303 stars

HEXAB Tracker plots historical buy and sell transactions from ARK Invest funds as labels directly on the price chart. It marks specific dates when ARK ETFs traded the asset, indicating transaction activity and aggregated counts across multiple funds. Users can

Indicator v4 Screeners & dashboards
Updated 2 years ago · None stated GitHub repository of HEXAB Tracker

Test-020-Freq

by ricardosantos79
261 stars

This indicator counts how often rounded high-low ranges appear. After the first 100 bars, it measures the highest high and lowest low for every lookback from 1 to 100 bars, converts each range into bins of ten minticks, and stores a hit count in a large intege

Indicator v4 Volatility & bands
Updated 4 years ago · None stated GitHub repository of Test-020-Freq

10PreBuyer

by hasnocool
106 stars

10PreBuyer is a dip-buying strategy that submits limit orders below recent price action using a discounted Hull Moving Average (HMA). It calculates the highest HMA value of high prices over a selected period, multiplied by a percentage discount factor, and pla

Strategy v4 Moving averagesMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of 10PreBuyer

Granger Causality Test

by mihakralj
99 stars

Calculates the Granger Causality F-statistic with lag 1 to test whether a secondary symbol helps predict a primary price series. The script computes rolling means, variances, and covariances over a specified lookback period using circular buffers. It outputs t

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Granger Causality Test

My Script

by be-thomas
65 stars

My Script is a Pine Script v4 indicator that overlays the price chart. It compares each bar's open with its close and plots a bear character when the open is greater than the close, marking bearish candles. It does not calculate an oscillator, moving average,

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Stochastic Slow Strategy

by TWODS-CAPITAL
37 stars

This strategy plots on the price chart and trades a slow stochastic oscillator. It smooths the stochastic %K with a three-period average and then smooths that result into %D. It enters long when %K crosses above %D while %K is below the oversold level, and it

Strategy v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Stochastic Slow Strategy

Trailering bK003

by ruckard
13 stars

This Pine v5 strategy is a long-only template that sizes entries from the number of trigger conditions and manages exits from price's maximum favorable and adverse excursion. Take profit is a percentage by default, with an optional risk-reward ratio and option

Strategy v5
Updated 1 year ago · None stated GitHub repository of Trailering bK003
7 stars

The Per Bak Self-Organized Criticality indicator calculates a composite fragility score by blending weights for tail risk from the SKEW index, volatility regimes from VIX terms, credit stress from HYG and LQD, and positioning from short volume data. It plots t

Indicator v5 Volatility & bandsSupport & resistance
Updated 3 months ago · None stated GitHub repository of Per Bak Self-Organized Criticality
6 stars

The ORB + Fib + MACD Indicator combines Opening Range Breakout mechanics with Fibonacci retracement levels and MACD momentum filtering. It determines the high and low bounds of a user-defined initial session window, projects Fibonacci entry zones, and calculat

Indicator v5 Sessions & timeSupport & resistance
Updated 7 months ago · None stated GitHub repository of ORB + Fib + MACD Indicator
3 stars

This indicator calculates standard MACD line, signal line, and histogram values while evaluating swing high and swing low pivot points on price and MACD to detect divergence. It compares recent pivot levels to identify higher highs, lower lows, and trend state

Indicator v5 Oscillators & momentumDivergence Repaints
Updated 5 months ago · None stated GitHub repository of MACD - Divergence

How To Set Time Ranges

by regalouisei
2 stars

How To Set Time Ranges is a strategy template designed to demonstrate date and time filtering for backtesting. It calculates fast and slow simple moving averages to trigger long entries on bullish crossovers and close positions on bearish crossunders. Trades a

Strategy v5 Moving averagesTrend
Updated 8 months ago · None stated GitHub repository of How To Set Time Ranges
1 stars

This strategy generates long entries during the 2:00 to 2:45 hour window by placing a stop order at the current high plus one tick. It produces short entries during the 14:00 to 14:45 hour window with a stop placed at the current low minus one tick. All open p

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 78 - dual four bar no close
1 stars

Mirror Oscillator Signals Only is an overlay indicator that projects Fibonacci wave symmetry and calculates signals based on user-selected chart anchor points and Williams Fractals. The script uses interactive time and price coordinates to establish wave refer

Indicator v5 Oscillators & momentumSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Mirror Oscillator Signals Only

Synapse Trail Pro

by vedkanani123
1 stars

A trailing-stop trend indicator on the price chart. The trail is based on an EMA with an ATR band whose multiplier can adapt to volatility, and a ratchet option stops the trail from loosening. Signals receive a quality score and can be filtered by a minimum sc

Indicator v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Synapse Trail Pro

Naga Disp v2.1

by nishpa800
1 stars

Marks a candle when a very high volume reading and a large displacement happen on the same bar. Volume tiers compare the bar against lookbacks of 1000, 2000, 3000 and 4000 bars, and displacement compares the candle range to a standard deviation multiple with a

Indicator v5 VolumeSessions & time
Updated 2 months ago · None stated GitHub repository of Naga Disp v2.1
1 stars

The strategy calculates the Stochastic oscillator using specified K and D periods, then detects bullish and bearish divergences between price pivots and the D line. Bullish signals occur when price forms lower lows while Stochastic forms higher lows within the

Strategy v6 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of TN Stochastic Causal Divergence

MD Range Finder 3

by mikeyhu70
1 stars

A Pine Script v4 indicator, the base version of the range finder, that locates a price range over a 50-bar period with a delay of three bars and draws baselines at 0, 0.5 and 1 on the price chart. Fibonacci-style extension lines are projected from the range an

Indicator v4 Support & resistance
Updated 6 months ago · None stated GitHub repository of MD Range Finder 3

HIMS Tracker

by Allen1212
303 stars

HIMS Tracker visualizes historical transaction records of ARK Invest for HIMS & Hers Health Inc. directly on the price chart. It uses hardcoded historical trade dates to plot green buy and red sell labels above or below price bars. Selecting specific ETF optio

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

Test-021-Sudo

by ricardosantos79
261 stars

This indicator is an experimental Sudoku helper that runs in a separate pane. It stores an 81-cell grid in arrays, seeds a custom pseudo-random function, and checks whether a proposed value already appears in the same row, column, or box. Inputs set the initia

Indicator v4
Updated 4 years ago · None stated GitHub repository of Test-021-Sudo

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