Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 2)

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

RSI Crossover

by cleanmind777
8 stars

This strategy evaluates market trends using triple exponential moving averages, a Stochastic RSI oscillator, MACD, Supertrend, and average true range. It plots two EMAs and Supertrend direction directly on the price chart alongside entry shape markers. Long en

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of RSI Crossover

BB strategy Production

by satheshshiva
8 stars

This strategy plots Bollinger Bands on the price chart using a simple moving average and a standard-deviation multiplier. It enters long when close crosses above the lower band while still below the basis, and short when close crosses under the upper band whil

Strategy v5 Volatility & bandsMean reversion
Updated 3 years ago · None stated GitHub repository of BB strategy Production

Calculates a custom moving average (MaMA) by modifying the source price with price momentum, acceleration, and psychological win-rate probability before applying an EMA or SMA. Plots the adjusted moving average directly on the price chart alongside optional re

Strategy v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Momentum Adjusted Moving Average by DGT

1-Min Gold Taylor Technique

by eddiebelaval
7 stars

This intraday strategy implements session-based trading rules tailored for gold on short timeframes. It tracks the Asian session price range, VWAP, 20-period EMA, and previous day high and low levels to identify liquidity sweeps during London and New York trad

Strategy v6 Sessions & timeSupport & resistance
Updated 3 months ago · None stated GitHub repository of 1-Min Gold Taylor Technique

BB Squeeze Breakout

by muammeryldrm42
7 stars

BB Squeeze Breakout is a volatility breakout strategy that identifies consolidation squeezes using Bollinger Band width percentile ranking. When the band width drops below its 25th percentile and price crosses above or below the bands with optional volume conf

Strategy v5 Volatility & bandsBreakout
Updated 3 months ago · MIT GitHub repository of BB Squeeze Breakout
7 stars

This strategy plots dynamic pivot-based support and resistance trendlines on the price chart and trades breakouts beyond those lines. By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer.

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Easy Trendline - XAUUSD 30m
7 stars

This strategy opens a long position when the bar hour matches the opening hour, the close is above a simple moving average, and the day is not Thursday or Saturday. It closes that long when the bar hour matches the closing hour. Default inputs set the open hou

Strategy v5 Moving averagesSessions & time Repaints
Updated 1 year ago · None stated GitHub repository of Strategia Buy 20:00 - Close 00:00

Backtest Adapter

by SynergOps
7 stars

This strategy adapts an external numeric source into backtest orders on the price chart. It opens a long when the source equals 1 and closes that long when it equals 2. It opens a short at -1 and closes it at -2. An optional start-date filter blocks trades bef

Strategy v6
Updated 1 year ago · MPL-2.0 GitHub repository of Backtest Adapter
7 stars

Calculates volume profile levels over a lookback window to identify support, resistance, and Point of Control (POC) lines on the price chart. It executes trades based on price interaction with these low-volume zones, featuring customizable signal inversion and

Strategy v6 ScalpingVolume
Updated 1 year ago · None stated GitHub repository of Enhanced NQ1 Scalping Strategy

Our MACD Backtesting

by benniebendiksen
7 stars

This Pine Script strategy computes a MACD indicator with customizable fast, slow, and signal EMA lengths applied to close prices. Delta is calculated as the difference between the MACD line and signal line, plotted as an overlay on the price chart. Long entrie

Strategy v5 Oscillators & momentumMoving averages
Updated 1 year ago · MIT GitHub repository of Our MACD Backtesting

This strategy trades EUR/USD breakouts on the price chart using Ichimoku values. It marks a compressed range when the Senkou spans twist and the range height stays under a pip limit. It enters long on a close above the prior range high, or short below the prio

Strategy v4 TrendBreakout
Updated 2 years ago · MIT GitHub repository of Robot Forex BREAKOUT EUR/USD 5MIN - Ichimoku
7 stars

Acts as a modular strategy boilerplate designed for automated and manual trading strategies on the price chart. It provides execution infrastructure including trade direction toggles, signal reversal, alternating orders, session filtering, and anti-news volati

Strategy v5 Sessions & time
Updated 2 years ago · None stated GitHub repository of Git Pine Script v5 Template

Combined Strategy

by Dropio12
7 stars

This strategy plots buy and sell markers on the price chart by combining a fast and slow ALMA crossover with a simple close-to-close momentum check. A long marker appears when the fast ALMA crosses above the slow ALMA and momentum is positive. A short marker a

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Combined Strategy

Optimizer v1

by QuantGeekDev
7 stars

This strategy generates long signals on the price chart using multiple technical indicators. It computes EMA 70 and 100, SMA 70, ADX with DMI, CCI, and MACD values. A long entry occurs when EMA crossover condition, SMA condition, ADX above 15, CCI above 30, an

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Optimizer v1

15m Volume Alert

by JackZhao516
7 stars

This strategy monitors 15-minute volume to detect sudden volume spikes and triggers long entries directly on the price chart. It evaluates whether the latest 15-minute volume exceeds preceding bars by a factor of 10 or 50, provided that the total bar turnover

Strategy v5 VolumeBreakout Repaints
Updated 3 years ago · MIT GitHub repository of 15m Volume Alert
7 stars

This strategy plots a simple moving average basis and upper and lower Bollinger bands on the price chart, with a fill between the bands. It also calculates RSI. It opens one long trade when RSI is above 25, price is at or below the lower band, and no position

Strategy v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy

Philosopher

by AzureKn1ght
7 stars

Philosopher is an overlay strategy that combines Stochastic momentum calculations, Waddah Attar Explosion volatility signals, and Hull Moving Average baselines to generate trade entries. It utilizes higher-timeframe Hull Moving Averages to evaluate market tren

Strategy v4 TrendOscillators & momentum
Updated 5 years ago · MPL-2.0 GitHub repository of Philosopher

MainScript

by Swastik2000
7 stars

This strategy calculates a Volume-Weighted Average Price (VWAP) with optional standard deviation bands alongside an Exponential Moving Average (EMA) on the main price chart. It is designed to generate buy and sell conditions based on crossovers between the EMA

Strategy v4 TrendMoving averages Repaints
Updated 5 years ago · None stated GitHub repository of MainScript

CG-ISMARKET Session Flags

by pineforge-4pass
6 stars

This diagnostic strategy inspects and records TradingView session built-in flags on each chart bar. It alternates between long and short entries on every bar, encoding the state of regular market, premarket, postmarket, and boundary flags into the order commen

Strategy v6 Sessions & time
Updated yesterday · Custom licence GitHub repository of CG-ISMARKET Session Flags

C41 Core Strategy v2

by damianpitt
6 stars

This strategy plots an EMA or SMA on the price chart and enters long when price is above the average and both RSI and Williams %R meet the long condition, or short when price is below the average and both oscillators meet the short condition. An optional turn

Strategy v6 TrendOscillators & momentum
Updated 8 weeks ago · MIT GitHub repository of C41 Core Strategy v2
6 stars

This strategy identifies long gap-and-go breakout opportunities on intraday US stock charts. It filters equities across three sequential stages: verifying fundamental criteria (minimum three-year average ROCE and market capitalization via financial data reques

Strategy v5 TrendBreakout
Updated 3 months ago · MIT GitHub repository of Quality Trend-Join-Long (gap-and-go)

FxHD Strategy v2.0

by alboogycOdR
6 stars

FxHD Strategy v2.0 is a Fibonacci multi-timeframe strategy drawn on the price chart. It reads a higher timeframe, defaulting to four hours, and sets bias with CRT kill zones, the last two candles, dynamic CRT, or market structure, plus a fallback method. It pl

Strategy v6 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of FxHD Strategy v2.0
6 stars

This strategy evaluates higher-timeframe four-hour ADX momentum and RSI conditions to generate long trades on lower timeframes like 15 minutes. Entries trigger when 15-minute RSI drops relative to four-hour RSI under specific directional strength conditions. P

Strategy v6 TrendOscillators & momentum Repaints
Updated 1 year ago · MIT GitHub repository of Basic Long Entry System

TurtleStrategy_Crypto

by OktayBogazkaya
6 stars

This strategy trades long breakouts of the highest high over a user-set period. It enters when the close is above that prior high and the position is flat, then sizes the order from account equity, a risk percentage, and ATR times a multiplier. It exits when t

Strategy v6 TrendBreakout
Updated 1 year ago · MIT GitHub repository of TurtleStrategy_Crypto

Simple Strategy

by TradersPost
6 stars

Simple Strategy is an educational strategy script designed to demonstrate automated order messaging and webhook alerts. It executes on the main price chart, entering long when the current bar closes above the previous close and entering short when it closes be

Strategy v6 Trend
Updated 1 year ago · None stated GitHub repository of Simple Strategy

MultiPeriodOverBS

by wanjo-tech
6 stars

This strategy calculates volume-weighted Relative Strength Index (RSI) values across multiple timeframes, specifically 15-minute and daily periods. It averages the resulting short- and long-term RSIs into an oscillator to identify extreme overbought and overso

Strategy v5 Oscillators & momentumMean reversion
Updated 2 years ago · None stated GitHub repository of MultiPeriodOverBS

Zeroline

by sharkpunch5
6 stars

Zeroline is a trend-following strategy designed around the No Nonsense Forex (NNFX) methodology. It combines a primary trigger and confirmation system (Didi index), a secondary confirmation (Kuskus), a volume filter, and a Kaufman Adaptive Moving Average (KAMA

Strategy v4 TrendMoving averages
Updated 4 years ago · MIT GitHub repository of Zeroline

AlgoSight Strategy

by ashishanildhage
6 stars

This long-only momentum strategy combines the Relative Strength Index with the Moving Average Convergence Divergence indicator. It opens a long trade when the RSI has been in oversold territory within the last five bars and the MACD line crosses above its sign

Strategy v4 Oscillators & momentumTrend
Updated 4 years ago · None stated GitHub repository of AlgoSight Strategy

NowoIchimokuV1

by seannowotny
6 stars

This strategy overlays Ichimoku lines and a cloud on the price chart, plus a stochastic RSI and an upper band from a Hull moving average and standard deviation. It opens one long inside a date window when the cloud is green and price is above the cloud and con

Strategy v4 TrendOscillators & momentum
Updated 5 years ago · None stated GitHub repository of NowoIchimokuV1
5 stars

This strategy calculates Bollinger Bands and monitors band width relative to a historical moving average to identify low-volatility squeeze regimes. It draws upper, lower, and basis bands directly on the price chart while shading squeeze periods in yellow. A l

Strategy v5 Volatility & bandsBreakout
Updated yesterday · MIT GitHub repository of Bridge 04 - Bollinger Squeeze

The Xsodus Supertrend Strategy is a long-only Pine Script strategy that overlays the Supertrend indicator on the price chart to generate buy signals for long positions when the trend is up. It calculates the Supertrend line using a configurable length and mult

Strategy v6 TrendVolatility & bands
Updated 2 weeks ago · MIT GitHub repository of Xsodus Supertrend Strategy (Long Only)
5 stars

This strategy calculates a Moving Average Convergence Divergence (MACD) and signal line using 12 and 26-period simple moving averages requested from a fixed 5-minute timeframe. It enters a long position when the MACD line crosses above the signal line while th

Strategy v5 Oscillators & momentumMoving averages Repaints
Updated 2 weeks ago · MIT GitHub repository of Broken MACD Strategy
5 stars

Combines trend-following moving average entries with an astronomical cycle filter. Entries trigger on a rising EMA filter and are gated by Vedic astronomical events like eclipse windows and Vishti karana. The strategy offers two distinct exit styles: a trend m

Strategy v6 TrendMoving averages
Updated 7 weeks ago · MIT GitHub repository of ChandraQuant - Kala-Chakra Strategy

Pivot Trendline Trading

by AllienNova
5 stars

Pivot Trendline Trading is an automated strategy that identifies pivot-constrained trendlines and calculates quality scores for potential setups. It uses an Efficiency Ratio and EMA cross count to determine trending regimes before entering on trendline breakou

Strategy v6 TrendBreakout
Updated 8 weeks ago · None stated GitHub repository of Pivot Trendline Trading

Breakout AVAAI BITGET

by tarasprystavskyj
5 stars

Breakout AVAAI BITGET is a cryptocurrency breakout strategy that identifies entry points using price channels alongside ATR, MACD, ADX, and volume trend filters. Long and short entries trigger when price breaches Donchian-style highest highs or lowest lows und

Strategy v6 BreakoutTrend
Updated 3 months ago · None stated GitHub repository of Breakout AVAAI BITGET
5 stars

This strategy enters one long trade when the bar low comes within a set point tolerance of the prior day's low and the close finishes above that level. Entries are allowed only inside a UTC session and are blocked after a Friday cutoff hour. It stays flat unti

Strategy v5 Support & resistanceMean reversion Repaints
Updated 5 months ago · MIT GitHub repository of PDL — Prior Day Level Retest (Bull)
5 stars

This script is a simple exponential moving average crossover strategy designed as an example test script. It calculates a 14-period fast EMA and a 28-period slow EMA, plotting both lines directly on the price chart. The strategy triggers a long position entry

Strategy v6 TrendMoving averages Repaints
Updated 5 months ago · MIT GitHub repository of [SA-TEST 02] EMA Crossover
5 stars

Moving Average Crossover Bot is a simple trend-following strategy that generates trading signals when a fast Simple Moving Average crosses a slow Simple Moving Average. It enters long positions on a bullish crossover and short positions on a bearish crossunder

Strategy v4 TrendMoving averages
Updated 3 years ago · MIT GitHub repository of Moving Average Crossover Bot

RSI MACD

by sawantuday
5 stars

This strategy enters long positions based on momentum confirmation from RSI and MACD, operating directly on the main price chart. It buys when the 14-period RSI exceeds 60 while the MACD line trades above the signal line. Positions close when the price crosses

Strategy v4 Oscillators & momentumMoving averages
Updated 5 years ago · CC0-1.0 GitHub repository of RSI MACD

This strategy plots five simple moving averages on the price chart and trades crosses of a 150-period signal average. It enters long when the close crosses above that average and enters short when the close crosses below it, from a user-set start year onward.

Strategy v4 Moving averagesTrend
Updated 6 years ago · LGPL-3.0 GitHub repository of 150MA Cross BuyAndSell Strategy [d3nv3r]
4 stars

Lucid 100K is an automated evaluation strategy tailored for micro futures contracts such as MES, MGC, and MNQ on lower timeframes. It operates a two-phase state machine that moves from an initial risk-averse lock-in phase to an expanded payout phase once targe

Strategy v6 TrendMean reversion
Updated 2 days ago · None stated GitHub repository of Lucid 100K (MES/MGC/MNQ)

ADX Trend Filter

by latentwill
4 stars

This strategy enters long when a series labeled ADX is above a threshold and RSI is below 40, and enters short when that series is above the threshold and RSI is above 60. Both series are calculated with the RSI function, so the trend filter is not a true ADX.

Strategy v5 TrendOscillators & momentum
Updated 7 days ago · None stated GitHub repository of ADX Trend Filter

BTC Breakout Short Selling with Hedge is a strategy designed to trade downside breakouts. It identifies market lows over a specified lookback period to trigger short entries. Upon entry, it calculates dynamic stop loss and take profit levels based on Average T

Strategy v4 BreakoutVolatility & bands
Updated 9 days ago · GPL-3.0 GitHub repository of BTC Breakout Short Selling with Hedge
4 stars

This strategy enters a long position when a short RSI falls below a user threshold and price is above a simple moving average trend filter. It closes the long when RSI rises above a second threshold and does not set a stop loss. Position size defaults to full

Strategy v6 Oscillators & momentumMoving averages
Updated 2 weeks ago · MIT GitHub repository of RSI(2) pullback + TokIO check
4 stars

Breakout Follow Trend is a quantitative trend-following strategy designed to capture volatility expansion. It triggers entries when price breaks out of Bollinger Bands, filtered by an EMA trend filter, optional candle overlap rules, and a volume moving average

Strategy v6 TrendVolatility & bands
Updated 3 weeks ago · None stated GitHub repository of Breakout Follow Trend
4 stars

This strategy enters long when the fast EMA crosses above the slow EMA while ADX is at least the minimum and DI plus exceeds DI minus. It enters short on the opposite cross with DI minus above DI plus. Each entry sets an ATR-based stop and take profit using th

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

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