Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 44)

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

Knn Filter A007

by ruckard
13 stars

Knn Filter A007 is a strategy that applies a K-Nearest Neighbors classification algorithm to evaluate historical feature performance and filter out low-probability trade setups. It executes long and short entries based on learned historical patterns. Risk mana

Strategy v5 AI / machine learningVolatility & bands
Updated 1 year ago · None stated GitHub repository of Knn Filter A007

This overlay strategy enters long when regular or hidden bullish RSI divergence forms between price lows and RSI pivot lows. A regular signal needs a lower price low with a higher RSI low, and a hidden signal needs a higher price low with a lower RSI low, both

Strategy v4 Oscillators & momentumDivergence
Updated 3 years ago · Apache-2.0 GitHub repository of RSI Divergence Long Strategy (Not Good)

Q-Trend Strategy

by wynnforthework
2 stars

Q-Trend Strategy builds a midpoint from the highest and lowest source values over a trend period and shifts it by an ATR band. It enters long when the source crosses or remains above the upper band and short when it crosses or remains below the lower band. Typ

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

FTB Strategy

by Web3Degenerate
2 stars

The FTB Strategy is a short-only overlay strategy targeting EURUSD during the European session from 0200-0700. It enters short positions when filters confirm RSI overbought, a bullish prior bar close, or a high price level within lookback bars, combined with a

Strategy v5 Mean reversionSessions & time
Updated 2 years ago · None stated GitHub repository of FTB Strategy
1 stars

This strategy plots market structure on the price chart from confirmed swing highs and lows and flags breaks of those levels. Breaks can use the wick or the close, and structure logic can stay standard or include sweeps. ChoCH mode selects Ping, Verify, or bot

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 4 days ago · None stated GitHub repository of CHOCH-Strategy (Structure Only)

MTF Array Stats

by pineforge-4pass
1 stars

MTF Array Stats is a multi-timeframe strategy created as an engine validation probe. It collects daily close prices into a rolling 20-element array buffer. Using array functions, it calculates the median and percentile rank of the latest daily close relative t

Strategy v6 Oscillators & momentum
Updated 7 days ago · Apache-2.0 GitHub repository of MTF Array Stats
1 stars

A strategy for gold futures based on the initial balance, the high and low of a set New York time window that starts at 9:30 and ends at 10:30 by default. Ranges outside a minimum and maximum percent of price are skipped. After price breaks the range, it waits

Strategy v6 BreakoutSessions & time
Updated 2 months ago · None stated GitHub repository of TN Gold IB Retracement
1 stars

A strategy that trades breaks of swing points. It detects pivot highs and pivot lows using left and right bar counts, then places a long stop order one tick above the latest pivot high and a short stop order one tick below the latest pivot low. A pending order

Strategy v6 BreakoutSupport & resistance
Updated 1 year ago · None stated GitHub repository of Pivot Reversal Strategy
1 stars

A long-only Pine v4 strategy built on a 12/26 MACD with a nine-period signal line. It enters on a green candle when the MACD has risen for three consecutive bars while still below zero and above its signal line. It closes when the opposite falling-MACD conditi

Strategy v4 Oscillators & momentum Repaints
Updated 4 years ago · None stated GitHub repository of RPLWETH Uniswap MACD Strategy
330 stars

Heikin Ashi Strategy V2 [Alorse] is a trend-following strategy that generates trading signals using multi-timeframe Heikin Ashi moving average crossovers. It calculates a fast and slow exponential moving average from higher-timeframe Heikin Ashi close data and

Strategy v4 TrendMoving averages Repaints
Updated 2 months ago · None stated GitHub repository of Heikin Ashi Strategy V2 [Alorse]
106 stars

Calculates up to four customizable Supertrend indicators using Average True Range (ATR) and user-selected price sources. It generates long and short trade signals when designated Supertrend instances switch direction, provided other configured Supertrend trend

Strategy v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR GOD Strategy by TradeSmart
16 stars

This strategy implements a trend-following Donchian channel breakout system with momentum-based position sizing. It enters an initial scaled position on a channel breakout to minimize false breakout risk, then adds to the position if RSI confirms directional s

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

Lastguru KNN A002

by ruckard
13 stars

This strategy applies k-nearest neighbors machine learning to fast and slow moving average crossovers to filter entry signals. It overlays directly on the price chart and incorporates built-in Zignaly alert triggers for automated execution. Traders can configu

Strategy v5 AI / machine learningMoving averages
Updated 1 year ago · None stated GitHub repository of Lastguru KNN A002

This strategy evaluates the dynamic relationship between price and a chosen moving average across six diagnostic dimensions: trend, respect, extension, compression, acceleration, and exhaustion. It plots a normalized relationship oscillator bounded between -10

Strategy v6 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Market–Average Relationship Engine [WavesUnchained]

Strategy Long Template

by krosenfeld7
5 stars

This long-only strategy template provides boilerplate logic for building custom Pine Script trading systems on the price chart. It features built-in risk management that calculates target exits and stop-loss levels using either percentage-based distances or Av

Strategy v4 Volatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of Strategy Long Template
4 stars

This strategy executes trades based on Stochastic Oscillator crossovers combined with a trend filter and ATR-based risk management. It calculates smoothed %K and %D lines alongside an Exponential Moving Average (EMA). A long signal triggers when %K crosses abo

Strategy v6 Oscillators & momentumTrend
Updated 2 months ago · MIT GitHub repository of Stoch Strategy [trugurpala]
3 stars

Calculates buy and sell volume pressure alongside the Awesome Oscillator to scan for market divergence opportunities. It initiates long and short strategy entries when divergence signals meet conditions, optionally filtered by New York trading session hours an

Strategy v5 DivergenceVolume
Updated 5 months ago · None stated GitHub repository of Divergence Scanner

Q-Trend Strategy

by wynnforthework
2 stars

The Q-Trend Strategy is a trend-following overlay strategy that identifies directional bias using dynamic price channels combined with an ATR volatility buffer. It calculates highest highs and lowest lows over a chosen trend period to establish a baseline midp

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Q-Trend Strategy
1 stars

This long-only strategy identifies trend-following entries using moving average crossovers filtered by higher-timeframe trend alignment. It plots directly on the main price chart. Entries trigger when a fast exponential moving average crosses above a slow movi

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of MTF probe 10 - HTF bracket static

TN HFT Engine

by raybird
1 stars

A smart money style strategy that scores setups from 0 to 100 using market structure, momentum, range context and liquidity sweeps, with fair value gaps and order blocks drawn on the price chart. Trades need a minimum score, optional higher-timeframe agreement

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN HFT Engine

RSI Please!

by tseitz
1 stars

A Pine v4 strategy that plots a 66-period weighted moving average and combines a 12/26 MACD, a 14-period RSI, candle sizes and rolling highs and lows over a long lookback. Inputs set take-profit and stop-loss percentages for each side, the long lookback and th

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 4 years ago · None stated GitHub repository of RSI Please!
330 stars

This momentum strategy combines the Moving Average Convergence Divergence and Directional Movement Index indicators to generate long trading signals. It enters a long position when the MACD line crosses above its signal line while positive directional movement

Strategy v4 Oscillators & momentumTrend
Updated 2 months ago · None stated GitHub repository of MACD + DMI [Alorse]

ATR Mean Reversion

by hasnocool
106 stars

This strategy identifies mean reversion opportunities using ATR bands on the price chart. It enters long positions when price touches the lower band (open minus ATR) with no open position and within the set time filter. Positions exit on the upper band breach,

Strategy v5 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR Mean Reversion
16 stars

This strategy trades an asymmetric long and short trend system on the price chart. Longs use shorter Donchian entry and exit lengths, tighter ATR stops, more pyramid units, and a higher risk percent per unit than shorts. Each unit is sized from equity and stop

Strategy v6 TrendVolatility & bands
Updated 12 months ago · None stated GitHub repository of Seykota Alt 4: Asymmetric L/S
13 stars

This strategy uses the Noro Trend Ribbon to determine trend direction and open long or short positions. It defines a corridor from recent high and low prices and enters positions when price crosses the corridor boundaries, sized as a percentage of capital. Fas

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of R010 R Noro Trend Ribbon

Strategy Short Template

by krosenfeld7
5 stars

Strategy Short Template provides a base structure for backtesting short-only trading strategies. It includes modular risk management with take profit and stop loss levels calculated using fixed percentages or Average True Range (ATR) multipliers. Users can sel

Strategy v4 Volatility & bands
Updated 3 years ago · Apache-2.0 GitHub repository of Strategy Short Template

Quatro SMA

by wynnforthework
2 stars

The Quatro SMA strategy identifies trend direction using four Simple Moving Averages combined with a volume confirmation filter. Long entries trigger when three fast SMAs align sequentially above a 200-period SMA while current bar volume exceeds 2.5 times its

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Quatro SMA
1 stars

This Pine Script strategy identifies trend changes by checking for crossovers between fast and slow EMAs on the current timeframe. It confirms the trend with a higher timeframe EMA confluence gate set to 60 minutes. The strategy draws its signals directly on t

Strategy v6 TrendMoving averages
Updated 7 days ago · Apache-2.0 GitHub repository of MTF probe 11 - HTF bracket manual trail
1 stars

An ICT-style strategy on the price chart that requires two confirmations before entering: an inverse fair value gap flip and a change in state of delivery, which is a structure break from recent swing levels. Optional filters are an EMA trend check, a liquidit

Strategy v6 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of TN IFVG CISD Double Confirm

SlimGains

by tseitz
1 stars

A Pine v4 strategy with small percentage targets, using a 12/26 MACD, a 14-period RSI and a 15-bar high-low lookback. Inputs set separate take-profit and stop-loss percentages for longs and shorts, an RSI level to close longs, a MACD bar count, and switches fo

Strategy v4 Oscillators & momentum Repaints
Updated 4 years ago · None stated GitHub repository of SlimGains
330 stars

The MACD + RSI Strategy [Alorse] combines moving average convergence divergence (MACD) crossovers with recent Relative Strength Index (RSI) extreme levels to generate long trading signals overlaid directly on the price chart. A long entry triggers when the MAC

Strategy v4 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of MACD + RSI Strategy [Alorse]

ATR RSI Strategy v2

by hasnocool
106 stars

This strategy combines Average True Range (ATR) and the Relative Strength Index (RSI) to generate volatility-filtered momentum trades on the price chart. It checks whether a normalized ATR moving average falls within user-defined bounds and requires current AT

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR RSI Strategy v2
16 stars

This strategy trades Donchian breakouts measured on weekly bars while orders execute on the chart timeframe. It allows long and short entries when price breaks the prior weekly channel and exits against the shorter weekly channel. Position size risks a set per

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 4: Weekly Donchian
4 stars

This trend-following strategy calculates the Supertrend indicator using average bar prices and Average True Range (ATR). It plots a color-coded trend line directly on the price chart along with buy and sell shapes. The strategy enters a long position when the

Strategy v6 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of Supertrend Strategy [trugurpala]
2 stars

The SVIX Bollinger Bands Strategy V2 uses Heikin-Ashi price calculations to plot customized Bollinger Bands and Keltner Channels directly on the price chart. It triggers a long entry when the Heikin-Ashi close crosses above the lower Bollinger Band. The strate

Strategy v5 Volatility & bandsMean reversion
Updated 1 year ago · None stated GitHub repository of SVIX Bollinger Bands Strategy V2

Multi Indicator Score

by pineforge-4pass
1 stars

A strategy that builds a score from minus three to plus three using RSI against 50, price against an EMA, and price against the Bollinger mid line. It enters long when the score reaches two or more and short when it reaches minus two or lower. Positions close

Strategy v6 Oscillators & momentumTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Multi Indicator Score
1 stars

A Bollinger Band breakout strategy with Spanish-language settings. It goes long when price closes above the upper band and short when it closes below the lower band, limited to a configurable date range and a cooldown of bars between trades. Three take-profit

Strategy v6 BreakoutVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger - 3 TPs (Frecuentes)

TN kNN Matrix ML

by raybird
1 stars

A machine learning strategy using k-nearest neighbours with a Lorentzian distance. Four normalised features, RSI, price rate of change, CCI and volume rate of change, are stored in a rolling matrix with a label for whether the next close was higher. Each bar i

Strategy v6 AI / machine learning
Updated 2 months ago · None stated GitHub repository of TN kNN Matrix ML
1 stars

A Pine v4 strategy that redraws candles in a separate pane and plots VWAP with one percent bands. It goes long on a green non-doji candle and short on a red one, unless the move runs against the opposite position and the close sits inside the band. Inputs set

Strategy v4 Volume
Updated 4 years ago · None stated GitHub repository of SlimScript Stop and Target

This strategy plots multi-timeframe Bollinger Bands on the price chart and trades mean reversion around them. It enters long when the close is below the higher-timeframe lower band and, if enabled, short when the close is above the upper band. An optional high

Strategy v4 Volatility & bandsMean reversion Repaints
Updated 2 months ago · None stated GitHub repository of MTF Bollindger Bands Strategy [Alorse]

This strategy executes breakout trades based on historical high and low entry bands and manages risk using adaptive ATR trailing stop-loss levels. It enters long positions when the close breaks above the lookback band and short positions when it breaks below.

Strategy v5 BreakoutVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of ATR trailing SL tight to slack [Takazudo]
16 stars

This trend-following strategy executes long and short trades based on Donchian channel breakouts directly on the price chart. It enters positions when price breaks a multi-bar high or low and exits on opposing Donchian channel band crosses. Risk management inc

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 5: Accelerated Pyramid

This strategy trades long and short on the price chart using a multi-timeframe TradingLatino setup. It requires EMA 10 to cross or sit above or below EMA 55 on the one-hour, four-hour, and daily charts, together with a positive ADX slope, a directional monitor

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard ABCBitcoin TradingLatino A010

This strategy evaluates bullish trend strength by calculating three Exponential Moving Averages (50, 100, and 150 periods) alongside their average slope angles in degrees. It plots the EMAs on the price chart and triggers long entries when the moving averages

Strategy v4 TrendMoving averages
Updated 3 years ago · Apache-2.0 GitHub repository of Triple EMA + Sloping Trend Long Strategy
4 stars

This strategy trades momentum breakouts based on the alignment of three exponential moving averages. It enters a long position when all three EMAs align in ascending order and enters short when they align in descending order. Positions are managed with ATR-bas

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Triple EMA Strategy [trugurpala]

OBV EMA Cross

by pineforge-4pass
1 stars

A minimal strategy that compares On Balance Volume with a 21-period EMA of itself. It enters long when OBV crosses above the average and short when it crosses below, reversing the position each time. It has no adjustable inputs, no stop loss and no take profit

Strategy v6 Volume
Updated 7 days ago · Apache-2.0 GitHub repository of OBV EMA Cross
1 stars

A liquidity sweep strategy on the price chart. It flags bars that push beyond the recent high or low and close back inside, then scores the setup using volume, a higher-timeframe EMA trend, an ATR noise filter and a lower-timeframe rejection check. The signal

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of TN Liquidity Sovereign

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