Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 21)

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

This strategy executes trades based on VuManChu-inspired WaveTrend signals combined with a 200 EMA trend filter and multi-timeframe confirmation from H1 and H4 charts. Entries are evaluated using WaveTrend oversold conditions, RSI, MFI, and an optional ADX fil

Strategy v6 Oscillators & momentumTrend
Updated 10 months ago · None stated GitHub repository of VMC Strat M15 Ultimate (ADX + Div)
1 stars

A strategy built around the first regular-session candle of the US day in New York time, together with rejection levels collected from wicks formed during pre-market and after-hours sessions. Rejection levels within a tolerance percentage are grouped. Options

Strategy v5 BreakoutSessions & time
Updated 11 months ago · Custom licence GitHub repository of Breakout Strategy - Step by Step
1 stars

The Heikin Ashi Trend Follow Strategy calculates smoothed Heikin Ashi candle values from open, high, low and close prices and plots them on the price chart along with a trend EMA. It signals long entries when the Heikin Ashi close crosses above the trend EMA a

Strategy v5 TrendCandlestick patterns
Updated 11 months ago · None stated GitHub repository of Heikin Ashi Trend Follow Strategy
1 stars

This strategy looks for pullbacks to a 15-period EMA. A long needs price to touch or dip under the EMA, close back above it on a sufficiently large green candle, with the EMA above a 100-period EMA and a minimum pullback percentage. Shorts mirror this. Optiona

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of NakInvest EMA Pullback Strategy

Lab-Doi-03

by theteelek
1 stars

Lab-Doi-03 is a price-chart strategy that compares a 12-period and a 26-period exponential moving average requested from the daily timeframe. While the chart time is inside the start and end dates and the fast average is above the slow average, it records an i

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Lab-Doi-03

MACD Crossover

by Studentcodee
1 stars

This strategy executes automated trades based on the interaction between the MACD line and its signal line. It calculates the difference between two exponential moving averages and a signal line to monitor momentum shifts. The strategy enters a long position w

Strategy v6 Oscillators & momentumTrend
Updated 1 year ago · None stated GitHub repository of MACD Crossover
1 stars

A long-only strategy that enters when a fast simple moving average crosses a slow one, using the cross function so either direction of crossing can trigger the entry. This version uses shorter default lengths than its sibling script. Each open position gets a

Strategy v6 Moving averages
Updated 1 year ago · None stated GitHub repository of Profit and Stop Loss Strategy

SOLETH MTPI

by Mikelkulla
1 stars

This strategy detects relative performance between Solana and Ethereum using a liquidity-weighted supertrend (LWST) derived from fast and slow weighted moving averages of liquidity times close. It plots the Tsl2 trend line in a separate pane and issues buy sig

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of SOLETH MTPI
1 stars

This strategy uses 10, 50, and 200 period EMAs on the price chart to filter for bullish and bearish trend signals with a confirmation candle. It calculates position size based on a user-set risk percentage of equity divided by the distance to a stop price deri

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Reg T Margin Stock Strategy

MACD Strategy

by pcjtse
1 stars

This strategy trades MACD line crossovers: it enters long when the MACD line crosses above the signal line and short when it crosses below. Each entry has an ATR-based stop loss and take profit set by separate multipliers. Fast, slow and signal lengths are adj

Strategy v5 Oscillators & momentum
Updated 1 year ago · None stated GitHub repository of MACD Strategy

Candle Strategy

by zhuzp98
1 stars

This Pine Script strategy identifies candlestick patterns such as engulfing, doji, hammer and star formations on the price chart. It applies SMA trend filters with fast and slow periods to confirm direction before plotting labels for bullish and bearish signal

Strategy v5 Candlestick patternsMoving averages
Updated 1 year ago · None stated GitHub repository of Candle Strategy

algo-trade-indian

by akash-yellgetti
1 stars

A strategy-type script for the price chart that marks the high, low and midpoint of the first part of each session, set by start hour and minute inputs, with alerts for price crossing above the high or below the low. It also plots VWAP, pivot-based support and

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

Tweezer Lyfe

by RobACurtis
1 stars

Tweezer Lyfe is a TradingView strategy that identifies Tweezer reversal patterns on the price chart. It plots Bollinger Bands with RSI and stochastic indicators for momentum confirmation. Bullish signals require a prior bearish candle closing near the lower ba

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Tweezer Lyfe
1 stars

This strategy calculates the Supertrend using ATR period and factor inputs, then plots green lines for up direction and red lines for down direction on the price chart. It signals long entries when Supertrend changes to positive and short entries when changing

Strategy v5 TrendMoving averages
Updated 2 years ago · MPL-2.0 GitHub repository of Hello World, Supertrend
1 stars

This long-only strategy buys when a short 3-period RSI crosses back above an oversold level of 35, provided the 14-period RSI is above 40 and price is above a 150-period EMA. It closes the position when price crosses under a 9-period EMA or falls below an 89-p

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of RSI 14 and 3 Mean Reversion Strategy

Min-Max Strategy

by creatidy
1 stars

A strategy that trades breakouts of a rolling high and low channel, filtered by a long moving average adjusted for relative strength. Stop orders are placed at the upper channel for longs when the channel low is above the adjusted level, and at the lower chann

Strategy v4 BreakoutTrend
Updated 3 years ago · GPL-3.0 GitHub repository of Min-Max Strategy
1 stars

A strategy framework that provides switches for ATR bands, a trading session, a trend filter, three moving averages and take profit and stop loss levels. It has a session and weekday filter, backtest start and stop dates, and a long, short or both setting. Tak

Strategy v5 Sessions & timeVolatility & bands Repaints
Updated 4 years ago · None stated GitHub repository of Hotch Break Strat (Template)
330 stars

This strategy divides a fixed price range between an upper and a lower limit into equally spaced grid levels and plots them on the price chart. It marks a buy when price crosses down through a grid and a sell when price crosses up through a grid, using either

Strategy v5 Support & resistanceMean reversion Repaints
Updated 2 months ago · None stated GitHub repository of Grid Bot Simulator [Alorse]
257 stars

This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry

Strategy v6 Volatility & bandsSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of V1.6 ES - Futures 1M No Repaint

TradersPost Trade Replay

by TradersPost
228 stars

This strategy replays trades exported from TradersPost on the price chart by executing entries and exits at exact timestamps and prices from trade history. It uses fixed position sizing of 1 with initial capital 10000 and commission 0.62. The script draws no e

Strategy v6 Repaints
Updated 3 months ago · None stated GitHub repository of TradersPost Trade Replay

3C QFL Mean Reversal

by hasnocool
106 stars

3C QFL Mean Reversal is a strategy based on the Quickfinger Luc (QFL) trading methodology. It identifies breakdown buying opportunities below established price base levels and enters mean-reversion trades. The strategy includes multi-safety order DCA scaling,

Strategy v5 Mean reversionSupport & resistance Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3C QFL Mean Reversal

This strategy combines Linear Regression Candles with UT Bot trailing stop signals to generate trading setups. It calculates smoothed linear regression open, high, low, and close values alongside a signal line, while computing an ATR-based trailing stop. Long

Strategy v5 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Linear Regression Candles and UT Bot Strategy

BTC True Scalp

by iamrichardD
57 stars

This strategy runs an ultra-fast MACD in a separate pane to capture short-term momentum scalps. It filters trade entries using micro-trend direction, volume spikes, and candle body strength within specified session hours. Positions default to two percent of eq

Strategy v6 Oscillators & momentumScalping Repaints
Updated 1 year ago · Apache-2.0 GitHub repository of BTC True Scalp

This trend breakout strategy plots Donchian Channels consisting of upper, lower, and middle bands directly on the main price chart. Long positions enter when price touches the upper channel and pulls back to or below the middle band, placing a stop loss at the

Strategy v6 TrendBreakout
Updated 2 months ago · MPL-2.0 GitHub repository of Donchian Strategy - Dynamic TP, Fixed SL, 1% Risk, Daily Target

This strategy overlays the ETHUSDT perpetual price chart and is labeled for the five-minute timeframe. It calculates a smoothed stochastic oscillator from the open, high, and low, with adjustable K, D, and smoothing lengths plus overbought and oversold levels.

Strategy v5 Oscillators & momentumTrend Repaints
Updated 2 years ago · None stated GitHub repository of ETHUSDTPERP-5M - No repaint 2023

Turtle MACD Time-Zone Filter

by skywalker0803r
42 stars

This strategy enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take

Strategy v5 BreakoutOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Turtle MACD Time-Zone Filter

Strategy Trades

by ferranbt
21 stars

Strategy Trades is a benchmark strategy script designed to test trade execution and account metric updates across continuous bars. It initiates a fixed-size long position on every even bar index and closes the position on the subsequent odd bar. In a separate

Strategy v6
Updated 7 weeks ago · MPL-2.0 GitHub repository of Strategy Trades

Greeffer BB Strategy

by SammyEnigma
18 stars

Greeffer BB Strategy is a volatility-based mean reversion system that calculates Bollinger Bands using price and standard deviation. It generates long and short signals when price crosses the upper and lower bands respectively. Entries are filtered with RSI(14

Strategy v4 Volatility & bandsOscillators & momentum Repaints
Updated 6 years ago · None stated GitHub repository of Greeffer BB Strategy
16 stars

This Pine Script implements a trend-following strategy inspired by John Seykota's methods. It enters positions on Donchian channel breakouts using a longer lookback period of 55 bars and exits on shorter 10-bar signals. Volatility gating prevents adding to pos

Strategy v6 TrendMoving averages
Updated 12 months ago · None stated GitHub repository of Seykota Alt 13: Vol-Gated Adds

Crossing EMAs B

by ruckard
13 stars

Crossing EMAs B is a moving average crossover strategy designed as an example for Zignaly bot signal integration. It monitors a 14-period and a 28-period simple moving average on close prices, entering long when the short average crosses above the long average

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Crossing EMAs B

Lazarus3 Backtest

by ysdede
12 stars

This strategy executes a fixed sequence of buy and sell orders on the BTC-USD pair at predetermined timestamps on the 2-hour chart. It uses an initial capital of 10000 with 0.2 percent commission to calculate position sizes. Orders are placed with specific qua

Strategy v4 ScalpingSessions & time
Updated 5 years ago · None stated GitHub repository of Lazarus3 Backtest

NFI v7.2.1

by koradiyakaushal
12 stars

This strategy is a Pine Script implementation of the NostalgiaForInfinity crypto strategy. It calculates indicator metrics across multiple timeframes and compares price action against a master pair such as BTC/USDT. Settings allow traders to configure informat

Strategy v4 TrendMoving averages
Updated 5 years ago · MIT GitHub repository of NFI v7.2.1

Swing Strategy

by JoelPasapera
11 stars

This strategy executes trades based on specific days of the week. It opens a long position when the current day matches the primary day input and closes the position whenever the chart moves to a day other than the secondary day input. Settings allow traders t

Strategy v6 Sessions & time
Updated 5 months ago · Apache-2.0 GitHub repository of Swing Strategy

Dual Moving Average

by hirawatt
11 stars

The Dual Moving Average strategy calculates fast and slow exponential moving averages based on HLC3 prices. It generates long signals when the fast EMA crosses above the slow EMA and short signals when it crosses below. Position sizing can be calculated dynami

Strategy v4 Moving averagesTrend Repaints
Updated 2 years ago · MIT GitHub repository of Dual Moving Average

This strategy plots a fast and a slow moving average on the price chart and enters when their relationship flips, subject to an optional ADX filter. It goes long when the fast average is above the slow average and short when it is below, reversing an existing

Strategy v6 TrendMoving averages
Updated 4 months ago · MIT GitHub repository of Crossing Moving Averages with ADX Filter

Donchian Channel Breakout - Eterna

by EternaHybridExchange
9 stars

This strategy plots Donchian Channel bands, a middle line, and breakout signals directly on the price chart. It opens long positions when price breaks above the upper band and short positions when price breaks below the lower band, evaluated after confirmation

Strategy v5 TrendBreakout
Updated 7 months ago · MIT GitHub repository of Donchian Channel Breakout - Eterna

Trailing Stop Loss to Long and Short is a Pine Script strategy designed to manage trade exits using a percentage-based trailing stop loss for long or short positions. The strategy sets an initial stop loss percentage relative to the entry price and systematica

Strategy v4 Support & resistance
Updated 7 years ago · MIT GitHub repository of Trailing Stop Loss to Long and Short

Ichimoku Breakout

by muammeryldrm42
7 stars

This strategy executes trades based on Ichimoku Kinko Hyo breakouts combined with Tenkan-sen and Kijun-sen crosses. A long position triggers when price closes above the cloud top while the Tenkan-sen crosses above the Kijun-sen within a bullish cloud. A short

Strategy v5 TrendBreakout
Updated 3 months ago · MIT GitHub repository of Ichimoku Breakout
7 stars

This strategy plots a customizable Bollinger Band basis using selectable moving average types such as HMA, SMA, EMA, or others. It draws the basis line, multiple standard deviation levels, and fills the region between L1 and L6 on the price chart. Buy signals

Strategy v5 Volatility & bandsMoving averages
Updated 4 months ago · None stated GitHub repository of Bollinger Bands Strategy

This strategy plots a 90-period exponential moving average from the weekly and daily charts plus a daily session VWAP on the price chart. It enters long when the weekly VWAP is above the weekly average and the daily VWAP crosses above the daily average, and en

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 1W Bullish Buy 1D Bearish Sell Session EMA

Edge 71

by subos2008
6 stars

This strategy plots prior high and low breakout levels on the price chart and trades a long breakout. It goes long when the bar high exceeds the previous bar's highest high over a user-set lookback, and it closes that long when the bar low breaks the previous

Strategy v5 BreakoutSupport & resistance Repaints
Updated 2 years ago · Custom licence GitHub repository of Edge 71

Cerebr Centauri Strategy

by jerryinyang
5 stars

Cerebr Centauri Strategy is a multi-indicator trading system for Pine Script v4 that combines Moving Averages (SMA, EMA, LSMA, WMA), Stochastic Oscillator, RSI, and MACD across both current and higher timeframes. It evaluates trend conditions and oscillator st

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Cerebr Centauri Strategy

This short-only trading strategy combines 20 and 50 period Exponential Moving Averages with a pivot low breakout filter. A short entry triggers when the 50 EMA is above the 20 EMA, recent candle closes remain below the 50 EMA while reaching above the 20 EMA, a

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of 20 EMA + 50 EMA + Breakout Short Strategy (5M)
4 stars

This strategy is a multi-strategy backtesting engine that draws entries and exits on the price chart. The user picks one approach, including Connors RSI-2, z-score mean reversion, EMA and MACD momentum, Bollinger squeeze, VWAP reversion, Supertrend, Ichimoku,

Strategy v6 Oscillators & momentumMean reversion Repaints
Updated 2 days ago · None stated GitHub repository of Simpleton v0.01 CURSOR [Elton Engine]

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