Pine Library · 712 open-source scripts

Free Index Pine Scripts for TradingView (page 13)

Open-source Pine scripts written for stock indices such as the Nasdaq 100, S&P 500 and DAX: opening range, gap and session tools, and index strategies.

Pine scripts712
Code shown here375open licence
Updated in a year601
No repaint flag595

Indices: Indicators, Strategies and Libraries

16 stars

This trend-following strategy executes Donchian channel breakout entries combined with Ed Seykota-inspired risk management. It opens long or short positions when price breaks 55-bar highs or lows, provided optional volume and market regime filters align. Posit

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 37: BE + Time

MTF VİOP Strategy

by trugurpala
4 stars

This overlay strategy combines a higher-timeframe trend filter with chart-timeframe entries. The trend timeframe, default five minutes, uses a fast and slow EMA together with Supertrend. On the chart, recommended at one minute, it looks for an entry EMA cross,

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of MTF VİOP Strategy
257 stars

Snag - ES 1m Strategy Candle Bar is an overlay strategy designed for 1-minute index futures charts like the S&P 500 E-mini. It plots dynamic support and resistance levels derived from pivot highs and lows alongside a custom smoothed filter line and a 3-period

Strategy v5 TrendSupport & resistance Repaints
Updated 6 weeks ago · None stated GitHub repository of Snag - ES 1m Strategy Candle Bar

Hour Stats with Levels

by TamaraKGreen
46 stars

This indicator draws hourly statistics and reference levels on the price chart. It plots optional target lines for the previous hour open, high, low, and midpoint, plus the current hour open. Dashed reversal lines mark the 25th, median, and 75th percentile swe

Indicator v5 Support & resistanceScreeners & dashboards
Updated 7 weeks ago · None stated GitHub repository of Hour Stats with Levels

Cumulative Volume Index

by TWODS-CAPITAL
37 stars

This indicator calculates the Cumulative Volume Index (CVI) by measuring market breadth across major US exchanges. It requests advancing volume and declining volume data for a chosen exchange, computes their net difference, and tracks the cumulative sum over t

Indicator v5 Volume
Updated 3 years ago · MIT GitHub repository of Cumulative Volume Index
16 stars

This trend-following strategy identifies breakout entries using Donchian channels and plots signals directly on the price chart. It executes long and short trades, adding fractional units when relative strength index values confirm momentum. Exits rely on aver

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 38: Triple Combo
4 stars

This intraday strategy executes trades on the Nikkei 225 index based on exponential moving average crossovers restricted to Tokyo Stock Exchange trading hours (09:00 to 15:30 JST). Long and short positions are taken on fast and slow EMA crossovers during activ

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Nikkei Japan Strategy [trugurpala]
1 stars

An overlay indicator for the New York morning window that looks for qualified structure breaks on a 5-minute chart. Direction is filtered by a one-hour bias built from swing structure and EMAs. A break must clear swing, channel or session-extreme levels and pa

Indicator v6 BreakoutSessions & time Repaints
Updated 7 days ago · GPL-3.0 GitHub repository of Morning Structure + Flow Research
16 stars

This strategy plots on the price chart and trades Donchian breakouts in long or short directions. It sizes each unit from a risk percentage of price and an ATR-based initial stop, then adds units at a fixed ATR step up to a maximum. An ATR trail can exit, and

Strategy v6 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Seykota Alt 39: Adaptive Targets
4 stars

This strategy calculates fast and slow exponential moving averages, the Relative Strength Index, and the Average True Range directly on the price chart. It enters long positions when the fast EMA crosses above the slow EMA with RSI above the minimum threshold

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of NQ Nasdaq Strategy [trugurpala]

Gucci 1.0

by wynnforthework
2 stars

Gucci 1.0 is a Pine Script strategy that identifies trend reversals using 55 EMA and 200 EMA crossovers combined with custom high and low levels from recent closes. It plots open, close, high/low period values, and both EMAs on the price chart. Long signals fi

Strategy v5 TrendMoving averages Repaints
Updated 1 year ago · None stated GitHub repository of Gucci 1.0

MTF Second-Flip Continuation

by rosijay17-cmd
1 stars

A strategy that trades continuation after a second directional flip, intended for a 15-minute chart. Bias must agree between confirmed one-hour and four-hour structure. Lower-timeframe states are rebuilt relative to the bar open, the setup is frozen once the s

Strategy v6 TrendSessions & time
Updated 7 days ago · GPL-3.0 GitHub repository of MTF Second-Flip Continuation

Snag - No Repaint ES 1m Strategy Candle Bar is an overlay strategy designed for short-term futures trading. It calculates custom price aggregations, pivot levels, and averages across multiple higher timeframes including 3-minute, 5-minute, 8-minute, and 10-min

Strategy v5 BreakoutMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Snag - No Repaint ES 1m Strategy Candle Bar
4 stars

This strategy draws on the price chart and identifies mean-reversion opportunities around daily volume-weighted average price (VWAP) bands. It enters long positions when the price crosses above the lower band while the Relative Strength Index indicates oversol

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · MIT GitHub repository of NQ VWAP Reversion [trugurpala]

NQ Phantom Scalper Pro

by rosijay17-cmd
1 stars

A strategy that trades around an anchored VWAP with standard-deviation bands. The VWAP can reset each session, week, month, quarter or year, with two adjustable band multipliers. A volume spike filter, a time-of-day filter with an optional lunch-hour exclusion

Strategy v6 Mean reversionVolume
Updated 7 days ago · GPL-3.0 GitHub repository of NQ Phantom Scalper Pro

Snag - SPY

by dearvn
257 stars

Snag - SPY is an overlay indicator that tracks market trends using three Weighted Moving Averages (WMA 13, WMA 48, and WMA 200). It plots the three WMAs directly on the main price chart and calculates crossovers between price and the moving averages, as well a

Indicator v5 TrendMoving averages
Updated 6 weeks ago · None stated GitHub repository of Snag - SPY
46 stars

Initial Balance Statistical Mapping plots the high, low, and midpoint of a defined initial balance session, such as the first hour of trading, directly on the main price chart. It projects statistical extension levels using fixed percentile multipliers (25th,

Indicator v5 Support & resistanceSessions & time
Updated 7 weeks ago · None stated GitHub repository of Initial Balance Statistical Mapping
16 stars

This trend-following strategy generates long and short breakout signals using volatility channels plotted around a simple moving average. It calculates ATR bands for entries and trailing exits, calculating position sizing based on account equity and ATR risk p

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 3: ATR Channel

ORB Break and Retest v3

by rosijay17-cmd
1 stars

An opening range breakout strategy with two entry modes. Breakout mode enters when price clears the opening range by a tick or ATR-based buffer, and retest mode waits for a pullback to the range boundary using a limit or alternative entry type. The range, entr

Strategy v6 BreakoutSessions & time Repaints
Updated 7 days ago · GPL-3.0 GitHub repository of ORB Break and Retest v3
16 stars

This strategy trades Donchian channel breakouts on the price chart and can take both long and short positions. It sizes the first unit from a risk percentage of price and ATR, then adds smaller units when price advances by an ATR step and RSI is above or below

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 40: ULTIMATE
4 stars

This strategy enters long when RSI is above a minimum threshold and price is above a trend EMA, and short when RSI is below a maximum threshold and price is below that EMA. It opens a trade only while flat. Exits place an ATR multiple as the stop and a larger

Strategy v6 Oscillators & momentumMoving averages
Updated 2 months ago · MIT GitHub repository of RSI + ATR Strategy [trugurpala]
16 stars

Implements an adaptive trend-following and range-trading strategy that switches behavior based on ADX regime detection. When ADX exceeds the threshold, it executes Donchian breakouts with fractional pyramiding and Chandelier trailing stops. In low ADX environm

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 41: Sector-Adaptive

Apex Protocol Assistant

by alboogycOdR
6 stars

Apex Protocol Assistant is a Smart Money Concepts indicator designed for session-based trading. It determines market direction using a higher timeframe Exponential Moving Average and highlights Asian range boundaries alongside London and New York killzones. Th

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of Apex Protocol Assistant
257 stars

This indicator analyzes short-term price action on index futures and options charts by applying Rational Quadratic kernel smoothing to detect sideways consolidation ranges and potential breakouts. It processes pivot highs and lows over customizable loopback pe

Indicator v5 Support & resistanceTrend Repaints
Updated 6 weeks ago · None stated GitHub repository of SPX 30M - Trading Chart

This strategy enters long or short on a Donchian channel break and sizes each unit by risking a percentage of equity against an ATR stop. It adds units as price advances by a fraction of ATR, up to a set maximum. A three-tier time exit uses RSI: fading momentu

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 42: Momentum-Gated Time

Quick Flip Scalper

by TradersPost
228 stars

This strategy executes an opening-range liquidity fade based on the first candle of a session. It qualifies the opening range against the daily ATR to confirm manipulation or liquidity spikes. If qualified, it searches for reversal candlestick patterns, such a

Strategy v6 Sessions & timeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Quick Flip Scalper

Archens Shares

by hasnocool
106 stars

Archens Shares is an intraday breakout strategy designed for session-based trading. It tracks the highest high and lowest low from a 30-minute timeframe during a specified session window, defaulting to 09:45 to 10:15. A long position is entered when the closin

Strategy v5 BreakoutSessions & time
Updated 2 years ago · GPL-3.0 GitHub repository of Archens Shares

This strategy implements a Donchian breakout trend-following system with volatility-adaptive profit targets. It enters long or short on 55-period Donchian channel breakouts, sizes positions by ATR risk, and pyramids up to four units as price advances. Stop los

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 43: Volatility Adaptive

NASDAQ 100 Peak Hours Strategy

by wynnforthework
2 stars

This Pine Script strategy trades the NASDAQ 100 index during peak hours using EMA crossovers, RSI, and VWAP filters. Long entries occur when close exceeds the 9-period EMA which is above the 21-period EMA, with RSI above 50, price above VWAP, EMAs aligned, and

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of NASDAQ 100 Peak Hours Strategy

This strategy plots volume-weighted moving average volatility bands and standard deviation levels calculated from multi-timeframe price data directly on the price chart. It defines percentage-based stop-loss and take-profit exit targets for both long and short

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 6 weeks ago · None stated GitHub repository of V1.4 ESU2023 - Futures 1M No Repaint
46 stars

This overlay indicator marks swing highs and lows with Bill Williams fractals and draws them as offset labels and extended lines on the price chart. Fractal length can be 3, 5, 7, or 9 bars, and an optional filter reduces weaker fractal points. It also plots c

Indicator v5 Support & resistanceSessions & time
Updated 7 weeks ago · None stated GitHub repository of MTF Swing Highs and Lows with Key Levels
6 stars

Apex Protocol Assistant is an intraday technical indicator that overlays smart money concepts and trading session levels directly on the price chart. It evaluates higher timeframe EMA trends, change of character shifts, and fair value gaps. The tool highlights

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of Apex Protocol Assistant (Optimized)
4 stars

Visualizes custom trading sessions directly on the main price chart. Highlights active session bars with a light background color, plots intra-session high and low levels, and optionally places labels at session opening and closing bars. Built default for VİOP

Indicator v6 Sessions & timeSupport & resistance
Updated 2 months ago · MIT GitHub repository of Session Highlight [trugurpala]
257 stars

Williams Strategy - Alert is a Pine Script v5 strategy that plots three-bar simple moving averages of high and low prices directly on the price chart. It detects upward and downward trend reversals by comparing the current bar's low and high with those from th

Strategy v5 TrendMoving averages
Updated 6 weeks ago · None stated GitHub repository of Williams Strategy - Alert
46 stars

NQ Hourly Retracement Levels highlights NY, London, and Asia trading sessions directly on the price chart. It plots hourly open prices and midpoint retracement levels at the New York session open, filtering levels based on a configurable minimum hit rate thres

Indicator v5 Sessions & timeSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of NQ Hourly Retracement Levels

Setup Backtest

by GreyssonEnterprises
1 stars

A Pine v4 indicator that shades a trading session window on the chart, with an earlier analysis start and a later session start and end, all set in a chosen time zone that defaults to Chicago. Individual weekdays can be switched on or off and the label and col

Indicator v4 Sessions & time
Updated 2 months ago · MIT GitHub repository of Setup Backtest

NQ Statistical Mapper

by TamaraKGreen
46 stars

NQ Statistical Mapper plots key trading sessions including New York, London, and Asia directly on the price chart. It visualizes session high and low ranges, displays configurable session and intraday levels, and presents session performance metrics in an on-s

Indicator v5 Sessions & timeSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of NQ Statistical Mapper

NQ Stats - ALN Profiler

by TamaraKGreen
46 stars

Plots trading session ranges for New York, London, and Asia directly on the price chart. The indicator draws customizable boxes highlighting the high and low of each session, with options for dotted borders, background transparency, and identifying labels. It

Indicator v5 Sessions & timeSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of NQ Stats - ALN Profiler
7 stars

The indicator calculates total volume for the IMOEX Russian index by summing volumes of 30+ constituent stocks fetched via request.security. Dollar volume is normalized by multiplying close prices with volumes. The script detects index mode and plots the resul

Indicator v6 Volume
Updated 3 months ago · None stated GitHub repository of Dollar Normalized Volume & IMOEX

SMC NQ Pro v3 - Auto SL/TP

by rosijay17-cmd
1 stars

An overlay indicator for smart money concepts on Nasdaq futures. It marks order blocks, fair value gaps, break of structure and change of character, liquidity sweeps and premium and discount zones, with lookbacks for each. London, New York and Asian sessions c

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 7 days ago · GPL-3.0 GitHub repository of SMC NQ Pro v3 - Auto SL/TP
257 stars

This indicator builds a footprint of estimated buy and sell volume across price rows and plots it in a separate pane. It fills rows from bar low to high, stores volume per row, and draws buy and sell volume boxes, volume-profile boxes, row labels, and cumulati

Indicator v5 Volume Repaints
Updated 6 weeks ago · None stated GitHub repository of Footprint Delta Lite
46 stars

This indicator tracks regular trading hours for Nasdaq futures on the price chart. It stores the current session open, high, and low and keeps yesterday's RTH high and low. It can draw those levels as lines with labels shifted a chosen number of bars to the ri

Indicator v5 Sessions & timeSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of NQ Stats - RTH Breaks w/stats
1 stars

An ICT-style strategy on the price chart that requires two confirmations before entering: an inverse fair value gap flip and a change in state of delivery, which is a structure break from recent swing levels. Optional filters are an EMA trend check, a liquidit

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN IFVG CISD Double Confirm

NQ Stats Helper

by TamaraKGreen
46 stars

NQ Stats Helper is an overlay indicator that plots custom trading session ranges, session high and low boundaries, and 50% equilibrium levels directly on the price chart. It visualizes major sessions like New York, London, and Asia with colored range boxes and

Indicator v5 Sessions & timeSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of NQ Stats Helper

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