Pine Library · 1,047 open-source scripts

Free Stock Pine Scripts for TradingView (page 9)

Open-source Pine scripts written for shares: relative strength, earnings and gap tools, screeners and stock strategies.

Pine scripts1,047
Code shown here408open licence
Updated in a year564
No repaint flag963

Stocks: Indicators, Strategies and Libraries

TQQQ MA+TSI

by yalili8521
2 stars

The TQQQ MA+TSI strategy executes trades based on triple simple moving average alignment combined with True Strength Index (TSI) divergence or momentum filters. Designed primarily for intraday stock trading, it evaluates price accumulation across fast, mid, an

Strategy v6 TrendOscillators & momentum
Updated 8 days ago · None stated GitHub repository of TQQQ MA+TSI

This indicator compares US sector ETFs with technology and utilities using price ratios that can be log-transformed. It smooths those ratios with a simple moving average and measures fast and mid-length percentage change to classify financials versus technolog

Indicator v5 Oscillators & momentumMoving averages
Updated 10 months ago · MIT GitHub repository of Sector RS & Intermarket Regime Dashboard

This indicator calculates Mansfield Relative Strength by comparing the current asset's close against a reference index, sector, or industry benchmark. It plots the resulting relative strength curve alongside an exponential moving average in a separate pane, hi

Indicator v6 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Mansfield Relative Strength indicator
1 stars

This long-only strategy buys short-term oversold dips only inside a strong uptrend: price above a rising 200-period SMA and within a set percentage of its one-year high. Entry needs a two-period RSI below a threshold, then an up-close, and volatility below an

Strategy v6 Mean reversionTrend
Updated 2 months ago · Custom licence GitHub repository of Regime-Gated Dip Reversion

Pivot Breakout

by majohnst
1 stars

Pivot Breakout is an intraday strategy that identifies breakout opportunities using standard daily floor trader pivot points. It enters trades when price breaks above the calculated daily pivot, provided the prior daily close was within a defined approach dist

Strategy v6 BreakoutSupport & resistance Repaints
Updated 4 months ago · None stated GitHub repository of Pivot Breakout

BB Squeeze + Breakout

by kevinesk
1 stars

This indicator measures Bollinger Band width as a percentage of the middle band and plots it in a separate pane. It marks a squeeze when that width equals its lowest value over 126 bars and also flags bars where the Bollinger Bands sit inside Keltner Channels

Indicator v5 Volatility & bands
Updated 4 months ago · None stated GitHub repository of BB Squeeze + Breakout
1 stars

This strategy trades moving-average crossovers only when the higher timeframe agrees. It requests the higher-timeframe close and a trend moving average, then goes long when that trend is bullish and the fast average crosses above the slow average, and short wh

Strategy v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of MTF - Multi-Time Frame Strategy

NSE Infinity

by anil-sn
1 stars

A long-only strategy that enters on a close above the prior 20-bar high or on a cross back above a 50 EMA, in both cases only while price is above a 200 EMA. It holds one position sized at 90 percent of equity and exits when the close falls below a Chandelier-

Strategy v6 TrendBreakout
Updated 9 months ago · None stated GitHub repository of NSE Infinity
1 stars

This indicator monitors and displays signals across up to five selectable symbols using an on-chart table. It evaluates price relative to the midpoints of highest highs and lowest lows over three lengths derived from a configurable base length. Bullish signals

Indicator v5 Screeners & dashboardsTrend
Updated 1 year ago · MIT GitHub repository of Kurutoga Screener Template
1 stars

A Thai-language indicator that builds a portfolio summary from user-entered holdings and shows it as tables and a small chart on the price chart. It compares portfolio return against a benchmark symbol, groups results by period such as quarter, and supports an

Indicator v6 Screeners & dashboards
Updated 1 year ago · None stated GitHub repository of Portfolio Performance Summary

This indicator uses a two-dimensional k-nearest-neighbours model on scaled oscillator values to classify the current bar as buy, sell, or hold from similar historical states. Users select RSI, ROC, CCI, momentum, or all of them, and set the neighbour count, fa

Indicator v4 AI / machine learningOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Machine Learning: kNN-based Strategy (update)

algo-trade-indian-v1

by akash-yellgetti
1 stars

A strategy-type script for the price chart that plots the high, low and midpoint of the first part of each session, using end hour and minute inputs, and marks those bars. It adds pivot-based support and resistance lines with left and right bar counts, labels

Strategy v5 Sessions & timeSupport & resistance
Updated 2 years ago · None stated GitHub repository of algo-trade-indian-v1

Portfolio Metrics

by amico1234
1 stars

Portfolio Metrics calculates return statistics for the chart symbol against a selectable equity index. It plots alpha, beta, correlation, r-squared, standard deviation, variance, a drawdown measure, and a gain measure in a separate pane. Users choose the bench

Indicator v4 Repaints
Updated 2 years ago · None stated GitHub repository of Portfolio Metrics

Sector AD

by nvFede
1 stars

A Pine v4 indicator in a separate pane that works as a sector advance-decline tally. It reads closing prices for eleven US sector ETFs and the SPY fund, then counts how many sectors closed above their previous close and how many did not. It has no input settin

Indicator v4 Screeners & dashboards
Updated 3 years ago · None stated GitHub repository of Sector AD

4755 Tracker

by Allen1212
303 stars

Plots historical buy and sell transactions made by ARK Invest funds directly on the price chart. The indicator places visual labels above or below price bars on specific timestamps corresponding to trade execution dates, indicating transaction direction and th

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

Moon Dev GEX Arrows

by moondevonyt
92 stars

This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow

Indicator v5 Support & resistanceSessions & time
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Arrows

Paper umbrella trader

by shibisuriya
18 stars

This indicator marks paper umbrella candles on the price chart. It flags a green or red pattern when the upper wick is small relative to the body side and the body thickness stays between set minimum and maximum percentages of the range. On a match it draws a

Indicator v4 Candlestick patternsSupport & resistance Repaints
Updated 4 years ago · None stated GitHub repository of Paper umbrella trader
16 stars

A trend-following strategy based on Ed Seykota's Donchian breakout framework, modified to take a single full-risk entry instead of pyramiding multiple units. It enters long or short on 55-bar channel breakouts with ATR-based position sizing and an initial stop

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 15: Single Position

SPY 0DTE Scalper - 15min

by chris-c-thomas
14 stars

This intraday overlay establishes directional bias and high-conviction swing setups for SPY on the 15-minute timeframe. It computes a weighted confluence score combining an EMA ribbon, a 50 EMA anchor, session VWAP bands, RSI divergence, ADX, TTM Squeeze, cand

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 15min

TR Margin Pulse

by Enesp4rl4k
7 stars

TR Margin Pulse calculates and plots the ratio of marketwide margin calls to required margin using Takasbank data generated via MCP templates. Rendered in a separate pane, the line turns red when exceeding a predefined stress threshold and teal when below. A s

Indicator v6 Screeners & dashboards
Updated 6 days ago · MIT GitHub repository of TR Margin Pulse

LunarTick Initial Balance

by lunarticktrading
7 stars

This indicator tracks and visualizes the initial balance range over customizable trading sessions directly on the price chart. It plots the high, low, and midpoint of the opening balance, with optional session extension levels, an anchored VWAP, and shaded hig

Indicator v6 Sessions & timeSupport & resistance Repaints
Updated 2 weeks ago · None stated GitHub repository of LunarTick Initial Balance
6 stars

This indicator detects regular and hidden divergences between price pivots and RSI or Williams %R. Confirmed swing highs and lows, which wait a set number of bars on each side, are compared with oscillator extremes. Regular divergences mark possible reversals,

Indicator v6 DivergenceOscillators & momentum
Updated 8 weeks ago · MIT GitHub repository of Capital41 Divergence Detector
4 stars

This strategy overlays directly on the price chart to identify pullback buying opportunities during established bullish moves. It checks whether price gained by a specified percentage over an earlier window and subsequently pulled back by a minimum threshold o

Strategy v5 TrendMean reversion
Updated 5 months ago · None stated GitHub repository of Buy the Dip in an Uptrend

Intraday Gap Detector

by might-tree
4 stars

This indicator calculates the percentage price gap between the current bar open and the previous bar close on the price chart. When the absolute gap exceeds a hardcoded threshold of 0.2 percent within the past 30 days, it draws an extended horizontal line at t

Indicator v5 Support & resistanceBreakout
Updated 3 years ago · None stated GitHub repository of Intraday Gap Detector

Dip Bulucu-2

by gocaman
3 stars

Dip Bulucu-2 combines a WaveTrend oscillator and Williams Vix Fix to identify potential market bottoms and trend reversals. It calculates Williams Vix Fix based on standard deviation Bollinger Bands and percentile ranges, highlighting exhaustion bars in red hi

Indicator v5 Oscillators & momentumVolatility & bands
Updated yesterday · None stated GitHub repository of Dip Bulucu-2

TQQQ ORB v1

by yalili8521
2 stars

Calculates the opening range during the initial minutes of regular trading hours and triggers breakout trades directly on the price chart. Long positions enter when price closes above the opening range high, while short entries trigger on closes below the open

Strategy v6 BreakoutSessions & time
Updated 8 days ago · None stated GitHub repository of TQQQ ORB v1
2 stars

IPO Day Anchored VWAP calculates a Volume Weighted Average Price anchored to the first available bar on a chart, representing an asset's initial public offering or historical debut. It plots the anchored VWAP line on the main price chart alongside an anchor la

Indicator v6 Moving averagesSupport & resistance
Updated 3 months ago · Apache-2.0 GitHub repository of IPO Day Anchored VWAP

This strategy generates long entry signals by combining a Donchian Channel breakout with a moving average trend filter, volume confirmation, and a macro volatility regime gate based on CBOE VIX and VIX3M ratios. It enters long positions when prices break above

Strategy v5 TrendBreakout
Updated 10 months ago · MIT GitHub repository of Trend-Breakout System mit VIX Heatmap Gate

My Indicator

by etnt
2 stars

My Indicator overlays timeframe-adaptive moving averages, candlestick pattern detections, and an information table directly on the price chart. Depending on the active chart timeframe, it plots key moving averages including daily SMAs and EMAs, intraday VWMA a

Indicator v6 Moving averagesCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of My Indicator

Market Width

by iceberg211
2 stars

This indicator plots the percentage of stocks in a selected index trading above their 20, 50, 100, 200, and selected other day moving averages. It automatically detects the main chart symbol and switches to the corresponding index ticker such as S&P or NDX, or

Indicator v4 Moving averagesSupport & resistance
Updated 1 year ago · None stated GitHub repository of Market Width

TD Pro levels - QCOM

by mphinance
1 stars

A static snapshot overlay for one stock that draws fixed horizontal lines and last-bar labels at price levels typed into the code. The lines include several scored magnet levels, a gamma flip level, an entry zone, a stop level, two target levels and expected m

Indicator v6 Support & resistance
Updated 2 days ago · Custom licence GitHub repository of TD Pro levels - QCOM

The Fractal Cone

by tthanhvu002sgu
1 stars

Projects an adaptive probability cone ahead of price on the chart. It measures kurtosis of price changes over a slow lookback to label the instrument growth-like or value-like, then chooses between fast and slow settings in parallel. A Hurst estimate from frac

Indicator v5 Volatility & bandsSupport & resistance
Updated 3 months ago · None stated GitHub repository of The Fractal Cone
1 stars

This price-chart strategy builds a prior-day floor pivot from yesterday’s high, low, and close, plus the related resistance and support levels. It looks for a break above that pivot when the prior close was within a set percentage below it, and can require pri

Strategy v6 Support & resistanceBreakout
Updated 4 months ago · None stated GitHub repository of Pivot Breakout (NON-REPAINT)
1 stars

This indicator maps Smart Money Concepts (SMC) elements directly onto the price chart. It identifies swing highs and swing lows to track market structure (HH, HL, LH, LL), Break of Structure (BoS), and Change of Character (CHoCH) using either pivot or session

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 4 months ago · None stated GitHub repository of SMC Market Structure Indicator
1 stars

This indicator assists intraday breakout execution on KLSE stocks. It plots VWAP, EMA 9, EMA 21 on the price chart along with an opening range from the first 30 minutes of the session and a buy zone band above the daily pivot price. Settings control the pivot

Indicator v5 Moving averagesSupport & resistance
Updated 4 months ago · None stated GitHub repository of KLSE Intraday Execution Helper
1 stars

ORB - Opening Range Breakout calculates the highest high and lowest low during a configurable opening session and trades breakouts during the subsequent trading session. When the closing price crosses above the opening range high, it enters a long position; cr

Strategy v5 BreakoutSessions & time
Updated 7 months ago · None stated GitHub repository of ORB - Opening Range Breakout
1 stars

This strategy records the high and low during a configurable opening session, defaulting to 09:30–10:00 exchange time, then locks the range when the session ends. It enters long when price closes above the range high and short when price closes below the range

Strategy v5 BreakoutSessions & time
Updated 11 months ago · None stated GitHub repository of Open Range Breakout Strategy
1 stars

Kurutoga Screener Timing Fix calculates price divergence from highest-high and lowest-low midpoints across three lookback horizons. By assessing divergence consistency across base, double, and quadruple lengths, it identifies synchronized momentum conditions.

Indicator v5 Screeners & dashboardsOscillators & momentum
Updated 1 year ago · MIT GitHub repository of Kurutoga Screener Timing Fix
575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener
318 stars

This indicator plots three moving averages on the price chart using lengths of 8, 21 and 50 by default. It colors the first average blue, the second maroon and the third red. A translucent fill between the first and second averages turns lime when the first is

Indicator v5 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TVT 3X Scale In Out

6060-tracker

by Allen1212
303 stars

The 6060-tracker draws historical ARK Invest purchase marks for this stock on the price chart. With the ETF input set to ALL, it places green below-bar labels reading Buy X1 on many fixed calendar dates from June through late November 2020. The only setting sw

Indicator v4
Updated 2 years ago · None stated GitHub repository of 6060-tracker
92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap
16 stars

This strategy trades Donchian channel breakouts on the price chart and exits on a shorter Donchian channel. It sizes each unit from a percentage of equity and an ATR-based initial stop, then adds units as price moves a set ATR distance, up to a maximum unit co

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 16: Anti-Chop Filters

SPY 0DTE Scalper - 1m

by chris-c-thomas
14 stars

This overlay indicator marks CALLS and PUTS labels on the price chart when a strict boolean gate of price structure, momentum, volatility, breadth, and candle confirmation all pass. It plots an EMA ribbon with cloud fill, session-anchored VWAP and standard-dev

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

This indicator overlays background and color signals on the price chart based on Relative Strength Index (RSI) and Moving Average Convergence Divergence (MACD) conditions. It calculates RSI alongside a high-based MACD line and defines timeframe-specific overbo

Indicator v4 Oscillators & momentumMoving averages
Updated 5 years ago · None stated GitHub repository of RSI - MACD Background Indicator
4 stars

Ichimoku Cloud — Large Cap is a long-only trend-following strategy designed for large-cap stocks. It calculates standard Ichimoku components, including Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span. Trades enter on a bullish Tenkan/Kijun

Strategy v5 TrendSupport & resistance
Updated 5 months ago · None stated GitHub repository of Ichimoku Cloud — Large Cap

More Pine Script Categories

Browse the whole Pine Library

Third-party code. ForexR lists open-source Pine scripts from GitHub; it did not write, test or endorse them, and their summaries are generated automatically from each script's code and README. Indicators describe the past, and a strategy's backtest can look better than live trading. Check a script on a demo account before you rely on it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.

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.
  7. 7What Pine Script isThe language, what it can and cannot do, and where to start.
  8. 8Write your first indicatorA complete script, line by line, in the Pine Editor.
  9. 9Read a script before you trust itA routine for checking inputs, logic and red flags.
  10. 10Edit a script safelyChange colours and lengths, add a filter or an alert.
  11. 11Pine Script alertsalertcondition(), alert(), placeholders and webhooks.
  12. 12Build a crossover strategyAn EMA cross strategy with an ATR stop, ready to test.

Trade Your Charts With a Regulated Broker

Compare regulated brokers on platforms, spreads, minimum deposit and leverage.

Compare brokers