Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 46)

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

16 stars

Seykota Alt 9: Time Exit Primary executes a Donchian breakout trend-following strategy that prioritizes time-based exits over price-based trailing stops. It enters long or short on 55-bar Donchian channel breakouts, sizing positions by ATR-based risk and pyram

Strategy v6 TrendBreakout
Updated 12 months ago · None stated GitHub repository of Seykota Alt 9: Time Exit Primary

This strategy combines Trend Indicator A-V2, Supertrend and QQE Mod to generate long and short signals on the price chart. It enters positions based on the combined trend signals and manages exits using take profit and stop loss levels. Position sizing follows

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard AndresAristizibal Joya C002

VİOP Session Strategy

by trugurpala
4 stars

This strategy trades Turkish VIOP BIST 30 futures on the price chart. It opens positions when a fast exponential moving average crosses a slow one, but only while chart time falls inside the 09:30 to 18:15 UTC+3 session. Stop loss and take profit distances are

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of VİOP Session Strategy

This strategy executes long positions based on a fast and slow exponential moving average crossover. It manages open positions using an ATR-based stop loss, an optional maximum percentage loss floor, a percentage-based profit target, and a dedicated management

Strategy v5 TrendMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of EMA Crossover ATR Strategy v2

Price Action Trading 策略

by wynnforthework
2 stars

Calculates and plots a customizable moving average alongside trailing ATR bands, forming the Profit Maximizer trend-following framework. It supports multiple moving average algorithms including EMA, ZLEMA, VAR, and TSF, alongside configurable ATR multipliers.

Strategy v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Price Action Trading 策略
1 stars

This strategy enters long positions every Monday at 00:00 UTC on the 15-minute chart. It computes quantity as 10 percent of current equity divided by the bar close, rounded to three decimal places for stability. Market orders open the position and it flattens

Strategy v6 TrendMean reversion
Updated 7 days ago · Apache-2.0 GitHub repository of Parity probe 05 - small equity fraction
1 stars

A strategy that enters on a liquidity sweep and reclaim of a stored swing level, gated by trend and momentum filters. Trend uses EMAs, ADX, DI alignment and a confirmed higher-timeframe EMA check, and momentum uses ROC and balance of power. Cleaner overlay ext

Strategy v6 TrendSMC / ICT / price action Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Sweep Trend Continuation + SVP

This statistical arbitrage strategy uses matrix algebra to calculate dynamic Ordinary Least Squares regression parameters between the chart symbol and a secondary asset. It constructs a synthetic spread and calculates its Z-score. The strategy enters a long po

Strategy v6 Mean reversionScreeners & dashboards
Updated 2 months ago · None stated GitHub repository of TN Matrix OLS Stat Arb Sovereign v6

SlimTrades 1m

by tseitz
1 stars

A Pine v4 strategy that plots the previous four-bar highest high and lowest low in green and red on the price chart. It uses MACD and RSI turning points and candle body size to time entries, and applies a trailing stop set as a percentage of the close for both

Strategy v4 Oscillators & momentumScalping Repaints
Updated 4 years ago · None stated GitHub repository of SlimTrades 1m

AVWAP Strategy

by hasnocool
106 stars

This overlay strategy builds a smoothed price source from expanded candle and Heikin-Ashi inputs using AMA, T3, or Kaufman's adaptive moving average. The Kaufman path can adapt with a Jurik fractal dimension, and a Garman-Klass-Yang-Zhang volatility filter can

Strategy v5 Moving averagesVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of AVWAP Strategy

Ruckard AndresAristizibal Joya D003 is an automated crypto trading strategy that evaluates entry and exit signals using a combination of Trend Indicator A-V2, Supertrend, and QQE Mod, alongside customizable Curie closing moving average filters. The script exec

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard AndresAristizibal Joya D003
3 stars

This strategy overlays three Simple Moving Averages, one Exponential Moving Average, and a dynamic trailing swing line directly on the price chart. It determines market direction by tracking recent highest highs and lowest lows over a customizable swing period

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of EMA Crossover Scott Strategy
2 stars

This strategy plots period high and low breakout bands on the price chart and trades breaks of those bands. It goes long when price closes above the upper band while that band is above a simple moving average, and short on the opposite setup. Position size is

Strategy v4 TrendBreakout
Updated 1 year ago · None stated GitHub repository of Trend #1 - ATR+Breakout high/low
1 stars

This strategy opens a long position at the start of each Monday at midnight by sizing it to 50% of current equity divided by the close price. It automatically flattens the position on the next bar close. No stop loss or take profit is used. The strategy runs o

Strategy v6 Sessions & timeMean reversion
Updated 7 days ago · Apache-2.0 GitHub repository of Parity probe 06 - 50% equity sizing
1 stars

A strategy with one entry type, a liquidity sweep and reclaim of a stored swing level, allowed only when trend and momentum filters agree. The trend filter uses a fast and slow EMA, a minimum ADX, DI alignment and an optional confirmed higher-timeframe EMA che

Strategy v6 TrendSMC / ICT / price action Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Sweep Trend Continuation Strategy
1 stars

A portfolio-style strategy that estimates weights for three assets, Bitcoin, Ethereum and Solana by default, using return covariance matrices over a selectable lookback of 60, 120 or 252 bars and an annual baseline rate input. It solves for tangency weights ev

Strategy v6
Updated 2 months ago · None stated GitHub repository of TN Max Sharpe Sovereign
1 stars

This strategy calculates a composite rating from a TechnicalRating library using moving averages and oscillators. It plots signals directly on the price chart. The ratingSignal setting selects which components to base the signal on: MAs, Oscillators, or All. W

Strategy v6 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Technical Ratings Strategy

SlimTrades 2h

by tseitz
1 stars

SlimTrades 2h is an intraday strategy overlaying short-term high and low price channels alongside momentum measurements from MACD and RSI. It tracks local highs and lows over a user-defined lookback period, plotting them directly on the price chart. The script

Strategy v4 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of SlimTrades 2h

This long-only strategy trades intra-range mean reversion using standard or augmented Bollinger Bands overlayed on the main price chart. It triggers long entries when price dips below the lower band, provided the band spread stays within a defined threshold. E

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of B.Bands | Augmented | Intra-range | Long-Only

This strategy plots on the price chart and combines Trend Indicator A-V2, Supertrend, and QQE Mod to choose long or short entries. Optional start and stop times limit when it trades. Percentage take profit and stop loss are enabled by default, while trailing t

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard AndresAristizibal Joya E002

This strategy executes trades based on price crosses over dynamic swing breakout levels filtered by a baseline moving average. It plots three simple moving averages and an exponential moving average directly on the price chart alongside buy and sell arrows. Lo

Strategy v5 Moving averagesTrend
Updated 5 months ago · None stated GitHub repository of EMA Crossover Scott Strategy v2

Trend #4 - ATR+EMA channel

by wynnforthework
2 stars

Trend #4 - ATR+EMA channel is a strategy that plots ATR bands, a blue Keltner-style channel, and a red EMA on the price chart. It generates long entries when price crosses above the blue channel and red EMA with zero position, using position sizing based on st

Strategy v4 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Trend #4 - ATR+EMA channel

Percent Rank Reversion

by pineforge-4pass
1 stars

This strategy measures the percentile rank of bar-to-bar close changes and plots that rank in a separate pane with a five-bar simple moving average and fixed overbought, oversold, and midline levels. It enters long when the rank is below the oversold threshold

Strategy v6 Oscillators & momentumMean reversion
Updated 7 days ago · Apache-2.0 GitHub repository of Percent Rank Reversion

This strategy combines a simplified Lorentzian distance-based machine learning prediction with a three-factor filter matrix to generate trade signals. It normalizes RSI, CCI, ADX, and momentum over rolling windows to evaluate feature distance, while scoring tr

Strategy v6 AI / machine learningTrend
Updated 2 months ago · None stated GitHub repository of TN ML Matrix Ensemble Sovereign v6

Strategy Template

by zhuzp98
1 stars

A blank Pine Script v5 strategy template with placeholder sections for inputs, indicators and conditions. It defines equity-based position sizing, commission and slippage, a percentage stop loss and take profit set from the entry price, and order blocks for lo

Strategy v5
Updated 1 year ago · None stated GitHub repository of Strategy Template

SlimTrades 2m

by tseitz
1 stars

A strategy on the price chart tuned in its defaults for a 2 minute chart. It uses RSI zones together with two rolling highest and lowest ranges to open longs and, if allowed, shorts. Exits come from RSI close zones, a minimum percentage move and separate trail

Strategy v4 Oscillators & momentumScalping
Updated 4 years ago · None stated GitHub repository of SlimTrades 2m

Backtest Broken

by hasnocool
106 stars

Demonstration strategy designed to illustrate backtest execution mechanics and potential evaluation anomalies in Pine Script. When no position is open, the strategy uses a pseudo-random function to trigger long entries. Upon entering, it immediately establishe

Strategy v5
Updated 2 years ago · GPL-3.0 GitHub repository of Backtest Broken
13 stars

The Ruckard Cuneyt OBVRSI A002 strategy combines On-Balance Volume (OBV) and Relative Strength Index (RSI) thresholds to generate trade entries, DCA rebuys, and exits. Built primarily for crypto automation via Zignaly webhooks, it opens positions when OBV RSI

Strategy v5 Oscillators & momentumVolume
Updated 1 year ago · None stated GitHub repository of Ruckard Cuneyt OBVRSI A002

GT EMA

by eddiebelaval
7 stars

This strategy uses two EMAs with a trend filter to generate crossover signals on the price chart. It applies game theory validation through Nash equilibrium detection and expected utility calculations based on RSI and volume. Trades enter on confirmed crossove

Strategy v6 TrendOscillators & momentum Repaints
Updated 3 months ago · None stated GitHub repository of GT EMA

PF Analyzer (PineForge)

by pineforge-4pass
1 stars

PF Analyzer (PineForge) is a multi-mode validation strategy designed to benchmark trade execution timing and parity against backtesting engines. It provides four selectable operational modes: a clock pulse for fixed intraday time entries and exits, a 60-minute

Strategy v6 Sessions & timeBreakout
Updated 7 days ago · Apache-2.0 GitHub repository of PF Analyzer (PineForge)
1 stars

This strategy calculates rate of change momentum across multiple user-defined symbols and ranks them using arrays. It rotates capital into the highest-performing asset symbol at scheduled bar intervals by closing all existing positions and entering a long trad

Strategy v6 Oscillators & momentumScreeners & dashboards
Updated 2 months ago · None stated GitHub repository of TN Momentum Swarm Sovereign v6

SlimTrades 4h

by tseitz
1 stars

A Pine v4 strategy using a 12/26 MACD, a 14-period RSI, a five-bar SMA and fast and slow rolling high and low lookbacks of five and forty-eight bars. Inputs set trailing-stop percentages for both sides, RSI bottom and top levels, a highest MACD close level, ad

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

This strategy trades breakouts beyond custom Bollinger Bands and closes positions upon mean reversion back to the central moving average. It enters long when the close crosses above the upper band and exits when the close crosses below the simple moving averag

Strategy v4 BreakoutVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger Breakout [kodify]

Backtester v5

by hasnocool
106 stars

This strategy plots a 50-period and a 200-period simple moving average on the price chart and trades their crosses. It opens a long when the fast average crosses above the slow average and closes that long on the opposite cross; shorts use the reverse crosses.

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Backtester v5

Greedy Strategy

by TWODS-CAPITAL
37 stars

The Greedy Strategy enters long or short positions based on price gaps and bar close conditions relative to current position direction. It places long entries when price gaps above the previous high and short entries on downward gaps below the previous low. Po

Strategy v5 Breakout
Updated 3 years ago · MIT GitHub repository of Greedy Strategy

Ruckard Curie B004

by ruckard
13 stars

Ruckard Curie B004 is a trend-following strategy designed for cryptocurrency trading. It generates signals by combining fast and slow moving averages calculated from high and low source prices with directional strength filtering using ADX and DI indicators. Th

Strategy v5 Moving averagesOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard Curie B004

USI Flip Strategy

by skipp-dev
1 stars

USI Flip Strategy calculates a multi-length Ultimate Speed Index (USI) consisting of six RSI lines (L0 to L5) to identify market momentum shifts on the price chart. It enters long or short positions when fast lines cross slow lines, filtered by volume ratio th

Strategy v6 Oscillators & momentumTrend
Updated 4 days ago · None stated GitHub repository of USI Flip Strategy

This strategy detects EMA crossovers on the price chart using 9 and 21 period EMAs. It sets pending long signals on fast EMA cross above slow EMA and pending exit on cross below. Entries and exits trigger only on confirmed bars via barstate.isconfirmed. Long e

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF barstate-magnifier probe 01a - isconfirmed ON

SlimTrades 5m

by tseitz
1 stars

A strategy on the price chart with defaults aimed at a 5 minute chart. It reads RSI levels and rolling highest and lowest ranges, with MACD and RSI history helpers, to open long positions and optionally shorts. Positions close on RSI close zones, a minimum per

Strategy v4 Oscillators & momentumScalping
Updated 4 years ago · None stated GitHub repository of SlimTrades 5m

Backtesting System

by hasnocool
106 stars

This strategy backtests long and short trades from an external source on the price chart. Users can wait for a deal to finish, reverse, reenter, or reopen positions. Take profit defaults to a risk-reward mode with optional partial exits, while stop loss defaul

Strategy v5
Updated 2 years ago · GPL-3.0 GitHub repository of Backtesting System

Ruckard Eve A011

by ruckard
13 stars

This strategy evaluates trend reversals using fast-paced high and low closing moving averages combined with Directional Movement Index (ADX, DI+, and DI-) strength filters. It executes long, short, or reverse entries when signal criteria and strength threshold

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard Eve A011

This strategy plots EMAs on the price chart. It signals long entries when the fast EMA crosses above the slow EMA on a barstate.isconfirmed bar and exits on opposite cross when barstate.isconfirmed. It uses fixed position sizing of 1 with no stop loss. The mai

Strategy v6 Moving averagesTrend
Updated 7 days ago · Apache-2.0 GitHub repository of PF barstate-magnifier probe 01b isconfirmed OFF

A trend-following strategy that marks entries with triangles. Trend needs a fast and slow EMA stack with a minimum slope, an optional ADX filter and an optional higher-timeframe EMA check defaulting to daily. Two entry modes are offered: a pullback continuatio

Strategy v6 TrendBreakout Repaints
Updated 8 days ago · GPL-3.0 GitHub repository of Trend Following Strategy - Triangle Entries
1 stars

A strategy that votes three order flow measures from footprint data into a weighted score. The delta agent uses net buying against total volume, the imbalance agent counts price rows where buy or sell volume dominates, and the point of control agent checks whe

Strategy v6 Volume
Updated 2 months ago · None stated GitHub repository of TN Multi-Agent OF Ensemble
1 stars

A long-focused strategy on the price chart for 5 minute data. It draws rolling highest and lowest levels over two lookbacks and uses RSI zones, with MACD and RSI history, to decide when to buy and when to close. Inputs set the RSI open and close zones, a minim

Strategy v4 Oscillators & momentumSupport & resistance
Updated 4 years ago · None stated GitHub repository of SlimTrades 5m Longs Only

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