Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 27)

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

Slow Stochastic Strategy

by Studentcodee
1 stars

A Pine v6 strategy built on a slow stochastic oscillator and drawn on the price chart. The %K line is the stochastic smoothed by a three-bar average, and %D is a further three-bar average. It enters long when %K crosses above %D while %K is below the oversold

Strategy v6 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of Slow Stochastic Strategy
1 stars

This strategy trades stochastic crossovers in extreme zones. It enters long when %K crosses above %D with both below the oversold level, and short when %K crosses below %D with both above the overbought level. Each entry carries an ATR-based stop loss and take

Strategy v5 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of Stochastic Oscillator Strategy

algo-trade-v111

by akash-yellgetti
1 stars

A strategy-type script for the price chart that draws the high, low and midpoint of the first part of each session, set by end hour and minute inputs. It then plots pivot-based support and resistance from left and right bar counts, shows labels where price bre

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

This strategy detects divergence strength across multiple indicators including RSI and MACD on the price chart. It evaluates regular and hidden divergences using user-defined weights for price and indicator changes along with lookback parameters for pivots and

Strategy v5 DivergenceOscillators & momentum
Updated 2 years ago · MPL-2.0 GitHub repository of Strength of Divergence Across Multiple Indicators on Tradingboat
1 stars

This strategy goes long when a 13-period EMA crosses above a 34-period EMA and short on the opposite cross, closing each side on the reverse cross. A percentage trailing stop, set separately for longs and shorts, ratchets behind the close and is plotted as cir

Strategy v5 Moving averagesTrend Repaints
Updated 2 years ago · None stated GitHub repository of Verge EMA Crossover + Trailing Stop
1 stars

A Pine v4 strategy that plots a 10-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 CRVBTC EMA Cross Strategy

Omar Edited WF

by Alorse
330 stars

Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of Omar Edited WF

STRG-BBForce

by harryguiacorn
220 stars

STRG-BBForce is a Bollinger Bands trend-following strategy. It calculates standard Bollinger Bands and tracks directional alignment across the upper, lower, and basis lines. When all three lines slope upward, it opens a long position and closes short positions

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of STRG-BBForce

This strategy identifies bullish and bearish Three Line Strike candlestick patterns combined with a dual moving average cloud and Volume Spread Analysis (VSA). It triggers long or short entries when a strike formation confirms in alignment with the moving aver

Strategy v5 Candlestick patternsTrend Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3LS 3 Line Strike Strategy [Kintsugi Trading]
57 stars

Implements an automated testing framework designed to validate an EMA Ribbon and MACD hybrid strategy. It verifies indicator calculations, trend context filters, signal generation, suppression rules, and cooldown mechanics using custom assertions. Test results

Strategy v6 Moving averagesOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon Test Suite v1.5
43 stars

This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.

Strategy v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m Strategy Candle Bar
26 stars

Feature Matrix - strategy is a minimal Pine Script v6 strategy designed to verify basic strategy execution functionality. It evaluates whether the closing price is higher than the opening price on the current bar. When a bullish candle forms, the script trigge

Strategy v6 Candlestick patterns
Updated 2 months ago · AGPL-3.0 GitHub repository of Feature Matrix - strategy
24 stars

This overlay strategy combines a Cipher B WaveTrend oscillator with two optional moving averages on the price chart. It exposes WaveTrend channel and average lengths, overbought and oversold levels, buy, sell and gold dots, and regular or hidden divergence mar

Strategy v5 Oscillators & momentumMoving averages
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B + EMAs Strategy
16 stars

This strategy enters long or short when a chart-timeframe Donchian breakout agrees with a higher-timeframe confirmation, using breakout, moving average, or both. It exits on a shorter Donchian channel and can flatten on a time rule. Position size risks a set p

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 17: Dual TF Confluence

DI Engulfing B002

by ruckard
13 stars

This strategy identifies trend-following engulfing setups filtered by a 200 EMA on the price chart. Long trades require price to be above the 200 EMA following three consecutive bearish candles engulfed by a bullish candle. Short entries mirror this structure

Strategy v5 TrendCandlestick patterns
Updated 1 year ago · None stated GitHub repository of DI Engulfing B002

Linear Regression Channel - Eterna

by EternaHybridExchange
9 stars

This strategy plots a linear regression of close and deviation bands on the price chart. It enters long when price crosses up from the lower band in an uptrend defined by an EMA and a rising regression line, and enters short on a rejection from the upper band

Strategy v5 TrendMean reversion Repaints
Updated 7 months ago · MIT GitHub repository of Linear Regression Channel - Eterna

RSI Divergence

by muammeryldrm42
7 stars

This strategy detects bullish and bearish RSI divergences using price and RSI pivot points. A bullish divergence triggers a long entry when price forms a lower low while RSI forms a higher low below 40. A bearish divergence triggers a short entry when price fo

Strategy v5 Oscillators & momentumDivergence
Updated 3 months ago · MIT GitHub repository of RSI Divergence

This long-only strategy executes trades based on Ichimoku Kinko Hyo Tenkan-Sen and Kijun-Sen crossovers. It opens a long position when the Tenkan-Sen moves above the Kijun-Sen and closes the position when the Tenkan-Sen falls below the Kijun-Sen. Main settings

Strategy v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo TK Cross Strategy
6 stars

Capital41 Fusion Core Strategy is an overlay trading strategy that combines an exponential moving average trend filter, RSI, Williams %R, and volume/ATR expansion into a composite momentum oscillator. It executes long trades when the smoothed oscillator crosse

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Capital41 Fusion Core Strategy

SM and MACD

by jerryinyang
5 stars

This strategy combines Squeeze Momentum and MACD indicators to generate trading signals. It plots the Squeeze Momentum histogram and MACD in a separate pane. The strategy enters long positions when squeeze enters and MACD is bullish, and short when squeeze ent

Strategy v4 Oscillators & momentumVolatility & bands
Updated 2 years ago · None stated GitHub repository of SM and MACD

This long-only strategy combines a 200-period Exponential Moving Average, Stochastic RSI, and three distinct Supertrend indicators with varying ATR periods and multipliers. It enters long trades when price trades above the 200 EMA, Stochastic RSI crosses up fr

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Stochastic + Triple Supertrend Long Strategy
4 stars

This strategy trades pullbacks in the direction of a moving-average trend and draws on the price chart. An uptrend requires the 50-period EMA above the 200-period EMA with price above the slower average, and a downtrend is the reverse. It enters long or short

Strategy v6 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of AG Trend-Pullback Optimized

SuperTrend Follow

by latentwill
4 stars

The SuperTrend Follow strategy determines trend direction using a simple ATR value derived from the moving average of high-low ranges. It plots on the price chart and enters long positions when price exceeds the ATR value or short when price falls below. The s

Strategy v5 TrendMoving averages
Updated 8 days ago · None stated GitHub repository of SuperTrend Follow
4 stars

This strategy trades directional momentum breakouts for crude oil on the price chart. It enters long or short positions when a fast exponential moving average crosses a slow exponential moving average, provided that current Average True Range exceeds its movin

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of CL Crude Oil Momentum [trugurpala]
4 stars

The Keltner Channel Strategy is a breakout system plotted directly on the main price chart. It calculates upper and lower channel bands around an exponential or simple moving average using ATR, True Range, or bar range multiplied by a specified factor. A long

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Keltner Channel Strategy

MA Crossover Strategy [Lab]

by mitchell-917
4 stars

This strategy plots fast and slow moving averages on the price chart and trades their crossovers. It enters long when the fast average crosses above the slow average and short when it crosses below. An optional higher-timeframe moving average can block trades

Strategy v5 TrendMoving averages
Updated 11 months ago · Custom licence GitHub repository of MA Crossover Strategy [Lab]

My Custom Strategy 1

by might-tree
4 stars

This long-only strategy plots a 20-period exponential moving average of the low, a 20-period simple moving average of the low, and the close in a separate pane. It enters long when the high breaks the prior 25-bar highest close and the close is above both the

Strategy v5 Moving averagesBreakout Repaints
Updated 3 years ago · None stated GitHub repository of My Custom Strategy 1

MP Camarilla Range Bounce

by midngtpickle
2 stars

This strategy fades touches of daily Camarilla pivot boundaries (S3 for longs, R3 for shorts) during sideways market conditions. It plots pivot levels directly on the price chart and validates entries using regime filters, including maximum ADX thresholds, pri

Strategy v6 Support & resistanceMean reversion
Updated 4 weeks ago · Custom licence GitHub repository of MP Camarilla Range Bounce

ZEGUELA DEMALONG

by danielvm-git
2 stars

This strategy executes long trades based on Double Exponential Moving Average (DEMA) crossover signals. It calculates up to three DEMAs, triggering entries when the faster DEMA crosses above the slower DEMA (optionally filtered by a third DEMA's direction) or

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of ZEGUELA DEMALONG

WaveTrend with Crosses [LazyBear]

by avatar-lavventura
2 stars

This strategy combines multiple technical indicator systems into a composite trading setup. It computes an Ichimoku Cloud, an ATR-based trailing stop system (nKRAL) with optional Heikin Ashi smoothing, Bollinger Bands, Parabolic SAR, and higher-timeframe Super

Strategy v4 TrendVolatility & bands
Updated 7 months ago · None stated GitHub repository of WaveTrend with Crosses [LazyBear]
2 stars

Hulk Grid Algorithm V2 is a grid trading strategy designed for price charts. It establishes ten distinct grid levels around a user-defined mid price, spaced apart by a fixed dollar grid step. The strategy places long limit orders across these levels with scale

Strategy v5 Support & resistanceMean reversion Repaints
Updated 1 year ago · None stated GitHub repository of Hulk Grid Algorithm V2 - The Quant Science
2 stars

This strategy enters long when price closes above the prior channel high and a longer EMA filter, the bar is bullish, volume rises versus the previous bar, and average volume and turnover clear set thresholds. It exits the long when price closes below a shorte

Strategy v5 BreakoutMoving averages
Updated 2 years ago · None stated GitHub repository of DegenerateChain Channel Breakout
2 stars

This strategy combines Momentum, Chande Momentum Oscillator, and Commodity Channel Index alongside standard deviation Bollinger Band bounds. It calculates oscillator values across customizable timeframes and lengths to track market momentum and volatility in a

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 3 years ago · None stated GitHub repository of [CBB] MOM/CCI Divergence Strategy

TSMOM L/S SMA50

by nvolpe2007-cell
1 stars

An always-in-the-market strategy that goes long when the daily close is above a 50-bar SMA and short when below, with an optional hysteresis band and a switch to disable shorts. It simulates a perpetual futures position with a funding cost charged over the hol

Strategy v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of TSMOM L/S SMA50

Conduit OBV AccDist

by pineforge-4pass
1 stars

A long-only strategy that requires two volume flow measures to agree: On Balance Volume and Accumulation/Distribution, each compared with its own EMA. It enters long when both are above their signals for the first time and price is above a longer EMA filter. I

Strategy v6 VolumeTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Conduit OBV AccDist
1 stars

A long and short strategy based on five moving averages of 10, 20, 50, 100 and 200 bars. It can require the averages to be in perfect order with aligned slopes, filter entries by ADX range, and optionally by RSI and a higher timeframe moving average. A strict

Strategy v6 Moving averagesBreakout
Updated 8 days ago · None stated GitHub repository of Qullamaggie MA Breakout L+S

A strategy that detects classic chart patterns from pivot points on the price chart: double and triple tops and bottoms, head and shoulders, flags, pennants, wedges, triangles, rectangles and cup and handle shapes. Each can be switched on or off, with toleranc

Strategy v6 BreakoutSupport & resistance
Updated 8 days ago · GPL-3.0 GitHub repository of Auto Pattern Detector Targets with Session Strategy

SR+Trend v12

by MuhammadMuhamid
1 stars

A long-only crypto spot strategy whose support and resistance section can be switched on or off and set as the main entry trigger or as a secondary filter. When enabled, it uses pivots on four timeframes, ATR-sized touch zones and a retest window. Trend filter

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of SR+Trend v12

Smooth Trend Radar

by raybird
1 stars

A trend strategy on the price chart built on a double-smoothed Supertrend using WMA and EMA smoothing, with pivot rejection entries when price touches the baseline. Settings scale automatically by timeframe. Stop loss can use the flip candle, baseline or swing

Strategy v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of Smooth Trend Radar

EMM Strategy V2 - Pine Engine

by tthanhvu002sgu
1 stars

A strategy that trades price crossings of an exponential moving median line on the price chart. It buys when close crosses above the line and sells when it crosses below, closing the opposite position on the same cross. An optional higher-timeframe filter, def

Strategy v5 Moving averagesTrend
Updated 3 months ago · None stated GitHub repository of EMM Strategy V2 - Pine Engine

STT SR TMA Plan

by majohnst
1 stars

This strategy executes trades based on Triangular Moving Average (TMA) crossings, support and resistance structures, and breakout logic. It evaluates multiple confluence conditions including daily pivots, anchored VWAP, and multi-day moving averages alongside

Strategy v6 Moving averagesTrend
Updated 4 months ago · None stated GitHub repository of STT SR TMA Plan

SMC Strategy

by mrdungx2603
1 stars

This Smart Money Concepts (SMC) strategy identifies market structure, order blocks, imbalances, and premium or discount zones directly on the price chart. It executes long trades in discount zones and short trades in premium zones based on order block retests,

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 4 months ago · None stated GitHub repository of SMC Strategy

Trailing Call Comma

by Snappni
1 stars

This strategy plots a 12-period and a 26-period exponential moving average on the price chart. It enters long when the fast average crosses above the slow average and enters short when the fast average crosses below the slow average. Opposite signals reverse t

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Trailing Call Comma
1 stars

This overlay strategy finds swing highs and lows, then marks an Optimal Trade Entry band between the 0.62 and 0.79 retracements of the latest impulse. A long is allowed only inside the bullish band and above a trend EMA; a short is allowed only inside the bear

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 5 months ago · None stated GitHub repository of Talons OTE (Optimal Trade Entry)
1 stars

This strategy generates buy and sell signals on the SP500 4H chart using EMA crossovers confirmed by MACD, filtered by ADX trend strength, RSI levels, and active London or New York sessions. It plots EMA 9, EMA 21, and EMA 200 on the price chart. Buy signals e

Strategy v6 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Señales EMA + MACD v4b [SP500 4H]

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