Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 47)

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

330 stars

Exceeded Candle [Alorse] is a mean-reversion strategy that identifies candlestick engulfing patterns combined with Bollinger Bands filters. It enters a long position when a green candle surpasses the body of the previous red candle while price is below the mid

Strategy v4 Mean reversionCandlestick patterns
Updated 2 months ago · None stated GitHub repository of Exceeded candle [Alorse]

Band-Zigzag TrendFollower Strategy is a trend-following trading system that combines volatility bands, such as Bollinger Bands or Keltner Channels, with pivot-based trend structure. It evaluates trend switches and invalidation levels using adaptive or sticky b

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Band-Zigzag - TrendFollower Strategy [Trendoscope]
13 stars

This strategy uses a 100-period RSI to generate long and short signals with 5% pre-entry buffers. Long entries trigger at RSI 45 and shorts at RSI 55. Exits occur at RSI 55 for longs and 47 for shorts, with emergency stops at RSI 10. Higher-timeframe EMA confi

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Fiery RSI A008

PF Eventrades Count

by pineforge-4pass
1 stars

A test strategy from a reference corpus that checks the count of trades with zero net result. At midnight it buys one unit, then places a limit exit at the entry price so that the trade closes flat once price returns to it. The trade counter is plotted but hid

Strategy v6 Sessions & time
Updated 7 days ago · Apache-2.0 GitHub repository of PF Eventrades Count

A Donchian-style trend strategy that enters on a breakout of a 55-bar channel and exits on a 20-bar channel break, with a 200-period EMA as the regime filter. Entries can require a fresh breakout and an ADX and DMI strength check. An ATR trailing stop is drawn

Strategy v6 TrendBreakout
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Strategy v6 Signal Cooldown
1 stars

A template for a Pine v4 SMA strategy where the name, SMA length and short-selling switch are unfilled placeholders, so it needs editing before it compiles. It plots the SMA in orange, goes long when a green candle opens above it, and goes short when a red can

Strategy v4 Moving averages
Updated 4 years ago · None stated GitHub repository of SMA Cross Strategy Template
106 stars

This strategy plots multiple indicators on the price chart for Bank Nifty index. It calculates MACD on different timeframes, RSI, ADX, Stochastic oscillator, and Bollinger Bands. The strategy generates buy signals when MACD shows upticks across timeframes, RSI

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bank Nifty Bullish Intraday
13 stars

This strategy executes trades based on a smoothed Stochastic oscillator inspired by FieryTrading's Stochastic Trend concept, specifically tailored for automated crypto execution via Zignaly alerts. It opens positions when Stochastic values cross configured tri

Strategy v5 Oscillators & momentumScalping
Updated 1 year ago · None stated GitHub repository of Ruckard Fiery Stoch A004

PF FX 5dp - SMA20/50 cross

by pineforge-4pass
1 stars

This strategy generates crossover signals using SMA20 and SMA50 on the EURUSD forex pair at 5 decimal places. It enters a long position when the fast SMA crosses above the slow SMA and immediately closes any existing short position. It enters a short position

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF FX 5dp - SMA20/50 cross
1 stars

A mean-reversion strategy that buys when price closes below a Bollinger Band while RSI stays above a floor level, and exits on upper-band breaks combined with RSI or MFI conditions. Three selectable versions exist: the first has no stop loss or take profit, wh

Strategy v4 Mean reversionVolatility & bands
Updated 1 year ago · None stated GitHub repository of Flawless Victory Strategy

SMA Strategy

by tseitz
1 stars

A Pine v4 strategy that plots a simple moving average of the close in orange on the price chart. It goes long when a green candle opens above the average and short when a red candle opens below it, closing the opposite side. Inputs set the SMA length, long and

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SMA Strategy
330 stars

MA Cross + DMI [Alorse] is a trend-following strategy that calculates two moving averages (EMA or SMA) alongside the Directional Movement Index (DMI). It plots the two moving averages directly on the price chart. Long positions are entered when the fast moving

Strategy v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of MA Cross + DMI [Alorse]

This strategy overlays Supertrend on the price chart and trades only inside a set session and backtest date range. It enters long when Supertrend turns up, or after a chosen candle delay while the trend is up, and enters short on the opposite conditions. It cl

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of BankNifty 5min Supertrend Based Strategy

Ruckard Irene A003

by ruckard
13 stars

Ruckard Irene A003 is an overlay strategy that combines fast moving averages with Directional Movement Index (ADX, DI+, DI-) filters to execute trades. It evaluates price momentum relative to high and low moving averages while checking ADX strength thresholds.

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Irene A003

This strategy calculates regular and hidden divergences across selectable momentum oscillators, including RSI, CCI, and MFI, and plots volatility-based divergence zones. It displays oscillator dynamics in a separate pane while projecting support and resistance

Strategy v6 DivergenceOscillators & momentum
Updated 3 days ago · MIT GitHub repository of Oscillator Divergence Zones [WavesUnchained] — Strategy

PF IES probe 01 - adx regime

by pineforge-4pass
1 stars

PF IES probe 01 is a Pine Script v6 strategy that calculates ADX with a custom DI chain using ta.rma smoothing and manual plus/minus DM flow. It applies an ATR-ratio volatility gate comparing current ATR to its 42-period SMA to classify regimes into four categ

Strategy v6 TrendVolatility & bands
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 01 - adx regime
1 stars

A strategy that buys pullbacks in uptrends and sells rallies in downtrends. Trend comes from fast and slow EMAs with a minimum slope, an optional higher-timeframe EMA check defaulting to daily, and an ADX filter. A setup arms when price stretches an ATR distan

Strategy v6 Mean reversionTrend Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Trend-Aligned Mean Reversion Strategy

TN Multi-Confluence

by raybird
1 stars

A Pine v6 strategy that trades smart money concepts on the price chart. It combines a higher-timeframe bias with an EMA, equal highs and lows liquidity, order blocks, fair value gaps and an optional displacement confirmation. Entries are limited to New York an

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN Multi-Confluence
1 stars

A Pine v4 strategy that plots a 21-period exponential moving average of the close in orange on the price chart. It goes long when a green candle opens above the average and short when a red candle opens below it, closing each position when the opposite signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of SNXBTC EMA Cross Strategy
106 stars

BankNifty Bearish Intraday is an intraday short strategy designed for the Bank Nifty index. It evaluates multiple momentum and trend indicators across multiple timeframes, including MACD downticks on 5-minute, 15-minute, and 60-minute resolutions, an RSI below

Strategy v5 Oscillators & momentumTrend Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of BankNifty Bearish Intraday
13 stars

Ruckard Kayseri A003 is a trend-following trading strategy based on moving average crossovers using a primary smoothed moving average and a fast moving average. It features built-in date filtering and integrated Zignaly webhook alert message formatting for aut

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Kayseri A003
7 stars

This strategy detects an inside bar when the current high and low sit inside the previous bar. A bullish inside bar enters long and a bearish inside bar enters short, both on the price chart. The long stop is the entry bar low and the short stop is the entry b

Strategy v6 Candlestick patterns
Updated 3 months ago · None stated GitHub repository of Inside Bar Strategy with SL/TP

This strategy calculates trend direction across three user-defined higher timeframes using dual Simple Moving Averages, filtered by On-Balance Volume and Commodity Channel Index conditions alongside fractal pivot swings. Entries trigger when multi-timeframe tr

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of Fractals with Pivot Trendlines Strategy
1 stars

This strategy builds a directional bias from three exponential moving averages drawn on the price chart. It scores bullish and bearish alignment of the fast, slow, and trend averages, plus whether price is above or below that structure, and treats a score at o

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 02 - three-ema bias
1 stars

This overlay strategy builds a weighted score from three factors. Trend is positive when a fast EMA is above a slow EMA and negative otherwise. Momentum is positive when 14-period RSI is above 50. The volatility factor is positive when close is above a 20-peri

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of TN Multi-Factor Sovereign V6

MACD + BB + RSI

by zhuzp98
1 stars

A Pine version 4 strategy on the price chart that buys when the MACD line crosses above its signal line while RSI is below 50 and price is under the Bollinger basis. It exits when RSI exceeds 70 and price is above the upper band. MACD moving average types, ban

Strategy v4 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of MACD + BB + RSI
330 stars

MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra

Strategy v4 Oscillators & momentumDivergence Repaints
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]

Bar Color

by hasnocool
106 stars

Bar Color is a simple candle-based reversal strategy displayed directly on the price chart. It checks the relationship between the bar close and open prices. On a bullish candle, it triggers a long entry and exits any active short position. On a bearish candle

Strategy v5 Candlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of Bar Color
13 stars

Ruckard Kayseri B003 is a trend-following strategy designed to generate trade entries based on the interaction between a fast moving average and a main smoothed moving average. It incorporates customizable position management features, including fixed percenta

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Kayseri B003
1 stars

This strategy scores bullish and bearish momentum from three conditions: RSI above or below adjustable levels, RSI compared with its value three bars earlier, and a MACD histogram that is positive or negative and moving further that way. It enters long when th

Strategy v6 Oscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 03 - rsi+macd momentum

P_syn_strategy_full

by GammaExpansion
1 stars

P_syn_strategy_full is a crossover strategy that plots the 20-period simple moving average of close on the price chart. It generates long signals on crossover and short signals on crossunder. Long entries use limit and stop orders with 10 percent equity positi

Strategy v6 TrendMoving averages
Updated 7 days ago · MIT GitHub repository of P_syn_strategy_full
1 stars

A strategy that watches correlation between assets in a separate pane. It builds a correlation matrix for four symbols, defaulting to BTC, ETH, SOL and BNB, and shows it as a colour-shaded table. The first two symbols form the main pair, and when their correla

Strategy v6 Screeners & dashboards
Updated 2 months ago · None stated GitHub repository of TN Multilateral Sovereign Corr

Neural Network

by zhuzp98
1 stars

A Pine version 4 strategy that scores long and short setups by adding weighted votes from many indicator conditions: EMA trend, SuperTrend, Parabolic SAR, Hull moving average, RSI, MACD, WaveTrend, stochastic, Bollinger Bands and ATR. It trades when the score

Strategy v4 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Neural Network
1 stars

A Pine v4 strategy based on a Guppy-style ribbon of 22 exponential moving averages: seven fast ones from 3 to 21 and fifteen slow ones from 24 to 66, with an optional 200 EMA. It trades when the ribbon groups line up in order, with an option for earlier signal

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Super Guppy Strategy
330 stars

This strategy plots a MACD line, signal line, and colored histogram in a separate pane. The fast and slow averages and the signal line can each use SMA or EMA. Optional markers show MACD and signal crosses. Pivot lookbacks scan the oscillator for regular and h

Strategy v4 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]
114 stars

This strategy estimates price behavior using ordinary least squares regression between higher-timeframe data and a generated dataset, smoothed by a Karobein oscillator. It enters long positions when the oscillator turns upward and short positions when it turns

Strategy v4 Oscillators & momentumAI / machine learning Repaints

This strategy evaluates trades using an SMA baseline, Hull Moving Average trend filter, and ATR volatility conditions. It triggers long entries when price exceeds the baseline by an ATR qualifier distance while trading above the HMA trend bias, with an optiona

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Baseline Cross Qualifier Volatility Strategy with HMA Trend Bias
13 stars

This strategy enters long when WaveTrend reads the market as oversold and short when it reads the market as overbought. It draws on the price chart and uses a reverse strategy type with optional start and stop dates. Stop loss is enabled by default and can fol

Strategy v5 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of Ruckard LazyBear WaveTrend A002
1 stars

This strategy calculates candle-position buying pressure derived from the close relative to the high-low range, smoothed through a double exponential moving average chain with a momentum overlay. It evaluates a multi-step pressure ladder to identify bullish an

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES Probe 04 - Pressure Gauge
1 stars

TRXBTC EMA Cross Strategy is a trend-following cryptocurrency strategy that executes trades based on single Exponential Moving Average price positioning and candle color. It plots a customizable EMA on the main price chart and triggers a long position when a b

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of TRXBTC EMA Cross Strategy

BB and KC Strategy

by hasnocool
106 stars

This strategy identifies breakout momentum by combining Bollinger Bands and Keltner Channels with volume confirmation. It opens long positions when the upper Keltner Channel crosses above the upper Bollinger Band and volume exceeds its moving average. Converse

Strategy v5 Volatility & bandsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BB and KC Strategy
13 stars

This strategy draws on the price chart and trades long, short, or both using simple moving averages of an ohlc4 source together with ADX and directional-index key levels. It can display a high and low closing moving-average ribbon and limit activity with optio

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Lunatic A003

PF IES probe 05 - bb/kc squeeze

by pineforge-4pass
1 stars

This Pine Script strategy detects volatility squeeze releases using parallel Bollinger Bands and Keltner Channels calculated with length 20 and specified multipliers. It plots the bands and channels overlaid on the price chart. The strategy enters a long posit

Strategy v6 Volatility & bandsBreakout
Updated 7 days ago · Apache-2.0 GitHub repository of PF IES probe 05 - bb/kc squeeze

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