Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 29)

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

Strategy Template

by mrdungx2603
1 stars

This is a Pine Script v6 strategy template that sets up a trading strategy drawing on the price chart. It includes inputs for data source, fast and slow length parameters, take profit and stop loss percentages, and a time-based trading session filter. The stra

Strategy v6 Moving averagesTrend
Updated 4 months ago · None stated GitHub repository of Strategy Template

While Loop Counter

by Snappni
1 stars

This strategy sums the last len closing prices using a while loop then divides by len to obtain an average. It enters long when close exceeds the average and short when below. Positions close automatically on reversal. No stop loss is applied and entries occur

Strategy v6 Mean reversionTrend
Updated 4 months ago · MIT GitHub repository of While Loop Counter

Talons RSI Divergence

by muammeryldrm42
1 stars

The Talons RSI Divergence strategy detects bullish and bearish divergences by combining RSI values with price pivots. It calculates RSI using a customizable period and identifies pivot highs and lows on both price and RSI with a lookback setting. Bullish diver

Strategy v5 Oscillators & momentumDivergence
Updated 5 months ago · None stated GitHub repository of Talons RSI Divergence

Dragon Breakout

by AlanGuo
1 stars

A long strategy that plots five moving averages (25, 50, 100, 150 and 300 by default, SMA or EMA) and looks for a bullish candle that opens below and closes above at least a set number of them. The breakout must come on volume above a ratio of its recent avera

Strategy v6 BreakoutMoving averages
Updated 7 months ago · None stated GitHub repository of Dragon Breakout

Scalper Quick Strike

by Basant1Saini
1 stars

Scalper Quick Strike is a Pine Script strategy that trades on intraday charts using multiple EMAs and Stochastic oscillator. It calculates fast medium and slow EMAs along with a smoothed Stochastic to detect trend alignment and momentum shifts. Long entries tr

Strategy v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of Scalper Quick Strike

ES Professional Fade

by knectardev
1 stars

The ES Professional Fade strategy trades overnight price gaps during regular trading hours on intraday charts. It establishes an opening range and enters counter-trend positions when price fails near overnight extremes. Positions target the previous day's clos

Strategy v5 Mean reversionSessions & time
Updated 9 months ago · None stated GitHub repository of ES Professional Fade

Three Bar Reversal Pattern

by feliperazeek
1 stars

This strategy detects three-bar reversal patterns in normal, enhanced or both forms, derives support and resistance from them as levels or zones, and trades the reversals on the price chart. An optional trend filter uses a moving average cloud, Supertrend or D

Strategy v5 Candlestick patternsSupport & resistance
Updated 1 year ago · None stated GitHub repository of Three Bar Reversal Pattern
1 stars

This strategy calculates fast and slow simple moving averages to identify trend direction changes on the price chart. It enters a long position when the fast simple moving average crosses above the slow simple moving average and opens a short position when it

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Two Moving Average Crossover
1 stars

A scalping strategy that goes long when a 9 EMA crosses above a 21 EMA while price crosses above VWAP, and short on the opposite pair of crosses. Exits close the trade at 1.5 ATR from the average entry price or on a MACD cross with a new five-bar extreme. A br

Strategy v5 ScalpingMoving averages
Updated 1 year ago · None stated GitHub repository of S50 TFEX Scalping Strategy
1 stars

This strategy measures volatility as the standard deviation of closes and compares it with its own moving average multiplied by a threshold. When volatility is expanding and the close is beyond a Bollinger Band (20 periods, 2 deviations, fixed in the code), it

Strategy v5 BreakoutVolatility & bands
Updated 1 year ago · None stated GitHub repository of Volatility Breakout Strategy
1 stars

A long-side strategy that combines a Stochastic Momentum Index, a fast and slow EMA pair and MACD histogram. It enters long when the SMI crosses above its EMA while below the overbought level, and exits on the opposite SMI cross or when the fast EMA crosses un

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · None stated GitHub repository of SMI-MA Long Strategy

My strategy 11

by akash-yellgetti
1 stars

A strategy-type script for the price chart built around a fast and slow moving average pair, exponential or simple, whose lines and fill change colour with the direction of the gap. It prints B and S labels at crossovers and builds text messages for an externa

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of My strategy 11

Simple Short Term RSI

by juliencrn
1 stars

Simple Short Term RSI is an unfinished Pine v4 learning strategy, marked as such by its author. It calculates a 2-period and a 14-period RSI and plots both in a separate pane. Its only trading rule is a long entry whenever the 2-period RSI is above 50, which d

Strategy v4 Oscillators & momentumMean reversion Archived
Updated 4 years ago · None stated GitHub repository of Simple Short Term RSI

EMA Cross Strategy

by tseitz
1 stars

The EMA Cross Strategy calculates an exponential moving average of close prices over a user-defined length. It enters a long position when a green candle opens above the moving average line, simultaneously closing any active short position. Conversely, it open

Strategy v4 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of EMA Cross Strategy
257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 7 weeks ago · None stated GitHub repository of Donald - Test Logic Futures
106 stars

This strategy plots on the price chart and enters when three smoothed moving averages are aligned, RSI is on the matching side of 50, and a Williams fractal appears. An upward stack with RSI above 50 and a down fractal opens a long; the opposite setup opens a

Strategy v5 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 3SmmaCrossUp + Fractal + RSI

MS+MACD Basic Tests

by iamrichardD
57 stars

This script implements an automated unit testing suite for a 4-hour swing trading system based on market structure and MACD. Utilizing a custom PineUnit framework with user-defined types, it validates mock functions for change of character, break of structure,

Strategy v6 SMC / ICT / price actionOscillators & momentum
Updated 1 year ago · Apache-2.0 GitHub repository of MS+MACD Basic Tests
53 stars

This strategy implements Larry Connors' 2-period RSI mean-reversion algorithm overlaid on the price chart. It filters trades using a long-term Simple Moving Average (SMA), entering long positions when the price trades above the SMA and the short-term RSI drops

Strategy v6 Oscillators & momentumMean reversion
Updated 2 months ago · MPL-2.0 GitHub repository of Larry Connors 2-Period RSI Strategy

This overlay strategy is written for the SOLUSDT perpetual on the one-minute chart. It tracks confirmed pivot highs and lows as resistance and support circles, then marks strong buy or sell states when close crosses those levels. Long and short conditions comp

Strategy v5 Support & resistanceBreakout Repaints
Updated 2 years ago · None stated GitHub repository of SOLUSDTPERP 1m - Strategy Candle Bar

RSI/BB 1minute Study

by SammyEnigma
18 stars

This strategy combines Relative Strength Index and Bollinger Bands for short-term signal generation. It enters long positions when the price crosses below the lower Bollinger Band while the RSI falls at or below the oversold threshold. Positions are scaled dow

Strategy v4 Oscillators & momentumVolatility & bands
Updated 6 years ago · None stated GitHub repository of RSI/BB 1minute Study
16 stars

This trend-following strategy adapts classic Donchian breakout channels according to market volatility regimes. It calculates an ATR percentile rank across a rolling lookback period, shifting dynamically between tighter breakout channels with smaller stops dur

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 1: Adaptive Volatility

Divergenced A002

by ruckard
13 stars

Divergenced A002 is a momentum divergence strategy designed to identify entry opportunities using Squeeze Momentum Indicator shifts alongside price action. It enters long when momentum reaches higher lows during lower price lows and enters short on opposite di

Strategy v5 Oscillators & momentumDivergence
Updated 1 year ago · None stated GitHub repository of Divergenced A002

Momentum Combo Strategy

by EternaHybridExchange
9 stars

This strategy scores bullish and bearish confluence from RSI, MACD, a stochastic of RSI, and a fixed ten-bar momentum reading. It opens a long or a short only when the position is flat and the matching count reaches the minimum confirmation setting, then close

Strategy v5 Oscillators & momentum
Updated 7 months ago · MIT GitHub repository of Momentum Combo Strategy

Tiered Exit (Memecoin)

by muammeryldrm42
7 stars

This strategy enters long trades when a fast EMA crosses above a slow EMA. Position risk and profits are managed through tiered exit stages: three custom percentage-based profit targets with partial exits, a hard percentage stop loss, and a trailing drawdown e

Strategy v5 TrendMoving averages Repaints
Updated 3 months ago · MIT GitHub repository of Tiered Exit (Memecoin)

An Ichimoku-based trading strategy that plots the complete Ichimoku Kinko Hyo system directly on the price chart. Long signals trigger when Tenkan-Sen is above Kijun-Sen and positioned above the current Kumo cloud, exiting when Tenkan-Sen falls below Kijun-Sen

Strategy v5 TrendSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of Ichimoku Kinko Hyo: Tenkan Kumo Strategy

Antigravity Superstar

by eltonaguiar
4 stars

This strategy draws on the price chart and combines a triple EMA stack, a volume spike with a minimum price move, and a MACD line-signal crossover. It enters long or short only when at least the chosen number of those three signals agree, with an optional RSI

Strategy v6 TrendMoving averages
Updated 2 days ago · None stated GitHub repository of Antigravity Superstar
4 stars

This strategy trades opening gap fades on the DAX index during the European Xetra session. At the 09:00 CET market open, it measures the opening price against the previous close relative to an ATR threshold. If a gap exceeds the threshold, it fades the move by

Strategy v6 Mean reversionSessions & time
Updated 2 months ago · MIT GitHub repository of DAX Gap Fade [trugurpala]

Swing Trade

by might-tree
4 stars

This strategy plots three swing lines on the price chart. A small swing marks the current high after one higher high, or the current low after one lower low. A medium swing requires two consecutive rising highs or falling lows, and a large swing requires three

Strategy v5 TrendSupport & resistance
Updated 3 years ago · None stated GitHub repository of Swing Trade
3 stars

This strategy overlays the price chart to generate trading signals by combining Quantitative Qualitative Estimation (QQE), a custom SuperTrend, and a CCI ATR trend metric. It colors candles green or red according to combined trend alignment and enters long or

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Bankai DTEK Strategy

RSI + MACD Strategy

by monch1962
3 stars

This strategy combines the Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), and a volume filter to identify long trade entries. A buy signal requires RSI to be oversold, MACD to cross above its signal line, and volume to exceed 1.5

Strategy v5 Oscillators & momentumVolume
Updated 7 months ago · None stated GitHub repository of RSI + MACD Strategy

ZEGUELA DEMATRON AXS 2H

by danielvm-git
2 stars

This strategy calculates and plots three double exponential moving averages (DEMA) on the price chart using lengths of 8, 24, and 0. It generates long signals on DEMA crossovers and short signals on crossunders. Positions are entered based on these signals and

Strategy v4 Moving averagesTrend Repaints
Updated 2 months ago · MIT GitHub repository of ZEGUELA DEMATRON AXS 2H

Alper

by avatar-lavventura
2 stars

Alper is a multi-indicator trading strategy combining a WaveTrend oscillator, RSI, and Squeeze Momentum logic based on Bollinger Bands and Keltner Channels. Operating within a user-defined backtest time window, it plots WaveTrend lines, overbought and oversold

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

Grid Bot [psyll]

by cullyk
2 stars

Grid Bot places a configurable number of long and short orders between a user-set grid top and bottom and draws those levels on the price chart. Direction can be longs, shorts, or both, with default or burst entry and an optional instant first fill. Exits use

Strategy v5 Mean reversionSupport & resistance
Updated 8 months ago · MIT GitHub repository of Grid Bot [psyll]

Momentum-based ZigZag + 趋势

by wynnforthework
2 stars

This strategy combines momentum-based ZigZag calculations with a Supertrend overlay and an EMA trend filter to generate trading entries. It allows selecting between QQE, MACD, or Moving Averages to drive the ZigZag pivot logic. The strategy includes adjustable

Strategy v5 TrendOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Momentum-based ZigZag + 趋势
2 stars

This strategy calculates higher-timeframe price levels and multi-timeframe Bollinger Bands to identify price zone interactions directly on the main chart. It uses daily source prices and 240-minute Bollinger Bands, styling them with dynamic gradient coloring b

Strategy v4 Volatility & bandsSupport & resistance Repaints
Updated 3 years ago · None stated GitHub repository of Time PriceZones Strat Testing

Dial Main Period

by pineforge-4pass
1 stars

A long-only EMA crossover strategy whose fast and slow lengths change with the chart timeframe. Separate pairs of lengths are set for 5, 15, 60 and 240 minute charts, and other timeframes use the 15 minute pair. It enters long when the fast EMA crosses above t

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of Dial Main Period

MA Cross

by GammaExpansion
1 stars

This strategy calculates fast and slow moving averages using SMA or EMA selections and plots them on the price chart. It signals long entries on fast MA crossing above slow MA, optionally requiring slow MA to be rising. It closes positions on fast MA crossing

Strategy v6 Moving averagesTrend
Updated 7 days ago · MIT GitHub repository of MA Cross

BB Upper Breakout Short

by kanylbullen
1 stars

A short-only strategy that sells when price pushes a set percentage above the upper Bollinger Band. The trigger can use the candle high or the close. After entry, it places a limit take profit a set percentage below the average entry price. Band length, multip

Strategy v5 Volatility & bandsMean reversion
Updated 8 days ago · None stated GitHub repository of BB Upper Breakout Short

SR+Trend v6 APT

by MuhammadMuhamid
1 stars

A long-only strategy preset tuned for one crypto pair, using multi-timeframe pivot support and resistance with tighter touch zones and shorter retest windows than the other versions. It can flip broken resistance into support and supports optional moving avera

Strategy v6 Support & resistanceTrend
Updated 13 days ago · None stated GitHub repository of SR+Trend v6 APT

STT SR TMA Scale Plan

by majohnst
1 stars

The STT SR TMA Scale Plan is an intraday trading strategy that overlays price charts to execute trades based on Triangular Moving Average (TMA) crossings, VWAP breakouts, and support/resistance levels like daily pivots or Anchored VWAP. Entries are restricted

Strategy v6 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of STT SR TMA Scale Plan
1 stars

This strategy identifies breakout opportunities in Bursa Malaysia stocks using a slow EMA trend filter where price exceeds the 150-period EMA and the slow EMA is above its 150 EMA. It plots fast and slow EMAs on the price chart. Entry occurs on a new 20-day hi

Strategy v5 BreakoutMoving averages
Updated 4 months ago · None stated GitHub repository of KLSE VCP Breakout Backtest
1 stars

This strategy plots a volume-weighted moving average, a Hull moving average, and a linear regression on the price chart. It enters long when the Hull average crosses above the volume-weighted average while stochastic is above 50, on-balance volume is rising, m

Strategy v5 TrendOscillators & momentum
Updated 4 months ago · MIT GitHub repository of Advanced Indicator Suite

MTF RSI Confluence

by shubhamtaywade82
1 stars

A strategy that scores RSI across four timeframes, with weights falling from the chart timeframe to the 4-hour, and adds or subtracts points for RSI divergence at recent pivots. It enters long when the score rises above a threshold and short when it falls belo

Strategy v6 Oscillators & momentumDivergence Archived
Updated 5 months ago · None stated GitHub repository of MTF RSI Confluence

Talons Supertrend + ADX

by muammeryldrm42
1 stars

A strategy that trades Supertrend direction flips when ADX is above a threshold. A flip to uptrend with strong ADX opens a long, and a flip to downtrend opens a short, one position at a time. The Supertrend line is the initial stop and the take profit is 2.5 t

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Talons Supertrend + ADX

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