Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 35)

Open-source Pine Script strategies: scripts that place simulated trades, so TradingView's Strategy Tester can report how the rules did on past data.

Pine scripts3,040
Code shown here1,833open licence
Updated in a year1,781
No repaint flag2,645

Strategies: All

24 stars

This strategy plots a Supertrend and a double exponential moving average on the price chart. Supertrend direction flips mark buy and sell signals, with optional labels and trend highlighting. The DEMA uses a selectable timeframe and source and is requested wit

Strategy v5 TrendMoving averages Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Super Duper Trend Strategy
16 stars

This strategy enters long or short Donchian breakouts and sizes each unit from a percentage of equity and ATR. It sets an initial ATR stop, trails with a chandelier stop, and tightens that trail after a chosen number of bars. Optional profit targets close one

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 25: Time Profit Lock

Divergenced I002

by ruckard
13 stars

Divergenced I002 is a trading strategy that identifies entry points using Squeeze Momentum Indicator divergences across price and momentum structure. Long positions trigger on bullish momentum divergences, while short positions trigger on bearish divergences.

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced I002

Williams %R Reversal - Eterna MCP

by EternaHybridExchange
9 stars

This strategy tracks the Williams %R oscillator to trade mean-reversion bounces from overbought and oversold extremes. It opens long or short positions when a reversal signal occurs alongside confirming price direction, while generating JSON-formatted alert pa

Strategy v5 Oscillators & momentumMean reversion
Updated 7 months ago · MIT GitHub repository of Williams %R Reversal - Eterna MCP

This short-only strategy enters when price is below a daily 50-period EMA, crosses under a four-hour 50-period EMA, and closes below the previous bar low. Position size is 20 percent of equity. Exits use a limit and stop based on percentage distances by defaul

Strategy v4 TrendMoving averages Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Daily Trend + 4 Hour Reversal + 15 Min Pressure Short

Noob's MTF multi-EMA

by InNoobWeTrust
4 stars

This strategy draws up to three exponential moving averages, default lengths 34, 89 and 610, across as many as seven user-chosen timeframes in a separate pane. Each series uses a gradient by timeframe, and optional smoothing or variable line width changes how

Strategy v5 Moving averagesScreeners & dashboards Repaints
Updated 2 days ago · None stated GitHub repository of Noob's MTF multi-EMA
4 stars

This strategy trades Ethereum with a fast and slow exponential moving average crossover filtered by a 200-period EMA. It enters long when the fast EMA crosses above the slow EMA and price is above the 200 EMA. Shorts stay off by default and open only when that

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Ethereum ETH Strategy [trugurpala]
4 stars

Tracks the high and low of a user-defined intraday session and enters breakout trades when the bar closes outside this range. It can enter during the session or wait until the session ends. Long trades enter on a close above the session high, while short trade

Strategy v5 BreakoutSessions & time
Updated 11 months ago · Custom licence GitHub repository of Session Breakout Strategy [Lab]

This strategy identifies buy and sell entry points for XAUUSD using a combination of exponential moving averages, RSI, Stochastic oscillators, ATR, and Fibonacci zones. It supports multi-mode execution featuring confirmation and scalp entries triggered by over

Strategy v5 TrendOscillators & momentum

Alpy Kazan

by avatar-lavventura
2 stars

Alpy Kazan is a multi-timeframe momentum strategy combining a WaveTrend oscillator with dual-length RSI divergence calculations. It evaluates custom timeframes to plot overbought and oversold bands, WaveTrend crossovers, and RSI differentials in a separate pan

Strategy v4 Oscillators & momentum Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Kazan

This strategy plots support and resistance from the highest high and lowest low over a lookback window, and can overlay Bollinger Bands on the price chart. It calculates RSI or MFI, optionally from Heikin Ashi prices, and exposes WaveTrend, Laguerre smoothing

Strategy v5 Support & resistanceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Support and Resistance with RSI and Trend Filter

PineScriptMastery

by Web3Degenerate
2 stars

This educational strategy demonstrates how to implement trailing stop losses in Pine Script. It executes a single mock trade in the chosen direction starting at a user-defined timestamp. The trailing stop is calculated using either Average True Range or percen

Strategy v5 Volatility & bandsSupport & resistance
Updated 2 years ago · None stated GitHub repository of PineScriptMastery

My First Strategy

by jayadevrana
1 stars

This strategy plots an exponential moving average on the price chart and opens a long position when the close crosses above that average, but only when no position is already open. It exits with a percentage stop loss and a percentage take profit measured from

Strategy v6 TrendMoving averages
Updated 4 days ago · MPL-2.0 GitHub repository of My First Strategy

Drawing Visual Noise Geometry

by pineforge-4pass
1 stars

This strategy plots a 14-period simple moving average as a chart line and fills the space between two overlapping lines. It creates a small label on each bar, then overwrites the label text. It enters one long contract when close crosses above the line level a

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of Drawing Visual Noise Geometry

Volume Breakout Strategy

by kanylbullen
1 stars

This strategy identifies breakouts using Keltner Channels combined with volume spike filters, ADX trend strength, RSI thresholds, and an optional EMA trend direction filter. It triggers long entries when price crosses above the upper channel and short entries

Strategy v5 BreakoutTrend Repaints
Updated 8 days ago · None stated GitHub repository of Volume Breakout Strategy
1 stars

A strategy that builds a volume profile with delta over a lookback window and trades touches of its point of control and value area high and low levels, long or short. The window, bin count, value area percentage and touch tolerance in ticks are adjustable. Po

Strategy v6 VolumeSupport & resistance
Updated 8 days ago · GPL-3.0 GitHub repository of DeltaFlow Volume Profile Strategy
1 stars

A long-only strategy for one-minute spot charts that uses two Bollinger Bands, a standard 20-period band on close and a short 4-period wide band on open, to classify entries into three cases. Entries can be limited to the first two hours of the Asian, European

Strategy v5 Volatility & bandsScalping
Updated 13 days ago · None stated GitHub repository of Double Bollinger Band 1M Scalper
1 stars

This strategy computes the midpoint of the highest high and lowest low over a configurable lookback and enters long when price crosses above that line and short when it crosses below. An exponential moving average of each bar's high-low range is calculated but

Strategy v5 BreakoutSupport & resistance
Updated 4 months ago · MIT GitHub repository of Corpus Custom Function Breakout

Solo Stochastic v1

by gabriel-klettur
1 stars

This strategy plots 10, 55 and 200 period exponential moving averages on the price chart and calculates a smoothed stochastic oscillator from user K, D and smoothing periods. It opens a long when the K line crosses above D while K is below a fixed oversold lev

Strategy v5 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Solo Stochastic v1

Heikin Ashi Trend

by Basant1Saini
1 stars

Heikin Ashi Trend is a trend-following strategy that calculates Heikin Ashi candle values and moving averages directly on the main price chart. It generates long and short entry signals when a user-defined number of consecutive Heikin Ashi bars align with fast

Strategy v5 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of Heikin Ashi Trend
1 stars

This strategy detects bounces from support and resistance levels using swing pivot highs and lows. It waits for the price to touch an identified pivot level within a user-defined percentage tolerance and confirms an entry when a rejection candlestick forms, ch

Strategy v5 Support & resistanceCandlestick patterns
Updated 8 months ago · None stated GitHub repository of Springboard Algo (S/R Bounce)

ES Professional Fade

by knectardev
1 stars

ES Professional Fade is an overlay strategy aimed at the ES futures contract. This archived file is only a placeholder and contains no entry, exit, or order logic. Its changelog says the version adds opening-range calculation with freeze logic, session-boundar

Strategy v5 Sessions & timeSupport & resistance
Updated 9 months ago · None stated GitHub repository of ES Professional Fade

Multi-Signal Risk Manager

by turnupdigital
1 stars

A strategy on the price chart that reads an external long and a short signal and manages trades with selectable exits. Position size is a set number of contracts. Exit options include a moving average exit, a fixed stop with up to three targets measured in ATR

Strategy v5
Updated 1 year ago · None stated GitHub repository of Multi-Signal Risk Manager

His/Lows

by tseitz
1 stars

A Pine v4 strategy that combines rolling highest and lowest values over fast, medium and slow lookbacks with a 12/26 MACD and a 14-period RSI. Inputs set the three lookbacks, an RSI level for closing longs in a short zone, whether shorts are allowed, and two M

Strategy v4 Oscillators & momentumBreakout Repaints
Updated 4 years ago · None stated GitHub repository of His/Lows

This mean-reversion strategy plots Bollinger Bands and a long-term moving average directly on the price chart. It enters trades when price candles penetrate the outer Bollinger Bands beyond a user-defined body percentage, anticipating a price reversal. Entries

Strategy v5 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner PRO [Alorse]

This strategy combines Arnaud Legoux Moving Average percentage price change calculations with an adaptive Gaussian Moving Average to generate trend-following signals. Long and short entries are triggered when the ALMA change calculation crosses above or below

Strategy v5 Moving averagesOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of ESM2024 - ALMA Smoothed Gaussian Moving Average

Exit Orders

by TradersPost
228 stars

This strategy provides reusable building blocks for entries, exits, and risk management in Pine Script. It calculates profit and loss units, applies session filtering based on timezone, and handles backtest date ranges. It includes risk settings like stop loss

Strategy v6 Sessions & time Repaints
Updated 3 months ago · None stated GitHub repository of Exit Orders

80-20

by hasnocool
106 stars

Identifies the 80-20 candlestick setup, triggering when a bar opens in the lower 20% of its total range and closes in the upper 20%, or opens in the upper 20% and closes in the lower 20%. Blue and red arrows plot above qualifying bars directly on the price cha

Strategy v5 Candlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of 80-20

Bollinger Bands Strategy

by TWODS-CAPITAL
37 stars

This strategy executes trades based on price interactions with standard Bollinger Bands plotted on the price chart. It calculates a simple moving average basis line along with upper and lower standard deviation bands. Long entries are triggered when price cros

Strategy v5 Volatility & bandsMean reversion
Updated 3 years ago · MIT GitHub repository of Bollinger Bands Strategy

Template

by benso87
24 stars

This script provides a foundational starter template for building custom Pine Script v5 trading strategies. It overlays on the main price chart and establishes the scaffolding for long and short positions, including bracketed exit orders. Configurable date inp

Strategy v5
Updated 4 years ago · MPL-2.0 GitHub repository of Template
16 stars

This overlay strategy trades Donchian breakouts in either direction. The first unit is sized from a risk percent of equity and an ATR-based initial stop; later units are added at fixed ATR steps and are progressively smaller, up to four units. Optional profit

Strategy v6 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Seykota Alt 26: Fractional Pyramid

Divergenced J001

by ruckard
13 stars

Divergenced J001 is a price-chart strategy that finds squeeze-momentum divergences and can send Zignaly alert messages. It shorts when a light-green to dark-green squeeze section shows a smaller value while price is higher, and longs on the opposite red-sectio

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Divergenced J001
6 stars

This trading strategy detects key support and resistance zones on the price chart by identifying candle rejection wicks over a customizable lookback period. It filters potential trades using an Exponential Moving Average (EMA), Change in Status/Direction (CISD

Strategy v5 Support & resistanceTrend
Updated 7 months ago · None stated GitHub repository of Wick Rejection S/R Strategy

Charles' RSI Strategy

by jerryinyang
5 stars

This overlay strategy combines RSI, which can be read from another timeframe, with fast and slow exponential moving averages. It sequences overbought and oversold crosses with returns into a base zone, optionally counting those events only when the moving-aver

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of Charles' RSI Strategy

This long-only strategy overlays 50-period exponential moving averages taken from the daily and four-hour timeframes. It opens a long trade when price is above the daily average, crosses above the four-hour average, and closes above the previous bar high. Exit

Strategy v4 TrendMoving averages Repaints
Updated 3 years ago · Apache-2.0 GitHub repository of Daily Trend + 4H Reversal + 15 Min Pressure Long Strategy
4 stars

This strategy trades on the price chart using a fast and slow exponential moving average crossover. It enters long when the fast EMA crosses above the slow EMA and short when it crosses below, but only during the London or New York session in GMT. Each entry s

Strategy v6 TrendMoving averages Repaints
Updated 2 months ago · MIT GitHub repository of EUR/USD Forex Strategy [trugurpala]
3 stars

This strategy combines the Stochastic Oscillator with Chaikin Money Flow (CMF) to generate trading signals on the price chart. It enters long positions when the Stochastic %K line crosses above the %D line while CMF is above 0.1, and enters short positions on

Strategy v5 Oscillators & momentumVolume
Updated 2 years ago · GPL-3.0 GitHub repository of Stochastic and CMF Strategy

Alpy Kazan

by avatar-lavventura
2 stars

Alpy Kazan combines a WaveTrend oscillator with a Bollinger Bands and Keltner Channels squeeze detector. It plots the WaveTrend lines, overbought and oversold boundary levels, and visual crossover markers in a separate pane, while highlighting crossover bars o

Strategy v4 Oscillators & momentumVolatility & bands
Updated 7 months ago · None stated GitHub repository of Alpy Kazan

The strategy combines support and resistance levels with RSI or MFI momentum oscillators, optional WaveTrend indicators, and Bollinger Bands filters. Strategy logic evaluates trade signals on either Heikin Ashi or standard candle data to execute DCA entries wi

Strategy v5 TrendSupport & resistance
Updated 1 year ago · None stated GitHub repository of Support and Resistance with RSI and Trend Filter
2 stars

TrendSignal + Supertrend Strategy detects trend changes using a custom indicator based on recent high-low ranges and a percentage K value calculated from RISK input. It sets buy or sell signals when the trend shifts. Supertrend is overlaid using ATR period and

Strategy v4 TrendVolatility & bands
Updated 4 years ago · MIT GitHub repository of TrendSignal + Supertrend Strategy
1 stars

A strategy that scores signals from ten sources: RSI, MACD, Bollinger Bands, head and shoulders, wedges, multiple tops and bottoms, candlestick reversals, pivot support and resistance, volume spikes and an EMA ribbon filter. A trade needs a minimum pattern sco

Strategy v5 Oscillators & momentumCandlestick patterns
Updated 2 days ago · None stated GitHub repository of Fall Strategy 10-Pattern Engine

Dual MA with Switch

by pineforge-4pass
1 stars

A moving average crossover strategy where the average type is chosen in the settings: EMA, SMA, WMA or HMA. A fast and a slow average are calculated on a selectable price source. It enters long when the fast line crosses above the slow line and short on the op

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Dual MA with Switch

A strategy that estimates bull, bear and neutral state probabilities from recent price transitions and trades only when they pass minimum levels. It adds previous day high and low breakout entries and filters, swing liquidity levels, and an optional 50 to 61.8

Strategy v6 Support & resistanceBreakout Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Dynamic Markov Capacity PDH/PDL Liquidity Retracements

Corpus EMA Cross

by Snappni
1 stars

Corpus EMA Cross is a strategy that plots two exponential moving averages on the price chart. The fast EMA uses a length of 12 and the slow EMA uses 26. It generates long entries on the crossover of the fast line above the slow line and short entries on the cr

Strategy v5 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Corpus EMA Cross

Stochastic+SQZMOM_LB_v1

by gabriel-klettur
1 stars

This strategy plots exponential moving averages of 10, 55 and 200 on the price chart and shades the background when a smoothed stochastic is oversold or overbought. It opens long positions when the stochastic K line crosses above D below the oversold level, in

Strategy v5 Oscillators & momentumMoving averages
Updated 7 months ago · None stated GitHub repository of Stochastic+SQZMOM_LB_v1

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