Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 20)

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

Regime HA on EMA strategy

by aofwittawat
4 stars

This overlay strategy classifies trend from a higher-timeframe Heikin Ashi close and an exponential moving average of that close. When the confirmed price is above the average it enters long and closes any short; when price is below it enters short and closes

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Regime HA on EMA strategy

This script provides a standardized template for building and testing trading strategies in Pine Script v4. It includes built-in risk management modules such as backtest date filtering, trade direction toggles (long-only, short-only, or flipped), signal-count

Strategy v4
Updated 6 years ago · Apache-2.0 GitHub repository of StrategyNameHere - BuildABot-DRR

Risk-Managed Scaffold

by jpantsjoha
3 stars

This strategy enters long when a 20-period EMA crosses above a 50-period EMA and price is above the previous closed daily close. It sizes the position from a percentage of equity and the ATR stop distance, then exits with an ATR stop and a reward-to-risk limit

Strategy v6 TrendMoving averages
Updated 4 weeks ago · Custom licence GitHub repository of Risk-Managed Scaffold

Stella's SuperTrend Basic

by stella-entry
3 stars

Stella's SuperTrend Basic is a trend-following strategy that calculates the SuperTrend indicator directly on the price chart. It enters long positions when the price crosses above the SuperTrend line and switches to short positions when the price crosses below

Strategy v6 Trend
Updated 8 months ago · MIT GitHub repository of Stella's SuperTrend Basic
3 stars

This strategy plots long and short markers on the price chart. It builds a composite index from RSI change and a short RSI average, then requires that index, a one-minute cumulative volume delta, and a relative volatility index to agree. EMA, SMA, and VWAP rel

Strategy v5 Oscillators & momentumVolume Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Composite RVI CVD Strategy

QQQ MA Accumulation v2

by yalili8521
2 stars

This intraday strategy calculates fast, mid, and slow Simple Moving Averages to confirm alignment alongside steady bar accumulation on short timeframes. It filters entries by rejecting large candle spikes and restricting execution to a defined morning session

Strategy v6 TrendMoving averages
Updated 9 days ago · None stated GitHub repository of QQQ MA Accumulation v2

BOT A-SLP DEMATRON 2H

by danielvm-git
2 stars

This strategy calculates up to three Double Exponential Moving Averages (DEMA) to generate buy and sell signals based on crossover and crossunder conditions. It plots the moving average lines directly on the price chart. The indicator includes input controls f

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of BOT A-SLP DEMATRON 2H
2 stars

This mean-reversion trading strategy targets XAUUSD during the Asian trading session. It generates buy signals when price touches the lower Bollinger Band and RSI is oversold, and sell signals when price reaches the upper band and RSI is overbought. Trades are

Strategy v6 Mean reversionSessions & time
Updated 4 months ago · None stated GitHub repository of XAUUSD Mean Reversion Strategy

Alpy Vix

by avatar-lavventura
2 stars

This strategy calculates a rolling volume-weighted average price and Chris Moody's Williams Vix Fix to detect market bottoms and oversold volatility spikes. It plots in a separate pane and colors chart bars based on filtered exhaustion criteria and price actio

Strategy v5 Volatility & bandsMean reversion Repaints
Updated 7 months ago · None stated GitHub repository of Alpy Vix

This strategy plots a fast and a slow simple moving average on the price chart and enters long when the fast average crosses above the slow average, or short on a cross below. Longs also require ADX above a threshold, RSI below 65, ATR above a minimum, and a b

Strategy v5 TrendOscillators & momentum
Updated 8 months ago · MIT GitHub repository of Quantum Entanglement (Filtered MA Crossover)

This strategy enters long when the close breaks above the prior lookback high and volume exceeds its simple moving average, but only if a VIX regime score is at least three. The score counts whether the VIX to three-month VIX ratio and the VIX level sit below

Strategy v5 BreakoutVolatility & bands Repaints
Updated 10 months ago · MIT GitHub repository of Auto Breakout Strategy mit VIX Heatmap Gate

Box Scalper

by wynnforthework
2 stars

This strategy draws on the price chart and combines a momentum zigzag, a custom QQE built from RSI, ADX directional strength, an SSL filter, and a coefficient-of-variation weighted average. Box period, deviation, and threshold inputs set the box filter, while

Strategy v5 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of Box Scalper
2 stars

This strategy enters long positions when the fast SMA of 10 periods crosses above the slow SMA of 30 periods. It calculates the trailing stop price as the position average price multiplied by one minus the trailing stop percentage divided by 100. The strategy

Strategy v5 TrendMoving averages
Updated 2 years ago · Apache-2.0 GitHub repository of Trailing Stop Strategy

Three Brothers Strategy

by sassiz-root
2 stars

This strategy looks for three prior bars moving the same way with successively smaller bodies, followed by a current bar that closes the other way. It enters long when those prior bars are bearish and the current bar is bullish. A short entry is present only a

Strategy v5 Candlestick patterns Repaints
Updated 3 years ago · MIT GitHub repository of Three Brothers Strategy

This strategy plots SuperTrend lines on the price chart using ATR period and multiplier settings to identify trend direction and generate buy and sell signals. It integrates with Algomojo automation to automatically execute trades via API calls to supported br

Strategy v5 TrendVolatility & bands
Updated 4 years ago · MIT GitHub repository of SuperTrend Algomojo Trading Strategy with Target/Stoploss

Level Search

by DaniilOkrug
2 stars

This Pine Script strategy identifies and plots horizontal support levels by searching for price clusters across historical price lows. It scans a configurable number of past bars to group nearby low prices within a user-defined tick deviation. When a price lev

Strategy v5 Support & resistance Repaints
Updated 4 years ago · MIT GitHub repository of Level Search

Sandwich

by kat3samsin
2 stars

This strategy identifies sandwich patterns using RSI, ALMA, and Stochastic indicators. It plots RSI, Choppiness Index (CI), Stochastic K, and D in a separate pane. Long entries trigger when RSI is above CI, both Stochastic lines fall between CI and RSI, and K

Strategy v4 Oscillators & momentumMoving averages
Updated 5 years ago · MIT GitHub repository of Sandwich

Leveraged Perp Arm

by nvolpe2007-cell
1 stars

A simulated leveraged perpetual futures strategy with three modes in one script. Direction comes from a 50-bar SMA or a 21 and 55 EMA cross, and exits use either a fixed take profit and hard stop or an ATR chandelier trail. Leverage is capped, with maintenance

Strategy v6 TrendVolatility & bands
Updated 2 days ago · None stated GitHub repository of Leveraged Perp Arm

Ghost Alpha Strategy

by mphinance
1 stars

A strategy version of the Ghost Alpha overlay, using the same Hull band, TRAMA, Keltner bands, moving averages, swing structure, Williams %R exhaustion and squeeze components with a minimum grade filter. The strategy settings use percent-of-equity sizing at th

Strategy v6 TrendVolatility & bands
Updated 3 days ago · Custom licence GitHub repository of Ghost Alpha Strategy

BB Squeeze Breakout

by pineforge-4pass
1 stars

A strategy that detects a volatility squeeze when Bollinger Bands sit inside Keltner Channels. After a squeeze, it waits for the bands to expand outside the channels, then enters long if a linear regression momentum value is positive or short if it is negative

Strategy v6 Volatility & bandsBreakout
Updated 7 days ago · Apache-2.0 GitHub repository of BB Squeeze Breakout

Hash Momentum Strategy

by kanylbullen
1 stars

Calculates normalized momentum against a threshold and combines it with an exponential moving average trend filter. It triggers trades in the direction of the EMA trend when momentum surges, subject to optional session, weekend, and cooldown filters. Exits are

Strategy v6 Oscillators & momentumTrend
Updated 8 days ago · None stated GitHub repository of Hash Momentum Strategy

A strategy that classifies each bar as bull or bear trend, bull or bear expansion, chop or neutral using EMA slope, ADX and an ATR ratio, with an optional higher timeframe EMA bias. Depending on the regime it uses trend pullback entries, expansion breakout ent

Strategy v6 TrendBreakout Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Adaptive Market Regime Hierarchy Strategy v1

A Pine v6 strategy for crypto charts that looks for an RSI oversold setup together with a Fibonacci-spaced Bollinger Band setup, then waits for a reclaim as confirmation. Optional filters include a trend moving average on the chart and a higher timeframe, a vo

Strategy v6 Mean reversionOscillators & momentum
Updated 12 days ago · MIT GitHub repository of Crypto TA Pro RSI + Fibonacci BB Regime

MTF Confluence Lean

by MuhammadMuhamid
1 stars

A long-only spot strategy that enters when all enabled gates agree, each on its own timeframe, 15 minutes by default: Supertrend bullish, RSI above a threshold and below a cap, Volume Flow Indicator above a level, and a support check. One reward-to-risk stop a

Strategy v6 TrendOscillators & momentum
Updated 13 days ago · None stated GitHub repository of MTF Confluence Lean
1 stars

A long-only research strategy that enters when momentum, the close divided by the close several bars back minus one, crosses from zero or below to above zero. It exits when momentum turns negative or an ATR-based trailing stop is hit. Signals are decided on co

Strategy v5 TrendVolatility & bands
Updated 3 weeks ago · None stated GitHub repository of Momentum ATR Next-Bar Open

J 8

by moonyroy
1 stars

This strategy detects pin bars within an EMA volatility channel using custom user-defined types. It determines market direction based on price action relative to a 21-period EMA and a body-based ATR range. When a qualifying bullish or bearish pin bar prints in

Strategy v6 Candlestick patternsMoving averages
Updated 3 weeks ago · None stated GitHub repository of J 8

Kernal Cipher Strategy

by kdricha0602
1 stars

Kernal Cipher Strategy is a price-chart overlay that backtests the Kernal Cipher confirmed-bar signal engine. It enters long or short at the next bar's open when trend, regime, and oscillator filters agree, then exits on an adaptive ATR stop or an opposite sig

Strategy v6 TrendOscillators & momentum
Updated 5 weeks ago · MIT GitHub repository of Kernal Cipher Strategy
1 stars

A long-only strategy template meant to send webhook alerts to an external bot. It enters on a fast and slow EMA cross with a volume surge while RSI is below the overbought level, or on an oversold RSI at the lower Bollinger Band with a volume surge. Each entry

Strategy v5 Oscillators & momentumMean reversion
Updated 6 weeks ago · None stated GitHub repository of Algo Bot Signal Generator

TRAMA Cloud SIGIL

by dwightspitz
1 stars

A long-only strategy built on two TRAMA adaptive averages, a short one of 20 bars and a long one of 50 bars, each with its own source and optional timeframe. It buys when price crosses above the short average while that average is below the long one, or when t

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of TRAMA Cloud SIGIL
1 stars

A trend strategy on the price chart based on an ATR chandelier trailing line with a five-level trend state that marks warning and danger zones as price nears the line. A flip needs a minimum candle body. The multiplier can stay fixed or adapt using a simple me

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

v39b Live Adapt

by syrilj
1 stars

A long strategy for one-hour or two-hour charts based on structure and volume-price analysis. Side is set by price being inside the value area and at or above the point of control, with an optional higher-timeframe Heikin-Ashi MACD filter. Position size comes

Strategy v6 VolumeOscillators & momentum
Updated 2 months ago · None stated GitHub repository of v39b Live Adapt

GrimmHA Strategy

by GreyssonEnterprises
1 stars

This strategy combines Heikin Ashi candlestick pattern recognition with Smoothed Moving Average (SMMA) trend filtering to generate long and short entries. It detects doji candles, three-line strikes, and engulfing patterns aligned with SMMA trends. Risk manage

Strategy v5 TrendMoving averages
Updated 3 months ago · MIT GitHub repository of GrimmHA Strategy

Fusion Cipher Strategy

by shahzaib-574
1 stars

Fusion Cipher Strategy is an overlay strategy that scores wave momentum, money flow, VWAP, RSI, Stochastic RSI, ADX, and divergence conditions before opening trades. It enters long when the composite score meets a minimum and the wave is below a pullback thres

Strategy v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of Fusion Cipher Strategy

GEKO Strategy

by grzegorzkowalskigk-jpg
1 stars

This strategy backtests a Candle Range Theory model on the price chart, with variants that also require a CVD divergence, an absorption candle, or both. Entries can be taken on a midline retest, with the stop placed using an ATR buffer. Risk is sized as a perc

Strategy v6 SMC / ICT / price action
Updated 3 months ago · Custom licence GitHub repository of GEKO Strategy

This short-only scalping strategy combines multi-timeframe analysis to identify panic selling opportunities. It uses higher-timeframe data (15-minute by default) to establish a downtrend context characterized by strong bearish candles with minimal lower wicks.

Strategy v6 TrendCandlestick patterns
Updated 4 months ago · MIT GitHub repository of Doc04 Greed Panic Scalper - Project Adapted

Talons FVG Strategy

by muammeryldrm42
1 stars

A strategy that detects three-candle fair value gaps larger than a set ATR multiple and draws them as boxes on the price chart. It then waits for price to retrace to the gap midpoint and enters with a limit order, optionally only in the direction of a 200 EMA

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 5 months ago · None stated GitHub repository of Talons FVG Strategy

Renko MACD Futures Long Only

by PETERSAMUELOPS12
1 stars

A long-only futures strategy that simulates Renko bricks on a normal time chart and calculates MACD on the brick closes, which filters out time-based noise. A bullish MACD crossover on the bricks opens a long when price is above a trend SMA by a buffer. Exits

Strategy v6 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of Renko MACD Futures Long Only

BVortex XAUUSD 1H

by Alberto082544
1 stars

This strategy trades XAUUSD on the one-hour chart. It builds a scaled Vortex oscillator from directional movement and flags bars that leave an upper or lower extreme with a matching candle. Entries also need ADX at or above a set minimum and a swing-pivot tren

Strategy v6 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of BVortex XAUUSD 1H

QUANT-OMEGA Strategy

by princeleuel-code
1 stars

A strategy version of the QUANT-OMEGA regime and ensemble signal. It classifies the market with ADX and ATR, scores trend, mean-reversion and breakout signals into a confidence value, and enters only above set thresholds. Stops and targets are ATR multiples. P

Strategy v5 TrendMean reversion
Updated 5 months ago · None stated GitHub repository of QUANT-OMEGA Strategy
1 stars

A futures strategy for 30-minute charts that fades extreme moves away from a daily-reset VWAP. It looks for price beyond a configurable number of standard deviations from VWAP, a short RSI in oversold or overbought territory, and an ADX reading below a maximum

Strategy v6 Mean reversionSupport & resistance
Updated 6 months ago · None stated GitHub repository of AlgoBot VWAP Mean Reversion Strategy
1 stars

A long-only calendar strategy for Bitcoin. At a chosen hour on Sunday it compares price with the price recorded at a chosen hour the previous Friday, and enters long when the weekend gain exceeds a minimum percentage. The position is closed at the Friday hour.

Strategy v6 Sessions & time
Updated 7 months ago · None stated GitHub repository of BTC Weekend Strategy

Energy Block V11 Balanced

by shawnwong84
1 stars

The balanced preset of a strategy that routes orders to MetaTrader through connector alert messages. Inputs cover symbol prefix, suffix and mapping, lot size, a magic number, a pip multiplier and a base risk percentage, with higher risk tiers for selected inde

Strategy v6 Breakout
Updated 7 months ago · None stated GitHub repository of Energy Block V11 Balanced

BTC ATH Golden Cycle

by ymlee1104
1 stars

This strategy overlays technical indicators and staged dip-buying logic designed for Bitcoin market cycles. It incorporates a geometric mean indicator, multi-timeframe EMA bands, a customizable range filter, and supply and demand zones directly onto the price

Strategy v6 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of BTC ATH Golden Cycle

ORB Pullback

by Prat617
1 stars

This strategy identifies an Opening Range based on user-defined Eastern Time session parameters and waits for a breakout. Rather than chasing the initial move, it enters positions when price pulls back to retest the Opening Range boundary with volume and EMA t

Strategy v6 BreakoutMoving averages
Updated 7 months ago · MIT GitHub repository of ORB Pullback
1 stars

This strategy builds the high and low of a configurable Asian session and locks that range when the session ends. During the London window it enters long when price closes above the range high plus a pip buffer, or short when it closes below the range low minu

Strategy v5 BreakoutSessions & time Repaints
Updated 8 months ago · None stated GitHub repository of London Breakout - Session Strategy

This Pine Script is a strategy that performs tactical dollar cost averaging with periodic cash top-ups. It accumulates a fixed cash amount each bar and deploys the full pile at a bullish crossover above a simple moving average, provided the date is within the

Strategy v6 TrendMoving averages
Updated 9 months ago · None stated GitHub repository of Tactical DCA with Cash Top-up (Date Filter)

Supertrend 18/4.3

by trustdan
1 stars

A long-only strategy generated from the TrendLab research project, drawn on the price chart. It uses the built-in Supertrend with an ATR period of 18 and a multiplier of 4.3. It buys when the Supertrend turns to an uptrend and closes the position when it turns

Strategy v6 TrendVolatility & bands
Updated 9 months ago · MIT GitHub repository of Supertrend 18/4.3

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