Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 50)

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

This strategy combines Bollinger %B settings with belthold and inner-candle color toggles and sizes orders as a percentage of equity. The user sets band length, source, and deviation, plus buy, sell, overbought, and oversold levels. Exits use either a modified

Strategy v5 Volatility & bandsCandlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands %B - Belthold & Inner Candles
13 stars

This strategy detects long and short signals from the Noro TrendRibbon ribbon side change. It draws a corridor from recent high and low prices on the chart. When price falls below the corridor on long signals it opens long positions sized to a percentage of co

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon J009
3 stars

Hercules Strategy 1.7 is a price-chart strategy that gates trades with an engulfing-candle option, a lightning tick threshold, and a choice of long, short, or both directions. It can invert signals and stop the next trade from repeating the same side. Sydney,

Strategy v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Strategy 1.7
1 stars

The strategy monitors the lower timeframe close crossing above the previous daily high obtained via request.security on the daily chart. It enters a long position of one unit upon detection of this cross-up condition and closes the position when the close fall

Strategy v6 BreakoutMean reversion
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF probe 04 — D high[1] break

S_calc_on_order_fills

by GammaExpansion
1 stars

This strategy tests order fill recalculation behavior across an eight-bar cycle. It enters long positions using a market order at phase zero and a limit order below the close at phase four. When an open position is detected upon order fill, it immediately subm

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_calc_on_order_fills
1 stars

The Tn Sovereign BB Breakout v6 strategy identifies volatility squeezes on the price chart by checking when Bollinger Bands lie inside Keltner Channels. It enters long positions on crossover above the upper BB band when a volume audit passes, and shorts on cro

Strategy v6 Volatility & bandsBreakout
Updated 2 months ago · None stated GitHub repository of Tn Sovereign BB Breakout v6
106 stars

This strategy plots a 20-period Bollinger Band and a 9-period EMA on the price chart. It opens a long when the prior close is below the lower band and the current candle is bullish, and a short when the prior close is above the upper band and the current candl

Strategy v5 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands + EMA 9
13 stars

This strategy uses Noro TrendRibbon direction to set a long or short bias, then opens a trade when price leaves a high-low corridor built from recent candles. A long opens below the corridor in a long bias, and a short opens above it in a short bias, sized fro

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon Ladder
3 stars

Hercules Strategy Rewrite is an automated backtesting strategy that generates entry signals using engulfing candlestick patterns, tick thresholds, and support or resistance level breakouts. It offers multi-layer filtering including moving average trend checks,

Strategy v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Strategy Rewrite

PF MTF probe 05 — 60m RSI(14)

by pineforge-4pass
1 stars

The script is a Pine Script strategy that fetches the RSI(14) value from the 60-minute timeframe via request.security and signals long entries on crossovers above 50 while closing longs on crossunders below 50. It maintains a single fixed position of 1 unit wi

Strategy v6 Oscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF probe 05 — 60m RSI(14)

S_close_variants

by GammaExpansion
1 stars

S_close_variants is a Pine Script v6 strategy that tests different close calls in the strategy library. It enters long positions at specific phases of a 30-bar cycle and uses close, close with comment, close with fixed qty, close with qty percent, close all, a

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_close_variants

Tn Sovereign CCI v6

by raybird
1 stars

This strategy draws on the price chart and trades a fast and slow Commodity Channel Index against an exponential moving average regime. It enters long when the fast CCI crosses above the lower extreme, the slow CCI is already above that level, and price is abo

Strategy v6 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of Tn Sovereign CCI v6
106 stars

This strategy trades breakouts beyond Bollinger Bands on the main price chart. It features optional trend filters using various moving average types, a volatility filter based on standard deviation relative to its moving average, and a daily rate-of-change fil

Strategy v5 BreakoutVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands - Breakout Strategy

This strategy connects TradingView signals to Zignaly crypto trading platform with risk management. It plots a Noro TrendRibbon on the price chart to generate trend signals for entries. Long and short positions open based on ribbon conditions using specified M

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon Laddered C001

PF MTF Probe 06 60m Volume Sum

by pineforge-4pass
1 stars

A test strategy from a reference corpus that requests 60-minute volume and its 20-bar average from a lower-timeframe chart, with lookahead off. It enters one long unit when hourly volume is more than twice its average and closes the position when that conditio

Strategy v6 Volume
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF Probe 06 60m Volume Sum

S_exit_partial

by GammaExpansion
1 stars

This strategy is a deterministic test fixture that repeats a 48-bar cycle based on bar index. It opens fixed-size long entries at set phases and attaches limit and stop exits that reserve quantity, split size by percent, apply to later entries when no entry id

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_exit_partial
1 stars

This strategy adapts the Chandelier Exit indicator to build a trend-following system with added audit filters. It calculates trailing stop levels using ATR and highest highs or lowest lows to determine directional shifts. Entries are filtered through a long-te

Strategy v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Tn Sovereign Chandelier
106 stars

This strategy executes short trades based on Bollinger Bands and the Relative Strength Index (RSI). It plots the Bollinger Bands on the price chart and enters a short position when the closing price crosses above the upper band while RSI remains below 70. An e

Strategy v5 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands and RSI Short Selling

Momentum Strategy

by TWODS-CAPITAL
37 stars

This strategy measures price momentum as the difference between the close and the close a set number of bars earlier, then measures the one-bar change of that momentum. It places a long stop order just above the bar high when both values are positive, and a sh

Strategy v5 Oscillators & momentum
Updated 3 years ago · MIT GitHub repository of Momentum Strategy
13 stars

Ruckard Noro TrendRibbon N003 is a trend-following strategy designed to generate long and short trade signals based on side changes in the Noro Trendribbon indicator. It calculates upper and lower moving average corridors alongside ADX smoothing to identify ch

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon N003
9 stars

Smooth Trend Radar Strategy calculates a double-smoothed Supertrend baseline using WMA and EMA to identify trend direction and sideway regimes. It plots baseline rejection signals on flips, trend slope filters, and statistical overextension highlights with can

Strategy v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Smooth Trend Radar Strategy
7 stars

This Pine Script strategy implements the Supertrend Elite Trend System for crypto markets. It combines signals from ten indicators including Supertrend, ALMA smoothing, CTI correlation, STC trend catcher, Gunxo sniper, DEMA with DMI, MM percentile, and DMI loo

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of Supertrend Elite Trend System
1 stars

This strategy analyzes closing prices from three simultaneous multi-timeframe security feeds: 60-minute, 240-minute, and daily. It identifies confluence when all three closes are rising (allUp) or falling (allDown) from the prior bar. When allUp and no long po

Strategy v6 TrendSMC / ICT / price action
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF probe 07 - triple TF close

S_margin

by GammaExpansion
1 stars

S_margin is a strategy designed to test margin rules, leverage calculations, and liquidation price tracking in Pine Script v6. Operating on a repeating 40-bar cycle, it enters a long position sizing at 300% equity on phase 0, exits on phase 18, enters a short

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_margin
1 stars

This strategy identifies pivot-based Darvas Box levels on the price chart and trades re-entries following box sweeps. A long position arms when the price dips below the lower boundary and triggers when it closes back inside, provided the price is above a highe

Strategy v6 Support & resistanceBreakout
Updated 2 months ago · None stated GitHub repository of TN Sovereign Darvas Box v6
106 stars

This strategy plots modified Bollinger Bands and an exponential moving average on the price chart. It watches for closes crossing the upper or lower band, optionally filtered by the EMA trend and extra crossover or crossunder checks. Long stops use the recent

Strategy v5 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Modified (Stormer)
13 stars

This strategy plots a Noro trend ribbon on the price chart and uses ribbon side changes to choose long or short direction. It opens a long when price is below a high-low corridor during a long bias, and a short when price is above that corridor during a short

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Noro TrendRibbon Q012

Swing Trade Strategy

by eddiebelaval
7 stars

Swing Trade Strategy evaluates market conditions by aggregating directional signals across ten trend and momentum indicators, including an Arnaud Legoux Moving Average, Relative Momentum Index, Double Exponential Moving Average, Directional Movement Index, and

Strategy v6 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Swing Trade Strategy
1 stars

A test strategy from a reference corpus that calls a user-defined MACD histogram function on 60-minute, 4-hour and daily data with lookahead off. It goes long when all three histograms are positive and short when all three are negative, closing the opposite po

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF Probe 08 Triple TF MACD Histogram

S_pending_entries

by GammaExpansion
1 stars

S_pending_entries is a strategy that places different types of pending buy and sell orders including limit, stop, and stop-limit orders at specific phases in a 68-bar cycle. It calculates reference price levels around the current close and plots them along wit

Strategy v6 Support & resistanceSessions & time
Updated 7 days ago · MIT GitHub repository of S_pending_entries
1 stars

This strategy plots Donchian upper and lower channels along with the midpoint on the price chart. It generates long signals on a price crossover above the upper Donchian band when volume exceeds a moving average multiple if the filter is enabled, and short sig

Strategy v6 TrendBreakout
Updated 2 months ago · None stated GitHub repository of TN Sovereign Donchian Breakout

This strategy calculates standard Bollinger Bands using a Simple Moving Average and standard deviation multiplier. It enters alternating long positions when price crosses above the lower band and short positions when price crosses below the upper band. Open tr

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy With StopLoss
13 stars

This strategy plots an On-Balance Volume oscillator in a separate pane and applies a fast and a slow exponential moving average to it. It enters long or short when those averages cross, with a strategy type that can reverse, stay long only, or stay short only,

Strategy v5 VolumeMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard QN OBVOsc A002
1 stars

A test strategy from a reference corpus that studies start-up behaviour of a daily 26-period EMA requested from a lower-timeframe chart without lookahead. It goes long while the daily EMA is rising and short while it is falling, closing the opposite position f

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF MTF Probe 09 Daily EMA Warmup

S_pyramiding_any

by GammaExpansion
1 stars

This strategy acts as a test fixture designed to evaluate Pine Script execution logic around pyramiding limits, position sizing, and order management under the ANY entry closure rule. It uses bar index cycles to execute scheduled entry orders, order reductions

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_pyramiding_any
1 stars

This strategy filters fakeout signals using a 4-layer causal scoring system to ensure high-conviction entries on the price chart. It computes a sovereign score based on volume exceeding a moving average multiplier, alignment with higher-timeframe EMA, minimum

Strategy v6 TrendVolatility & bands Repaints
Updated 2 months ago · None stated GitHub repository of TN Sovereign Fakeout Filter
114 stars

This strategy plots a scaled one-bar price change from a chosen timeframe in a separate pane. It enters long when the change crosses above a threshold divided by a divisor and short when it crosses below the negative threshold. Volume can replace price with an

Strategy v4 Oscillators & momentumVolume Repaints
Updated 1 year ago · None stated GitHub repository of Normalized Vector Strategy

This strategy calculates standard Bollinger Bands using a Simple Moving Average and standard deviation multiplier to identify entry conditions. It triggers pending stop orders and outputs formatted alert messages compatible with TradingConnector for automated

Strategy v5 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy with TradingConnector Alerts

Ruckard Random A004

by ruckard
13 stars

Ruckard Random A004 is a strategy that executes entries in a random manner to evaluate the effect of risk management rules on trading results. It controls positions using customizable stop loss, take profit, trailing stops, and break-even settings, alongside o

Strategy v5 Moving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Random A004
1 stars

This strategy computes a session-gated RSI value using a deep history reference of 500 bars on a source that is NA outside the session window. It signals long entries on RSI crossover above 30 with valid session and closes positions on crossover below 70. The

Strategy v6 Oscillators & momentumSessions & time
Updated 7 days ago · Apache-2.0 GitHub repository of PF na-chain probe 01 - deep history int na

S_pyramiding_fifo

by GammaExpansion
1 stars

This strategy fixture cycles every forty bars and places timed long and short entries, closes, and raw orders to exercise TradingView pyramiding and FIFO fill rules. It opens up to three long entries, ignores a fourth, closes by identifier, reduces size with a

Strategy v6
Updated 7 days ago · MIT GitHub repository of S_pyramiding_fifo
1 stars

This overlay strategy builds long and short signals from a fast EMA crossing a slow EMA. Optional filters require elevated volume versus a volume average, a set number of confirmation bars, alignment with a higher-timeframe EMA, and a minimum bar move versus A

Strategy v6 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of TN Sovereign Fakeout Filter v6
106 stars

This strategy initiates momentum breakout positions when the Relative Strength Index reaches extreme levels and Bollinger Band standard deviation is expanding. Long trades open when RSI is above the overbought threshold and bands are not contracting, while sho

Strategy v5 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands, RSI, and MA Strategy
13 stars

This strategy evaluates moving average squeezes and Squeeze Momentum section height changes to identify potential entry signals. It opens trades based on momentum comparisons across moving average thresholds. The script features customizable risk management co

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Squeezed A004

ICT ORB Strategy

by alboogycOdR
6 stars

This strategy backtests opening-range breakouts on the price chart for New York, London, Asia, or a custom session. Simple mode follows the opening-range direction when relative volume is high enough. ICT mode can require a fair value gap, displacement, and an

Strategy v5 BreakoutSMC / ICT / price action Repaints
Updated 7 months ago · None stated GitHub repository of ICT ORB Strategy
1 stars

This strategy detects RSI momentum crossovers to enter long positions with fixed size. When holding a position it places a bracket exit using ATR-based stop and limit levels. The OCA name ensures any filled side cancels the other. The script verifies that stra

Strategy v6 Oscillators & momentumVolatility & bands
Updated 7 days ago · Apache-2.0 GitHub repository of PF OCA probe 01 - exit bracket cancel

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