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.
An always-in-the-market strategy that goes long when the daily close is above a 50-bar SMA and short when below, with an optional hysteresis band and a switch to disable shorts. It simulates a perpetual futures position with a funding cost charged over the hol
A price-chart overlay that redraws each bar as a candle whose open equals its close, leaving only the high, low and close visible. Bars are coloured by comparing the close with the previous close, using one colour for a close at or above it and another for a l
The Engulfing Candles indicator automatically identifies and highlights bullish and bearish engulfing candlestick patterns directly on the price chart. It checks whether the current bar fully wraps around the body of the previous bar and exceeds a customizable
This library builds real-time Smart Money Concepts context frames on each bar. It derives StructureFrame using engine primitives for BOS, CHoCH, trend and S-R levels. ImbalanceFrame tracks FVG lifecycle, BPR overlap, liquidity void and zone-bias. ZoneFrame man
A long-only strategy that requires two volume flow measures to agree: On Balance Volume and Accumulation/Distribution, each compared with its own EMA. It enters long when both are above their signals for the first time and price is above a longer EMA filter. I
Plots a wide array of built-in Pine Script volatility calculations in a separate pane. It outputs true range variations, average true range across multiple periods, standard deviation, variance, mean absolute deviation, Bollinger Bands and Bollinger Bands Widt
This reference script demonstrates multiple usage examples of Pine Script's request.security function. It plots higher-timeframe data directly on the price chart, including the daily close, weekly high and low levels, daily 20-period EMA, and the previous day'
A long and short strategy based on five moving averages of 10, 20, 50, 100 and 200 bars. It can require the averages to be in perfect order with aligned slopes, filter entries by ADX range, and optionally by RSI and a higher timeframe moving average. A strict
A strategy that detects classic chart patterns from pivot points on the price chart: double and triple tops and bottoms, head and shoulders, flags, pennants, wedges, triangles, rectangles and cup and handle shapes. Each can be switched on or off, with toleranc
This indicator implements a multi-metric confirmation engine that validates trading signals across four core dimensions: trend level scores based on an HLC3 SMA, momentum z-scores derived from rate of change, volatility expansion ratios comparing fast and slow
A long-only crypto spot strategy whose support and resistance section can be switched on or off and set as the main entry trigger or as a secondary filter. When enabled, it uses pivots on four timeframes, ATR-sized touch zones and a retest window. Trend filter
Calculates the WaveTrend oscillator using channel and average exponential moving averages alongside a simple moving average signal line in a separate pane. It plots the dual oscillator lines, their difference area, and configurable overbought and oversold thre
An overlay indicator that stores the first and second candle after a configurable market open time each day and shows them in a fourteen-column table. For each day it lists the first candle high, low and average, the resistance and support derived from them, a
Draws open, previous high, previous low and previous midpoint lines for several periods on the price chart: intraday, daily, weekly, monthly, quarterly and yearly, plus the Monday range and midpoint. Each group can be enabled separately, with options for mergi
Synthetic test fixture for a strategy-description simulator, drawn in a separate pane. Instead of chart prices it uses a built-in array of four artificial candles, so it runs the same on any chart. The comments state the policy: signals at bar close, fills at
The XAUUSD Scalping Confluence Engine is a separate-pane indicator that calculates a composite trading score based on multiple technical factors. It evaluates a four-period exponential moving average stack, SuperTrend trend direction, Relative Strength Index,
An indicator in a separate pane that measures the shape of recent log returns over a rolling window using skewness and excess kurtosis. It converts them into a Cornish-Fisher value-at-risk estimate compared with the Gaussian version, a comparison of left and r
This Pine Script indicator detects pivot highs and lows on the price chart using the specified left and right pivot periods. It computes mirror levels based on two Fibonacci multiplier sets with an optional logarithmic scale for visualization. Auto-adjust scal
Higher Close Demo is a Pine Script v6 teaching indicator drawn on the price chart. It checks whether the current close is greater than the previous close. When that condition is true, it plots a green upward triangle below the bar. The script has no user input
An overlay indicator that computes a volume-weighted price average using SMA, RMA, HMA or ALMA, fits a linear regression to it as a fair value baseline, and draws bands at one, two and three standard deviations of price around it. The baseline and band fills t
Draws volume order blocks on the price chart and adds three tiers of asymmetric buy and sell volume signals: a percentage-threshold tier, a one-sided volume tier and a super volume tier. A cooldown spaces signals. High-volume proximity markers fire when a roll
A trend strategy on the price chart built on a double-smoothed Supertrend using WMA and EMA smoothing, with pivot rejection entries when price touches the baseline. Settings scale automatically by timeframe. Stop loss can use the flip candle, baseline or swing
Plots a smoothed moving average stack alongside detected W and M patterns, RSI momentum filtering, and Fibonacci-style extension targets. The indicator evaluates trend alignment across fast, medium, and slow SMMAs, scans recent price bars for double top or bot
A Pine v5 overlay that draws estimated liquidity zones as colored boxes on the price chart. It finds pivot highs and lows over the last 500 bars, sizes each box with a multiple of ATR that depends on the timeframe, and colors it by volume between a minimum and
This large indicator applies ICT-style smart money analysis to gold on the price chart, covering order blocks, breaker blocks, liquidity pools, premium and discount positioning and market structure. Buy and sell signals can be gated by a discount or premium fi
A strategy that trades price crossings of an exponential moving median line on the price chart. It buys when close crosses above the line and sells when it crosses below, closing the opposite position on the same cross. An optional higher-timeframe filter, def
This strategy executes trades based on Triangular Moving Average (TMA) crossings, support and resistance structures, and breakout logic. It evaluates multiple confluence conditions including daily pivots, anchored VWAP, and multi-day moving averages alongside
This Smart Money Concepts (SMC) strategy identifies market structure, order blocks, imbalances, and premium or discount zones directly on the price chart. It executes long trades in discount zones and short trades in premium zones based on order block retests,
An overlay indicator that tracks the most recent confirmed swing high and swing low and prints a small label when the close crosses beyond them. A green B label appears below the bar when the close crosses above the last pivot high, and a red S label appears a
The 8_KLSE_Quality_Overlay is a Pine Script v5 indicator that overlays quality grades on the price chart for KLSE stocks. It combines user inputs from KC Chong 8-Criteria, Cold Eye 8-Criteria, Tong Kooi Ong tiers, and Tradeview MONEY equation to assign grades
HA Moving Average calculates a moving average from Heikin Ashi prices fetched for the chart symbol, while the chart itself can stay on normal candles. Users choose the average type (EMA, SMA, RMA or WMA), the length and the Heikin Ashi source. The line changes
This strategy plots a 12-period and a 26-period exponential moving average on the price chart. It enters long when the fast average crosses above the slow average and enters short when the fast average crosses below the slow average. Opposite signals reverse t
A price-chart overlay for gold that labels WAIT and CONFIRMED buy and sell setups and can draw entry, stop loss and take profit lines. A signal mode of aggressive, balanced or strict and a manual news risk setting, including a no-trade option, control how sele
Overlays higher-timeframe context on the price chart, using lower-timeframe data to find volume spikes inside each higher-timeframe bar. It combines RSI pivot divergence with a volume conviction check, and can show a ghost of the previous bar, stacked imbalanc
This overlay strategy finds swing highs and lows, then marks an Optimal Trade Entry band between the 0.62 and 0.79 retracements of the latest impulse. A long is allowed only inside the bullish band and above a trend EMA; a short is allowed only inside the bear
An overlay toolkit for crypto charts that combines a volume profile with value area, an anchored VWAP, EMA lines, a higher-timeframe EMA bias and an order flow proxy from lower-timeframe delta, relative volume and cumulative delta, plus swing and ATR-based pri
This strategy generates buy and sell signals on the SP500 4H chart using EMA crossovers confirmed by MACD, filtered by ADX trend strength, RSI levels, and active London or New York sessions. It plots EMA 9, EMA 21, and EMA 200 on the price chart. Buy signals e
This indicator draws horizontal levels on the price chart from text the user pastes in, with separate boxes for daily levels, weekly levels and VIX levels. Each line is labelled and coloured green when the close is above it and red when below. On index charts
Shows four tools in one separate pane: RSI with divergence detection, a squeeze momentum histogram from Bollinger and Keltner bands, an ADX and DMI block, and WaveTrend with overbought levels. Each can be switched on or off and has its own length inputs, with
This compact indicator labels Elliott Wave counts on the price chart. It runs a zig-zag at several depths, chooses the depth that gives the best fit, and applies Elliott Wave rules, with a strict mode that forces an A-B-C count when the rules break. A correcti
An indicator that shows an adaptive True Strength Index in a separate pane while projecting signals onto the price chart. It detects the instrument type, such as gold, silver or major indices, and the timeframe to pick parameters, adapts reactivity to ATR, and
Computes a z-score of price against a selectable moving average (SMA, EMA, WMA or VWMA) and compares it with thresholds that can adapt to the volatility regime. Inputs set the lookback, volatility lookback, base, minimum and maximum thresholds, and a signal mo
A strategy that plots two MACD histograms in a separate pane, a slower trending pair (89 and 144) and a faster energy pair (13 and 21). Backtesting is switched on by a setting, with a long or short direction and a mode choice between trend following and diverg
This indicator identifies shooting star candlestick reversal patterns directly on the price chart. It checks for a small real body, an extended upper shadow, and a minimal lower shadow following an uptrend of user-defined length. The script also requires a pri
BTC ATH Scaling tracks the all-time high price and calculates the percentage drawdown from that peak. It displays a real-time label offset to the right of the latest price candle showing the ATH level, current price, and percentage drop. The label color dynami
An indicator that takes a four-hour EMA trend with a small deadzone and looks for one-hour entries in the same direction, either a fast and slow EMA crossover or a pullback, with optional volume confirmation. Stops and targets are ATR multiples with one, two a
This strategy looks for mean-reversion entries when RSI crosses back through the oversold or overbought levels, or recovers from more extreme RSI readings. Optional divergence confirmation can require a price and RSI mismatch before entry. It opens one long or
This indicator automatically detects support and resistance levels using pivot point analysis on historical price data. It identifies potential resistance at pivot highs and support at pivot lows, storing up to the maximum number of unique levels (default 3 ea
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.