Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 38)

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

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 LINKBTC EMA Cross Strategy
330 stars

Improvising [Alorse] is a price-chart strategy that looks for a one-bar candle reversal filtered by a 10-period EMA, a 14-period RSI, and a rising or falling MACD. Longs require a bearish bar followed by a bullish close above the EMA, RSI below 65, and a risin

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]
257 stars

This is a futures trading strategy for instruments like ES. It plots an Ichimoku Cloud using Tenkan, Kijun, Senkou A, Senkou B and Chikou lines along with pivot highs and lows to mark resistance and support levels directly on the price chart. Inputs let users

Strategy v5 TrendSupport & resistance Repaints
Updated 7 weeks ago · None stated GitHub repository of Futures No Repain ES

AC- MY SCRIPT1

by hasnocool
106 stars

This strategy plots an Optimized Trend Tracker and a selectable moving-average support line on the price chart. It builds the average as SMA, EMA, WMA, TMA, VAR, WWMA, ZLEMA, or TSF, then offsets long and short stops by a percent of that average. Optional mark

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of AC- MY SCRIPT1
16 stars

This strategy enters long or short when a fast exponential moving average crosses a slow one, then sizes each unit from a percentage of equity and an ATR-based initial stop. It can add positions as price moves by a multiple of ATR, up to a set unit limit, and

Strategy v6 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of Seykota Alt 2: EMA Crossover

Diverlong C002

by ruckard
13 stars

Diverlong C002 is a trading strategy designed to identify entries using Squeeze Momentum Indicator divergences and execute exits based on Curie Closing Lines. Long and short signals trigger when price movements contradict Squeeze Momentum values across indicat

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Diverlong C002
9 stars

VSA Pro: Trend and Rejection is an overlay strategy combining SuperTrend trend filtering with Volume Spread Analysis principles. It calculates SuperTrend direction to enter long positions when a new bullish trend starts and exits all positions when the trend t

Strategy v5 TrendVolume
Updated 4 months ago · MIT GitHub repository of VSA Pro: Trend and Rejection

WR-SR + SMC Strategy v4.0

by alboogycOdR
6 stars

The WR-SR + SMC Strategy v4.0 combines wick rejection for support and resistance level detection with Smart Money Concepts including CHoCH and BOS structure changes, fair value gap zones and order blocks. It signals trading entries and exits on the price chart

Strategy v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of WR-SR + SMC Strategy v4.0

Kenny's Strategy

by jerryinyang
5 stars

Kenny's Strategy combines multiple exponential moving averages to identify trend changes and generate entry signals. It calculates short, medium, and long EMAs from a user-selected source and checks for alignment within specific zones. A long-term EMA filter r

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Kenny's Strategy

This strategy identifies bearish engulfing candlestick formations to execute short positions. A short entry triggers when the current bar opens at or above the previous bar's open and close, then closes below the previous open. Position exits are managed eithe

Strategy v4 Candlestick patterns
Updated 3 years ago · Apache-2.0 GitHub repository of Engulfing Candle Short Strategy (Not Good)

RSI2 Optimized STEPFUN

by eltonaguiar
4 stars

This strategy draws on the price chart and trades a two-period RSI. It enters long when RSI crosses above the oversold level and short when RSI crosses below the overbought level. An optional SMA trend filter, volume confirmation, and cooldown can block entrie

Strategy v5 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of RSI2 Optimized STEPFUN

This strategy tracks GBP/USD market structure by storing confirmed pivot highs and lows. It enters long when price crosses above the last pivot high while above a trend EMA, and short when price crosses below the last pivot low while below that EMA. Entries oc

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · MIT GitHub repository of GBP/USD Market Structure [trugurpala]

Version Kappa: Composite Momo + Volume + Price Strategy evaluates trend, momentum, and volume dynamics to generate trading signals on the price chart. It calculates a composite RSI wrapped in Starc Bands, tracking momentum across both current and higher timefr

Strategy v5 Oscillators & momentumVolume Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Version Kappa: Composite Momo + Volume + Price Strategy

Alpy Vix

by avatar-lavventura
2 stars

This strategy plots a Williams Vix Fix histogram in a separate pane and compares price with a volume-weighted moving average of HLC3. It buys when the histogram turns from lime to gray, price is below the VWMA by the long offset, and the close ticks down. It s

Strategy v4 Volatility & bandsMoving averages Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Vix

0.35 Hedging Strategy

by wynnforthework
2 stars

This strategy executes a recovery zone hedging system directly on the price chart. It initiates an initial position at periodic bar intervals when flat, setting a target take profit and an adverse recovery boundary. If the market moves against the position int

Strategy v5 Mean reversion
Updated 1 year ago · None stated GitHub repository of 0.35 Hedging Strategy

Simple Pullback Strategy

by Web3Degenerate
2 stars

This strategy executes long trades during pullbacks within an established uptrend, plotting moving averages, entry prices, and stop levels on the price chart. It buys when the close is above the long-term simple moving average and below the short-term moving a

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Simple Pullback Strategy
1 stars

An extended version of the JAT+BSM strategy that adds a strategy preset, a risk aggression choice and a pattern type filter to the AlphaTrend style core, MACD, consolidation layers, volume profile and candlestick and macro pattern drawings. Forecasts use kinem

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended
1 stars

This mean-reversion strategy implements Larry Connors' 2-period RSI system. It enters long positions when price trades above a long-term simple moving average (default 200) and the 2-period RSI drops below 10. Optional short positions enter below the trend ave

Strategy v6 Mean reversionOscillators & momentum
Updated 4 days ago · MPL-2.0 GitHub repository of RSI-2 (Larry Connors) [JR]

ES point-value 9/21 SMA cross

by pineforge-4pass
1 stars

This strategy isolates ES futures point-value PnL scaling using a nine-period and twenty-one-period simple moving average cross. It enters one long contract when the fast average crosses above the slow average and closes that long when the fast average crosses

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of ES point-value 9/21 SMA cross

A strategy that uses ADX to decide between two sub-strategies. In ranging conditions it fades asymmetric Bollinger Band extremes with a 200 EMA trend filter. In trending conditions it trades Donchian channel breakouts, protected by optional volume, candle rang

Strategy v6 Mean reversionBreakout
Updated 8 days ago · GPL-3.0 GitHub repository of Hierarchical Trading System v6 Fakeout Protected
1 stars

Corpus Switch And Strings is a multi-asset strategy that calculates the price spread between two configurable symbols on a set timeframe. It evaluates the spread using a string switch selection to compute either a 9-period Exponential Moving Average, a 9-perio

Strategy v5 Moving averagesOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Corpus Switch And Strings
1 stars

A Pine v4 strategy that plots a 27-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 LINKWETH EMA Cross Strategy
330 stars

This strategy combines triple exponential moving averages with a TTM Squeeze oscillator to capture trend-following momentum. It enters long or short positions when price aligns with all three EMAs (125, 680, and 2500 period) and the oscillator turns in the tre

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Improvising [Alorse]
257 stars

This overlay strategy is named for one-minute gold. It requests the daily low and several higher-timeframe opens with lookahead enabled, builds a synthetic source from recent opens, and plots a volume-weighted moving average of a higher-timeframe open with sta

Strategy v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of GOLD 1M - No repaint
228 stars

This strategy enters long when a faster moving average crosses above a slower one and short when it crosses below, unless long-only mode is on. An optional volume filter requires volume above a 20-bar average times a multiplier. Exits use a percentage stop los

Strategy v6 TrendMoving averages
Updated 3 months ago · None stated GitHub repository of MA Cross Strategy Template

Accumulate

by hasnocool
106 stars

Accumulate identifies potential market accumulation and breakdown phases by combining four Simple Moving Averages (21, 50, 90, and 200 periods) with a Price Volume Trend (PVT) MACD indicator. Green buy arrows plot on the main price chart when price is above a

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Accumulate
65 stars

This strategy calculates the 20-period RSI and detects bullish and bearish crosses at the 50 level. On a bullish crossover it enters a long position using a stop set to the high price and sends a custom alert message with the stop value. On a bearish crossunde

Strategy v5 Oscillators & momentum
Updated 6 days ago · GPL-3.0 GitHub repository of Strategy using alert_message
16 stars

This strategy enters long or short on Donchian channel breakouts and adds units only while RSI remains beyond its momentum thresholds. Size is based on a percentage of equity per unit, up to a set maximum. An ATR initial stop and a chandelier trail manage open

Strategy v6 TrendOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Seykota Alt 30: Momentum Pyramid

Diverlong D002

by ruckard
13 stars

Diverlong D002 is a trading strategy designed for crypto assets that detects momentum divergences using state changes in the Squeeze Momentum Indicator. It triggers long or short entries when price and momentum diverge across indicator sections. Trade exits ar

Strategy v5 DivergenceOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Diverlong D002

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX

This strategy identifies potential reversal conditions using statistical bands derived from price extremes relative to moving averages and standard deviations. It enters long positions when a greed condition confirms over consecutive bars. Exits are handled vi

Strategy v4 Mean reversionVolatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of Fear + Greed Reversal Long Strategy (Daily)

Simpleton GROK

by eltonaguiar
4 stars

This strategy plots on the price chart and combines up to seven optional modules that vote for long or short conditions. The modules use a 20-period simple moving average, a five-period RSI, Bollinger Band squeezes, a simplified prior-bar break, stacked expone

Strategy v5 Oscillators & momentumMoving averages
Updated 2 days ago · None stated GitHub repository of Simpleton GROK
4 stars

This strategy evaluates EMA crossovers filtered by a long-term 200-period EMA trend filter designed for Gold futures and XAUUSD. It enters a long position when a fast EMA crosses above a slow EMA while price is above the 200 EMA. If long-only mode is turned of

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Gold GC/XAUUSD Strategy [trugurpala]

Alpy Vix

by avatar-lavventura
2 stars

This strategy plots the Williams Vix Fix indicator as a histogram in a separate pane to detect potential trend reversals. It calculates the Vix Fix value using a lookback period and standard deviation bands derived from Bollinger Bands on the Vix Fix. Multiple

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

3C QFL Mean Reversal

by wynnforthework
2 stars

This strategy implements a Quickfinger Luc mean-reversion trading model tailored for automated execution. It calculates base support levels and volume moving averages across timeframes to identify sharp price dips below established base levels. The script incl

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of 3C QFL Mean Reversal

Stops & Targets

by Web3Degenerate
2 stars

This script demonstrates how to calculate and display ATR-based stop loss and take profit levels directly on the price chart. It detects hammer and shooting star candlestick patterns filtered by a 50-period EMA trend. When a setup occurs and no active trade is

Strategy v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Stops & Targets
1 stars

An extended strategy version that adds a strategy preset, a risk aggression choice and a pattern type filter to an AlphaTrend style core with MACD. It includes three consolidation layers with volume profile, candlestick and macro pattern drawings, a kinematic

Strategy v5 TrendOscillators & momentum
Updated 2 days ago · None stated GitHub repository of JAT+BSM Pro v13 Extended

Gyroscope CMO Median

by pineforge-4pass
1 stars

A long-only strategy that pairs a rolling median line with the Chande Momentum Oscillator. It enters long when price crosses above the median while the oscillator is above an entry level. It exits when price drops below the median, the oscillator falls under a

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Gyroscope CMO Median
1 stars

A long-only strategy adapted from an academic study of intraday reversal. It measures the return over a ranking period given in minutes, skips a bar, and buys when that return falls in the lowest percentile of its own recent history, then holds for a set numbe

Strategy v6 Mean reversionScreeners & dashboards
Updated 8 days ago · GPL-3.0 GitHub repository of Intraday Reversal Feasibility Check
1 stars

This strategy evaluates short-term trend momentum by summing price differences across a user-defined lookback period using a for loop. It combines this calculated average momentum with 9-period and 21-period Exponential Moving Average crossovers. A long trade

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of For Loop Accumulator
1 stars

A Supertrend strategy that enters on the trend direction, filtered by a 4-hour Supertrend, relative volume and ADX strength. It exits at a percentage profit target, with an optional trailing offset, and a time-based exit that closes at breakeven after a maximu

Strategy v6 Trend Repaints Archived
Updated 5 months ago · None stated GitHub repository of Supertrend2 Target No-SL Dashboard
1 stars

This strategy runs on the price chart and is titled for a percentile SuperTrend combined with OBV and DI, although the provided excerpt does not show those calculations. It restricts trading to bars after a user-chosen start time and can enable long entries, s

Strategy v5 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Percentile_SuperTrend_OBV&DI

VP Scalper

by Tradehook-org
1 stars

A Pine v5 strategy that trades around point of control and value area levels. These are not a true volume profile: the code builds approximate levels from the previous session's high, low and close, taken from a daily, weekly or monthly timeframe and scaled by

Strategy v5 Support & resistanceScalping
Updated 8 months ago · None stated GitHub repository of VP Scalper

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