Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 17)

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

BodyOutlier A003

by ruckard
13 stars

BodyOutlier A003 is a mean-reversion trading strategy designed for automated execution via Zignaly alerts. It identifies candlestick body outliers to place limit orders, buying at the low of unusually large bullish candles or selling at the high of large beari

Strategy v5 Candlestick patternsMean reversion
Updated 1 year ago · None stated GitHub repository of BodyOutlier A003
12 stars

Identifies three-candle Fair Value Gaps (FVG) and trades their initial retests in the direction of an exponential moving average trend filter. Long positions trigger when price enters a recent bullish imbalance from above while trading above the EMA; short pos

Strategy v5 SMC / ICT / price actionTrend
Updated 4 months ago · None stated GitHub repository of BTC FVG Retest Strategy

Fibonacci strategy

by JoelPasapera
11 stars

This strategy plots a Fibonacci retracement of the previous day's high-low range on the price chart. It places a single long limit order at that level when the bar hour matches the chosen entry hour and the close is below the level. Position size follows the l

Strategy v6 Support & resistanceSessions & time
Updated 5 months ago · Apache-2.0 GitHub repository of Fibonacci strategy

Chaikin Oscillator - Eterna MCP

by EternaHybridExchange
9 stars

This strategy calculates the Chaikin Oscillator by taking the difference between fast and slow exponential moving averages of the Accumulation/Distribution line. It generates long and short entries when the oscillator crosses the signal threshold with directio

Strategy v5 Oscillators & momentumVolume
Updated 7 months ago · MIT GitHub repository of Chaikin Oscillator - Eterna MCP
8 stars

This strategy calculates dual Average True Range (ATR) trailing stops using two distinct multiplier levels alongside an optional Hull Moving Average (HMA) channel. It identifies market structure shifts and triggers positions when price crosses the primary ATR

Strategy v5 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of ATR 2STP Strategy

EQH/EQL Sweep

by muammeryldrm42
7 stars

This strategy detects equal highs and equal lows from swing pivots when two pivots sit within an ATR tolerance. A long entry follows a wick below an equal low that closes back above it on a bullish bar; a short entry follows a wick above an equal high that clo

Strategy v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · MIT GitHub repository of EQH/EQL Sweep

Enhanced DCA Strategy

by SynergOps
7 stars

The Enhanced DCA Strategy invests a fixed dollar amount at regular intervals (daily, weekly or monthly) into the asset after start date, deducting trading fees and tracking total invested, units acquired, current value, profit, ROI, Sharpe ratio, Sortino ratio

Strategy v6 ScalpingMean reversion Repaints
Updated 1 year ago · MPL-2.0 GitHub repository of Enhanced DCA Strategy

This strategy calculates trade signals by evaluating a daily session Volume Weighted Average Price relative to 90-period Exponential Moving Averages requested from 1-day and 4-hour higher timeframes. Long and short entries occur when VWAP crosses over or under

Strategy v5 Moving averagesTrend Repaints
Updated 3 years ago · MIT GitHub repository of 1D Bullish Buy 4H Bearish Sell Session EMA

Numeric Input Metadata

by pineforge-4pass
6 stars

Demonstrates and tests Pine Script input metadata handling across numeric and other input types. It defines inputs using dropdown options, constant defaults, signed values, range bounds, timestamps, expressions, and colors, then plots the closing price in a se

Strategy v6
Updated 2 days ago · Custom licence GitHub repository of Numeric Input Metadata
6 stars

This strategy combines higher-timeframe market bias filtering with an oscillator and ADX trend detection to generate trading signals. It calculates market bias using Heikin-Ashi values across custom timeframes and filters entries using dynamic or static ADX th

Strategy v6 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of EURUSD Synergy + PropEA Hedge
6 stars

This strategy identifies high-volatility expansion bars by comparing the high-low range to a moving average plus standard deviation threshold. When range expansion occurs, it checks momentum over a specified lookback period. It opens a long position if the cur

Strategy v5 Volatility & bandsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of TradersPost High-Low Range Strategy

SMA Crossover

by broomva
5 stars

This strategy implements a classic trend-following moving average crossover system on the price chart. It calculates a fast simple moving average (default 50) and a slow SMA (default 200). It enters long when the fast SMA crosses above the slow SMA and enters

Strategy v5 TrendMoving averages
Updated 2 days ago · MIT GitHub repository of SMA Crossover
5 stars

Xsodus RSI Strategy is a long-only trading script that generates entry signals when the Relative Strength Index (RSI) crosses above a configurable oversold threshold. Traders can enable an optional trend filter requiring price to remain above an Exponential Mo

Strategy v5 Oscillators & momentumMoving averages
Updated 2 weeks ago · MIT GitHub repository of Xsodus RSI Strategy
5 stars

This strategy enters long positions when price tests and bounces off the prior week's low level within an allowed point tolerance during designated UTC trading hours. It requires the bar low to approach the prior week low and the close to rebound above it whil

Strategy v5 Support & resistanceMean reversion
Updated 5 months ago · MIT GitHub repository of WKL — Prior Week Level Retest (Bull)

SMA Crossover

by durdenbtc
5 stars

This strategy plots a 14-period and a 28-period simple moving average on the price chart. It opens a long position when the fast average crosses above the slow average and closes that long when the fast average crosses back below. Position size defaults to 100

Strategy v6 TrendMoving averages Repaints
Updated 5 months ago · MIT GitHub repository of SMA Crossover
5 stars

This strategy calculates three Supertrend directions from short, medium, and long ATR periods and multipliers on a chosen source. It enters long when all three trends are bullish and the position is flat, and enters short when none is bullish and the position

Strategy v4 TrendVolatility & bands
Updated 5 years ago · MIT GitHub repository of Triple Supertrend Strategy

This strategy calculates and plots up to four Simple Moving Averages (SMAs) and four Exponential Moving Averages (EMAs) directly on the price chart. It generates trading signals based on price crossing over or under a selected baseline moving average, which ca

Strategy v4 TrendMoving averages
Updated 6 years ago · LGPL-3.0 GitHub repository of 4 SMA + 4 EMA + Buy&Sell Cross (EMA or SMA) Strategy [d3nv3r]

MA Crossover

by latentwill
4 stars

This overlay strategy calculates a fast and a slow simple moving average of close and trades their crossovers. A cross of the fast average above the slow average opens a long; a cross below opens a short. Position size is fixed at one unit. After each entry it

Strategy v5 TrendMoving averages
Updated 8 days ago · None stated GitHub repository of MA Crossover

BB Breakout [trugurpala]

by trugurpala
4 stars

This strategy executes trades based on Bollinger Band breakouts and ATR-based dynamic risk management. It opens a long position when price crosses above the upper Bollinger Band and a short position when price crosses below the lower band, provided no position

Strategy v6 Volatility & bandsBreakout
Updated 2 months ago · MIT GitHub repository of BB Breakout [trugurpala]

Institutional HFT Engine - QuantAlgo

by thesenegalesehitch
4 stars

This strategy evaluates trading opportunities using a probabilistic scoring model combined with Smart Money Concepts (SMC) pattern detection, including Break of Structure (BOS), Fair Value Gaps (FVG), and Order Blocks. It overlays signals directly on the price

Strategy v6 SMC / ICT / price actionSessions & time
Updated 4 months ago · Custom licence GitHub repository of Institutional HFT Engine - QuantAlgo
4 stars

Momentum Rotation (Top 3) ranks ten large-cap US tech stocks by their six-month returns using daily closes. It rebalances monthly and holds the top three performing stocks long only on the price chart. A ranking table shows the current order. Main settings adj

Strategy v6 Oscillators & momentumTrend
Updated 5 months ago · None stated GitHub repository of Momentum Rotation (Top 3)

RSI Mean Reversion

by LePotoRico2105
4 stars

This strategy executes mean-reversion trades when the Relative Strength Index rebounds from overbought or oversold zones in the direction of a higher-period trend EMA. It calculates indicators using confirmed bar closes to prevent live-bar recalculation. Entri

Strategy v5 Mean reversionOscillators & momentum
Updated 7 months ago · MIT GitHub repository of RSI Mean Reversion
4 stars

This strategy plots a 10-period and a 30-period simple moving average on the price chart. It opens a long position when the faster average crosses above the slower one and closes that long when the faster average crosses back below. Green and red markers and p

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Simple Auto Buy/Sell Strategy

Improvisando [Alorse]

by Hugs-4-Bugs
4 stars

This strategy combines candlestick price action with Exponential Moving Average, RSI, and MACD filters to identify short-term trend trades. A long signal occurs when a bullish candle engulfs the previous open while price remains above the EMA, RSI stays below

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Improvisando [Alorse]
4 stars

The script is a Pine Script v4 strategy that generates buy and sell signals from crossovers of fast EMA (period 5) and slow EMA (period 10). It overlays signals directly on the price chart for cryptocurrency trading. Additional filters check for hammer candles

Strategy v4 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of EMA Cross Crypto Strategy

Dead Cross Over

by might-tree
4 stars

Dead Cross Over is a trend-following strategy that calculates a 10-period fast EMA and a 100-period slow EMA directly on the price chart. It enters a long position when the fast EMA crosses above the slow EMA while price sits above the slow EMA. The position i

Strategy v5 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of Dead Cross Over
4 stars

This strategy enters long or short when a moving average of open prices crosses a moving average of close prices. It plots those averages and optional trend-coloured bars on the price chart. Settings choose the average type and length, an alternate-resolution

Strategy v4 TrendMoving averages Repaints
Updated 5 years ago · None stated GitHub repository of Open Close Cross Strategy R5.1

Strategy Template

by AlnurM
3 stars

This Pine Script v5 file is an overlay strategy skeleton rather than a finished trading system. It sets initial capital, percent-of-equity order size, and a percent commission, then leaves placeholders for inputs, indicator calculations, entry and exit conditi

Strategy v5
Updated 7 months ago · MIT GitHub repository of Strategy Template
3 stars

Sapphire Fibonacci Strategies is a multi-mode strategy that combines Momentum Breakout, Mean Reversion, and Fibonacci Retracement models built on Fibonacci-period moving averages. It generates long and short trade signals based on price crossovers and moving a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Sapphire Fibonacci Strategies
3 stars

This strategy implements a trend-following system based on Donchian breakout channels and volatility-adjusted position sizing. It generates long entry signals when the close price breaks above the multi-bar highest high, provided an optional benchmark trend fi

Strategy v5 TrendBreakout
Updated 2 years ago · MIT GitHub repository of Turtle Trend Follow Strategy

Scalp Agiota - By H7

by leocairos
3 stars

The Scalp Agiota strategy calculates RSI and MFI values to identify overbought and oversold conditions for cryptocurrency scalping trades. It plots upward triangles on the price chart below the bar when RSI drops to 20 or lower and MFI to 10 or lower, signalin

Strategy v5 Oscillators & momentumScalping Repaints
Updated 2 years ago · MIT GitHub repository of Scalp Agiota - By H7

MA & DMI

by maxits
3 stars

MA & DMI is a strategy that combines moving average crossovers with Directional Movement Index filters to identify trade setups. It calculates a slow SMA, a medium EMA, and a fast EMA alongside ADX and DI values. Trade risk management uses an ATR-based multipl

Strategy v4 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of MA & DMI
3 stars

Plots Donchian Channels and identifies trading setups based on price testing the channel extremes during high volume spikes. In long mode, it places limit buy orders when the low touches the lower Donchian band with volume exceeding a volume moving average mul

Strategy v4 Mean reversionVolatility & bands
Updated 4 years ago · CC0-1.0 GitHub repository of Greeffer's Long Strategy

QQQ 5min Pure Runner

by yalili8521
2 stars

This strategy identifies trend continuation and accumulation setups on 5-minute charts. It enters long or short positions based on an aligned moving average stack, rising or falling price grinds within a lookback period, and a maximum bar size threshold to avo

Strategy v6 TrendMoving averages
Updated 9 days ago · None stated GitHub repository of QQQ 5min Pure Runner

This strategy identifies trend pullback entries using MACD signal line crossovers plotted in a separate indicator pane. Long trades enter on bullish MACD crossovers below the zero line when price is above a trend EMA and ADX exceeds a minimum threshold, with r

Strategy v6 TrendOscillators & momentum
Updated 2 weeks ago · MIT GitHub repository of MACD Pullback Sniper | Trend + ADX Filtered Strategy
2 stars

This strategy fades liquidity sweeps of confirmed swing highs and lows. It enters a reversal only after price sweeps a prior swing and closes back inside the range. The stop sits an ATR multiple beyond the sweep wick, the target is a fixed reward-to-risk multi

Strategy v6 SMC / ICT / price actionMean reversion
Updated 2 months ago · Custom licence GitHub repository of Liquidity Sweep Reversal [Vantrade]

Alertatron-Link Demabot 2H

by danielvm-git
2 stars

This strategy calculates up to three Double Exponential Moving Averages (DEMA) to generate trading signals based on moving average crossovers and crossunders. When configured, an optional third DEMA acts as a directional trend filter. It opens positions upon c

Strategy v4 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Alertatron-Link Demabot 2H

Alpy Vix

by avatar-lavventura
2 stars

This strategy plots a Williams Vix Fix, a WaveTrend oscillator, and a short rolling volume-weighted price filter in a separate pane. It measures how far the low sits below the highest close, then draws a moving average, standard-deviation bands, and a percenti

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

Momentum Breakout Strategy

by adminalphabots
2 stars

This strategy plots on the price chart and enters when price closes beyond the prior lookback high or low and also beyond a shorter confirmation range. Long, short, or both directions can be enabled. Optional filters require volume above a volume average or a

Strategy v5 BreakoutVolatility & bands
Updated 8 months ago · MIT GitHub repository of Momentum Breakout Strategy

ORB Hunter

by nxtaiapp
2 stars

ORB Hunter is an Opening Range Breakout strategy that identifies price breakouts beyond a defined opening session window (such as 09:30 to 09:45 EST). It places long or short trades when price crosses the opening range bounds with buffer, confirmed by optional

Strategy v5 BreakoutSessions & time
Updated 11 months ago · MIT GitHub repository of ORB Hunter

BBW

by wynnforthework
2 stars

This strategy combines Bollinger Band Width volatility ratio calculations with a Coppock Curve momentum indicator. It calculates the ratio of standard deviation to EMA over a user-defined length, along with an EMA of that ratio. Long positions are entered when

Strategy v5 Volatility & bandsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of BBW

Bollinger Bands

by Web3Degenerate
2 stars

This Pine Script converts a Bollinger Band Breakout indicator into a strategy. It plots Bollinger Bands on the price chart using a 100-period SMA as the middle band with upper deviation of 3 and lower deviation of 1. Signals trigger on price crossing the bands

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

SassizStocEMA-Lazy Bear

by sassiz-root
2 stars

SassizStocEMA-Lazy Bear is a Pine Script strategy that plots on the price chart and combines a stochastic oscillator with near and far exponential moving averages. It is aimed at crypto markets. Long and short directions can be enabled separately, and crosses

Strategy v5 Oscillators & momentumMoving averages
Updated 3 years ago · MIT GitHub repository of SassizStocEMA-Lazy Bear

Impulse-Orders

by DaniilOkrug
2 stars

The Impulse-Orders strategy detects impulse up and down movements on the price chart by checking for specific candle patterns relative to Fibonacci retracement levels. It tracks impulse starts and ends, confirming when the move reaches a user-defined percentag

Strategy v5 Candlestick patternsSupport & resistance
Updated 4 years ago · MIT GitHub repository of Impulse-Orders

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