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

Martingale Lab

by jayadevrana
1 stars

Martingale Lab is an educational indicator that tests position sizing models, including flat stake, martingale, and anti-martingale, on simulated trade results from an EMA crossover strategy. It logs trade returns in R-multiples using ATR-based stop losses and

Indicator v6 Moving averagesScreeners & dashboards
Updated 2 days ago · MPL-2.0 GitHub repository of Martingale Lab

SMC HTF Confluence

by skipp-dev
1 stars

SMC HTF Confluence calculates multi-timeframe market structure and setup scores using confirmed higher-timeframe data. It evaluates exponential moving averages for trend alignment, RSI for divergences, ATR for volatility regimes, and Bollinger Band Squeezes re

Indicator v6 TrendSMC / ICT / price action Repaints
Updated 2 days ago · None stated GitHub repository of SMC HTF Confluence

Input Source Runtime Override

by pineforge-4pass
1 stars

This strategy computes two simple moving averages on a selectable price source and plots them on the price chart. The source defaults to close but can be overridden at runtime via the input panel, for example to high. It signals long entries on fast SMA crossi

Strategy v6 Moving averagesTrend
Updated 5 days ago · Apache-2.0 GitHub repository of Input Source Runtime Override

P Syn Time Functions

by GammaExpansion
1 stars

This indicator plots the sum of several time variables using Pine Script v6. It defines multiple timestamp values with different formats and timezones, then applies functions including dayofweek, hour, minute, second, year, month, dayofmonth, weekofyear, timef

Indicator v6
Updated 5 days ago · MIT GitHub repository of P Syn Time Functions

DEPV2 C2 · SIRALAMA

by YuceSezar89
1 stars

This indicator ranks five user-selected symbols in a separate pane. On a chosen signal timeframe it computes a 12-bar log return, an ATR percentage, a directional state, and a score equal to direction times return divided by ATR. An RSI reading above 40 gates

Indicator v6 Oscillators & momentumVolatility & bands
Updated 11 days ago · None stated GitHub repository of DEPV2 C2 · SIRALAMA

This indicator plots session-filtered bullish and bearish engulfing markers on the price chart. A long mark appears when the current candle engulfs the prior candle inside the New York window and volume exceeds 1.5 times its 20-bar average. A short mark uses a

Indicator v6 Candlestick patternsSessions & time Repaints
Updated 2 months ago · None stated GitHub repository of TeleNexus Sovereign ORB Multi-Model

MES + XSP Busby Pivot

by majohnst
1 stars

This indicator draws Busby-style pivot levels on the price chart for XSP, using a selectable MES or ES futures symbol. It stores New York premarket highs, lows, and closes on the chart and on a 15-minute MES series, then builds an opening-range box after the r

Indicator v5 Support & resistanceSessions & time
Updated 3 months ago · None stated GitHub repository of MES + XSP Busby Pivot

RS vs KLCI 63d

by kevinesk
1 stars

RS vs KLCI 63d measures the relative strength of a stock compared to a benchmark index over a customizable lookback period, defaulting to 63 trading days against the FTSE Malaysia KLCI. It calculates the difference between the stock's percentage return and the

Indicator v5 Oscillators & momentumScreeners & dashboards
Updated 4 months ago · None stated GitHub repository of RS vs KLCI 63d
1 stars

Corpus Array Stats Helpers is an experimental Pine Script strategy designed to test array manipulation and moving average functions. During the first 50 bars, the script collects close prices into an array to perform statistical calculations like sum, average,

Strategy v5 Moving averagesTrend
Updated 4 months ago · MIT GitHub repository of Corpus Array Stats Helpers

MA+SQZ+STO V1

by gabriel-klettur
1 stars

This strategy combines exponential moving averages, a Stochastic oscillator, and Squeeze Momentum calculations to identify long trade entries on the price chart. It enters long positions when the Stochastic K line crosses above D in oversold territory while pr

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of MA+SQZ+STO V1
1 stars

This indicator combines Volume Weighted Bands, a Keltner Hull Suite, High Volume Nodes, and Supply and Demand Zones directly on the main price chart. It calculates a smoothed volume-weighted trend line surrounded by ATR-based bands to define market bias and hi

Indicator v6 TrendVolatility & bands
Updated 7 months ago · None stated GitHub repository of Keltner Hull Suite Integrated

Double EMA Crossover

by Basant1Saini
1 stars

The Double EMA Crossover strategy plots a fast 9-period EMA and slow 21-period EMA on the price chart with a 200-period trend EMA filter. It generates long signals on golden crosses when price exceeds the trend EMA and MACD is bullish, and short signals on dea

Strategy v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Double EMA Crossover

ES Absolute Trigger

by knectardev
1 stars

This strategy captures the first bar of each new day as an opening range and plots those high and low levels on the price chart. It enters one long position if price trades above the range high, or one short if price trades below the range low, then blocks fur

Strategy v5 BreakoutSessions & time
Updated 9 months ago · None stated GitHub repository of ES Absolute Trigger
1 stars

This indicator identifies market trends and projects dynamic price targets directly on the price chart. It calculates high and low bands using simple moving averages offset by a smoothed Average True Range buffer. Bullish and bearish trend signals trigger when

Indicator v5 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Target Trend [BigBeluga]

Hello World

by fiji-solutions
1 stars

This educational script demonstrates how to evaluate bar states in Pine Script v5. It retrieves the status of the current price bar using the built-in barstate.isconfirmed variable to check if a bar has officially closed. When the bar state is confirmed, it pl

Indicator v5
Updated 2 years ago · None stated GitHub repository of Hello World

Fisher Standardize Index

by JohnsonHsiao
1 stars

The Fisher Standardize Index indicator calculates a standardized price between the lowest and highest values over a user-specified period, then applies the Fisher transformation formula to produce an oscillator value. It plots the resulting fisher_trans in a s

Indicator v5 Oscillators & momentum
Updated 3 years ago · None stated GitHub repository of Fisher Standardize Index
948 stars

The Adaptive RSI Moving Average (ARSIMA) is an overlay indicator that dynamically adjusts its smoothing factor based on the Relative Strength Index (RSI). When the RSI moves toward extreme overbought or oversold conditions, the smoothing factor increases to ma

Indicator v4 Moving averagesOscillators & momentum
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive RSI Moving Average

This overlay indicator looks for price retracing toward an ICT order block defined from the highest high and lowest low over a set candle period. It marks bullish and bearish touches, with an optional vertical offset that widens the touch zone around the first

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Retracement to Order Block with Screener
330 stars

Supertrend + RSI Strategy [Alose] combines the classic Supertrend indicator with the Relative Strength Index (RSI) to enter and exit positions on the price chart. Long trades open when the Supertrend is bullish and RSI crosses above 50, while short trades requ

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Supertrend + RSI Strategy [Alose]

ADBE-Tracker

by Allen1212
303 stars

ADBE Tracker displays historical buy and sell transactions executed by ARK Invest for Adobe Inc. directly on the main price chart. It plots color-coded labels above or below price bars corresponding to specific transaction timestamps, indicating whether ARK fu

Indicator v4
Updated 2 years ago · None stated GitHub repository of ADBE-Tracker
261 stars

The script defines two functions for Box-Cox array transformations in Pine Script v5. The regular function applies the transformation to stabilize variance using the provided lambda parameter, while the inverse function reverses the process. It demonstrates th

Indicator v5
Updated 4 years ago · None stated GitHub repository of Function - Array Transform Box-Cox
257 stars

This overlay strategy is built for ES futures on the one-minute chart. It plots a volume-weighted moving average of price opens and standard-deviation bands at Fibonacci ratios, plus a second longer volume-weighted average from a higher-timeframe open. Call an

Strategy v5 Volatility & bandsMoving averages
Updated 6 weeks ago · None stated GitHub repository of ES Futures 1M No Repaint

Commitment Gauge

by harryguiacorn
219 stars

This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete

Indicator v4 VolumeCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Commitment Gauge
219 stars

This indicator detects swing highs and swing lows across price action and plots markers directly on the price chart. It checks whether the high or low of a historical bar offset by a configurable lookback is the highest or lowest value within a symmetrical win

Indicator v4 Support & resistance
Updated 5 years ago · None stated GitHub repository of 教學:尋找高低點4

Dynamic Linear Regression

by TradersPost
218 stars

Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Dynamic Linear Regression
114 stars

This indicator plots a dynamic step trendline directly on the price chart using Kaufman Efficiency Ratio (ER). It blends short and long standard deviations based on price efficiency to construct adaptive step thresholds. Trend flips trigger buy and sell signal

Indicator v4 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Efficient Trend Step Mod
106 stars

This strategy calculates momentum signals using MACD crossovers filtered by EMA trend filters and an optional RSI indicator. It enters long and short positions directly on the price chart using customizable percentage-based stop loss and take profit targets. T

Strategy v5 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5min MACD Scalp by Joel (3commas)

This indicator plots Average Directional Movement Index Rating in a separate pane. It smooths true range and directional movement to produce plus DI, minus DI, the directional index, and ADX. ADXR averages the current ADX with the ADX from the rating period ba

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Average Directional Movement Index Rating (ADXR)

Example 2

by be-thomas
65 stars

An educational indicator from TradingView documentation that demonstrates how to render custom price bars using the plotbar function. It evaluates whether the close is greater than or equal to the open on each bar to determine a bullish or bearish status. Bars

Indicator v5 Candlestick patterns
Updated 4 days ago · GPL-3.0 GitHub repository of Example 2

This indicator tracks smart money market structure directly on the price chart. It calculates dual-period swing highs and swing lows to detect Changes of Character (CHoCH), Breaks of Structure (BOS), inducements, and liquidity sweeps. When structural levels ar

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · Apache-2.0 GitHub repository of Market Structure with Inducements & Sweeps [LuxAlgo]
56 stars

This indicator calculates dynamic upper and lower trendlines from pivot highs and pivot lows across a specified bar length. Trendline slopes are derived using ATR, standard deviation, or linear regression methods. It plots trendlines and breakout signal labels

Indicator v5 TrendSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of Trendlines With Breaks [LUX]
55 stars

Calculates swing points, dynamic support and resistance channels, and a baseline trend moving average directly on the price chart. It identifies structural highs and lows using 10-bar pivot logic, plotting colored triangles offset to confirmed swing bars. Dyna

Indicator v6 Support & resistanceTrend
Updated 6 months ago · Apache-2.0 GitHub repository of Structural Levels & Key Zones
47 stars

The Cubic Regression Moving Average calculates a fitted endpoint using a degree-three polynomial over a specified lookback period via normal equations solved by closed-form elimination. It plots the resulting trend line directly on the price chart. Users can a

Indicator v6 TrendMoving averages
Updated 8 months ago · MIT GitHub repository of Cubic Regression Moving Average
46 stars

This indicator calculates and plots standard deviation projection levels based on historical session ranges. It draws the session open line alongside positive and negative standard deviation bands (0.5, 1.0, 2.0, 3.0, and 4.0 SD) directly on the main chart, ac

Indicator v6 Sessions & timeVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of Session Standard Deviations with Stats
43 stars

This indicator plots a modified Ichimoku set on the price chart. It builds Tenkan, Kijun, Chikou, and both Senkou lines from a ten-bar average of the open rather than the usual high-low midpoint, then fills the cloud between Senkou A and Senkou B. A green tria

Indicator v5 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of No Repaint - ICHIMOKU

BarUpDn Strategy

by TWODS-CAPITAL
37 stars

This strategy trades on the price chart from the current bar versus the prior close. It enters long when the bar closes above its open and that open is above the previous close, and enters short when the bar closes below its open and that open is below the pre

Strategy v5 Candlestick patterns Repaints
Updated 3 years ago · MIT GitHub repository of BarUpDn Strategy
29 stars

This indicator calculates the current bar's high-minus-low range in points, excluding overnight gaps. It then computes a simple moving average of that range over a user-set length and the ratio of the current range to that average. The length input defaults to

Indicator v5 Volatility & bands
Updated 2 weeks ago · MIT GitHub repository of Average Bar Range Stats

Supply and Demand Visible Range identifies supply, demand, and equilibrium zones across the visible chart range. It accumulates high, low, and volume data starting from the leftmost visible bar, optionally requesting lower timeframe intrabar data for finer res

Indicator v5 Support & resistanceVolume Repaints
Updated 2 months ago · AGPL-3.0 GitHub repository of Supply and Demand Visible Range [LuxAlgo]

Morning Scalp

by benso87
24 stars

This strategy tracks an opening session time range to establish directional bias and triggers pullback trades using Stochastic RSI. Once price breaks out of the initial range, it establishes a directional bias and enters when the Stochastic RSI crosses over in

Strategy v5 Sessions & timeBreakout
Updated 4 years ago · MPL-2.0 GitHub repository of Morning Scalp
16 stars

This strategy enters long or short when price breaks a Keltner channel built from an exponential moving average and an ATR multiple. It sizes each unit from a fixed equity risk percentage and an ATR stop, then can add units as price moves in the trade directio

Strategy v6 TrendVolatility & bands
Updated 11 months ago · None stated GitHub repository of Seykota Alt 23: Keltner Channel

Divergenced G003

by ruckard
13 stars

Divergenced G003 is a strategy that identifies momentum divergences based on Squeeze Momentum Indicator color transitions to trigger long and short entries. Trades are exited using Curie closing moving average lines or configurable percentage-based stop loss,

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Divergenced G003
10 stars

Calculates long and short entry signals tailored for Bitcoin on the 15-minute timeframe using a combination of the Relative Strength Index (RSI), Traders Dynamic Index (TDI) bands, and TD Sequential counts. It triggers long signals when RSI falls below 21 and

Indicator v4 Oscillators & momentumSupport & resistance
Updated 5 years ago · None stated GitHub repository of WE:TDI-TD L/S BTC 15min

Commodity FlowTrend plots a money-flow oscillator in a separate pane. It calculates a manually smoothed Money Flow Index from price and real trade volume, overlays a CCI reading scaled to the same range, and colors a histogram plus an optional background by ex

Indicator v6 Oscillators & momentumVolume
Updated yesterday · MIT GitHub repository of Commodity FlowTrend [WavesUnchained]

Smart Trader Episode 03 divides a specified lookback window into bar groups or blocks on the main price chart. It calculates aggregated composite OHLC candles for each block, draws structural group boxes, and identifies trend segments using custom angle thresh

Indicator v6 TrendCandlestick patterns
Updated 4 months ago · MIT GitHub repository of Smart Trader Ep 03 - Candles and Tradelines

Ultimate Oscillator - Eterna MCP

by EternaHybridExchange
9 stars

This strategy calculates the Ultimate Oscillator in a separate pane from buying pressure and true range over fast, medium, and slow lengths, combined with a four-two-one weighting. It enters long when the oscillator crosses above the oversold level while remai

Strategy v5 Oscillators & momentumDivergence
Updated 7 months ago · MIT GitHub repository of Ultimate Oscillator - Eterna MCP

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