Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 60)

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

BBPBΔ(OBV-PVT)BB

by hasnocool
106 stars

This strategy calculates the normalized rate of change between On-Balance Volume (OBV) and Price Volume Trend (PVT) indicators. It applies Bollinger Bands to this volume metric along with a Hodrick-Prescott filter array for time series decomposition. Displayed

Strategy v4 VolumeVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of BBPBΔ(OBV-PVT)BB

PF TV golden 40 - bracket TP/SL

by pineforge-4pass
1 stars

This validation strategy executes on the price chart to test bracket order execution. It enters a single long position at 00:15 whenever flat, using a fixed quantity of one contract. Upon entry, it immediately places a bracket exit order with a 0.4% take-profi

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 40 - bracket TP/SL

BB策略

by hasnocool
106 stars

BB策略 is an overlay strategy combining standard Bollinger Bands with candlestick pattern recognition logic, including engulfing patterns, dojis, and long upper shadows. It calculates an SMA basis line and standard deviation bands, plotting them directly on the

Strategy v4 Volatility & bandsCandlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of BB策略
1 stars

The strategy enters a long position of two lots at 1:15 on the hour when no position is open. It then places a take-profit order for half the position at 0.3 percent above the average entry price and a stop-loss order for the remaining half at 0.6 percent belo

Strategy v6 Sessions & timeScalping
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 41 - partial qty percent
106 stars

The Bear & Bull Zone Signal Strategy is a trend-momentum strategy that calculates an RSI based on Heikin-Ashi closes, smoothed with fast and slow double EMAs to identify bullish and bearish zones. It also computes a Stochastic oscillator applied to RSI values.

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bear & Bull Zone Signal Strategy

PF TV Golden 42 Close Immediate

by pineforge-4pass
1 stars

A test strategy from a reference corpus that compares a normal market close with an immediate close. It buys one unit at 02:15 and closes at 03:15 in the normal way, then buys again at 10:15 and closes at 11:15 with the immediate option. Entries depend only on

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV Golden 42 Close Immediate

Best Crypto DEMA

by hasnocool
106 stars

Best Crypto DEMA is a long-only trend-following strategy that generates trading signals based on Double Exponential Moving Average crossovers. It calculates fast and slow DEMAs across a user-defined timeframe resolution, with an option to derive prices from He

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Best Crypto DEMA
1 stars

This strategy isolates global pending-order cancellation and a full position close on the price chart. At 04:15 it places a long limit at 80 percent of close and a short limit at 120 percent of close so they are unlikely to fill. At 04:30 it cancels every pend

Strategy v6
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 43 - cancel all close all

Big Bar Strategy

by hasnocool
106 stars

Big Bar Strategy identifies unusually large candles relative to a moving average of recent bar body sizes. It executes contrarian trades by opening long positions following a large bearish bar and short positions after a large bullish bar, with an optional con

Strategy v4 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Big Bar Strategy

PF TV golden 44 - OCA reduce

by pineforge-4pass
1 stars

This overlay strategy is a clock-timed validation probe for shared OCA reduce orders. When flat at 07:15 it enters one long contract. While long it places a short limit exit at 1.004 times average entry and a short stop at 0.996 times average entry, both using

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 44 - OCA reduce

Binance Liquidations

by hasnocool
106 stars

Binance Liquidations is a strategy and separate-pane indicator that estimates derivative volume activity by calculating the volume spread between Binance perps and Coinbase spot data. It applies Weighted Moving Averages and a SuperSmoother filter to the volume

Strategy v4 VolumeMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Binance Liquidations
1 stars

This strategy is a validation probe that enters one long position and later closes it. It buys when the chart time is 08:15 and the position is flat, then closes that long at 12:15. Order size is twenty-five percent of equity, and each order pays a fixed cash

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 45 - commission sizing
106 stars

The Binary Options Strategy Template is a Pine Script v4 strategy that overlays the 14-period simple moving average on the price chart. It signals long entries when the close price is above the SMA and short entries when below. Positions close automatically af

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Binary Options Strategy Template

PF TV golden 46 - risk gates

by pineforge-4pass
1 stars

This strategy probes TradingView risk gates on a 15-minute crypto chart. It allows only long entries, caps position size at two contracts, and limits filled orders to three per day. It submits fixed one-unit longs at 00:15, 00:30 and 00:45 UTC, a short at 01:0

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 46 - risk gates
106 stars

This strategy calculates custom moving averages weighted by binomial coefficients. It plots a fast and a slow binomial moving average directly on the price chart, filling the space between them according to the trend direction. A long position enters when the

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Binomial Moving Average
1 stars

This strategy isolates request.security with gaps on and lookahead off. On a 15-minute chart it requests the 60-minute close and stores the last non-empty higher-timeframe close. A roll up is a newly returned close above that stored value, and a roll down is o

Strategy v6 Trend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 47 - security gaps on

Binomial Strategy

by hasnocool
106 stars

Binomial Strategy calculates a binomial cumulative distribution of recent up bars from a longer-run up probability and smooths it with two exponential moving averages. It plots the distribution and both averages in a separate pane and colors bars according to

Strategy v4 Oscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Binomial Strategy
3 stars

Price Action Candles is an unfinished strategy script written in Pine Script v5. It plots the closing price line in a separate pane below the chart. The script does not contain any trading signals, order placement logic, exit rules, or user-configurable input

Strategy v5
Updated 5 months ago · None stated GitHub repository of Price Action Candles

PF TV Golden 48 - Time Filter

by pineforge-4pass
1 stars

This validation strategy executes trades based strictly on specific hour and minute timestamps rather than price indicators. It triggers a fixed long entry when the bar time hits 00:15 and closes the open long position at 00:45. Overlaying directly on the pric

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV Golden 48 - Time Filter

BlackSwan Strategy

by hasnocool
106 stars

This strategy detects large single-candle body expansions exceeding approximately 1.91% of price to enter momentum breakouts. It enters long positions on large bullish candles and short positions on large bearish candles. Positions are closed when the 144-peri

Strategy v4 BreakoutMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BlackSwan Strategy

PF TV Golden 49 - NA NZ History

by pineforge-4pass
1 stars

This validation strategy evaluates warmup behavior and historical references using missing value functions like nz() and fixnan(). It calculates raw price changes, substitutes missing values, and computes an eight-period simple moving average score. The strate

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV Golden 49 - NA NZ History

Bolinger strategy

by hasnocool
106 stars

This long-only strategy combines a five-bar RSI with Bollinger percent B and bandwidth on the current close and the close three bars earlier. It opens a long when a local low around that earlier bar falls inside a bar-count window and current percent B stays i

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bolinger strategy
1 stars

A test strategy from a reference corpus that exercises typed boolean matrices. It keeps a 24 by 7 grid of hour and weekday cells, marks a cell when RSI is above 60, and transposes the grid twice to check the matrix functions. It goes long when at least six cel

Strategy v6 Oscillators & momentumSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF Typed Matrix Probe 01 Bool Regime Mask
106 stars

The Bollinger %B Candles Strategy evaluates price volatility and momentum by calculating Bollinger Bands %B oscillator values in a separate pane. It incorporates customizable moving average filters, ATR multipliers, and optional higher-timeframe yearly high or

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger %B Candles Strategy

This strategy builds a 3x3 covariance matrix from three collinear price series (close, close*2, close*3) and evaluates its eigenvalues to detect rank deficiency via NaN propagation. It generates long entries and exits using a 9/21 EMA crossover on the price ch

Strategy v6 Moving averagesVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PF typed-matrix probe 02 - eigen rank deficient
106 stars

This strategy plots a 20-period simple moving average of the close and Bollinger bands from one through five standard deviations. It draws the basis and each upper and lower band on the price chart, then fills the zones between successive bands in different co

Strategy v4 Volatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger band (band display 5σ)

PF UDT probe 04 - default param

by pineforge-4pass
1 stars

This Pine Script strategy implements a custom long-only EMA crossover on the price chart. It defines a UDT struct Cfg with a threshold method that accepts default parameter values. The strategy computes RSI and ATR indicators then uses three call styles to the

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT probe 04 - default param
106 stars

This strategy enters long positions during a specified trading session when multiple technical indicators align. It executes a buy order when the low drops below the lower Bollinger Band while RSI and ADX exceed configurable threshold values, price closes abov

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band + RSI + ADX + MACD
1 stars

This strategy serves as a Pine Script v6 validation probe testing User-Defined Type (UDT) methods as conditional triggers for strategy entries. It calculates 9-period and 21-period Exponential Moving Averages to detect crossover and crossunder signals. Custom

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT Probe 14 - Method Drives Entry
106 stars

Bollinger Band Breakout is a positional strategy combining Bollinger Bands with the Relative Strength Index (RSI). It opens long positions when price crosses above the upper Bollinger Band while 14-period RSI is between 60 and 70. Short entries trigger when pr

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band Breakout
1 stars

This Pine Script v6 strategy is a validation probe for nested method calls on a user-defined type. Each bar it feeds close, a simple moving average, and standard deviation through a method chain that returns a z-score. It enters long only when that z-score is

Strategy v6 Moving averagesVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PF UDT probe 18 - method calls method

This strategy combines Volume Weighted Moving Average (VWMA) Bollinger Bands with 200-period and 50-period Exponential Moving Averages (EMAs). It identifies long trade opportunities when the 50 EMA is above the 200 EMA and price falls to or below the lower Fib

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with Fib Golden Ratio (0.618)

PF_WS01_REV

by pineforge-4pass
1 stars

This strategy uses two exponential moving averages (fast period 5, slow period 13) to detect trend changes via crossover signals on the price chart. It enters long on fast EMA crossing above slow EMA and short on the reverse crossover. The script includes expl

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF_WS01_REV
106 stars

This strategy plots RSI in a separate pane and combines it with Bollinger Bands calculated on the selected source. It opens a long when RSI is below 30 and price is below the lower band, then closes that long when RSI rises above 70. Percentage take-profit and

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band with RSI

This overlay strategy combines swing price structure with MACD structure and two higher-timeframe exponential moving averages. It finds pivot highs and lows over ten bars, labels higher highs, lower highs, higher lows and lower lows, and builds matching states

Strategy v5 TrendOscillators & momentum Repaints
Updated 5 months ago · None stated GitHub repository of Price Action Candles with MACD Signals Strategy
1 stars

This trend-following strategy calculates a primary filter using an EMA, SMA, or a blended average of both with scaled lengths, plotting it alongside a confirmation EMA on the price chart. Long positions are triggered when the primary filter crosses above the c

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Caliper Scalar Switch
106 stars

This strategy plots Bollinger Bands on the price chart using the middle band as a simple moving average and standard deviation bands. It signals long entries when the close price crosses below the middle band combined with Aroon up trending above 90 and within

Strategy v4 Moving averagesVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger bands And Aroon Scalping
1 stars

PineForge - Pendulum SAR Rotation calculates Parabolic SAR and Exponential Moving Average (EMA) values to identify trend-filtered long entries. The strategy enters a long position when price crosses above the Parabolic SAR while remaining above the trend EMA.

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Pendulum SAR Rotation
106 stars

This strategy combines Stochastic RSI and a normalized Bollinger Bands calculation into a composite oscillator named MIX, plotted in a separate pane. Long positions are entered when the MIX line crosses above the oversold threshold of 20. The strategy utilizes

Strategy v4 Oscillators & momentumVolatility & bands Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands and RSI Mix with DCA

PineForge - Relay Enum Regime

by pineforge-4pass
1 stars

This strategy executes trades based on one of two selectable regimes: trend-following or mean reversion. In trend mode, it enters long positions on a bullish EMA crossover and exits on a bearish crossover. In reversion mode, it buys when the RSI dips below an

Strategy v6 TrendMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge - Relay Enum Regime
106 stars

This strategy calculates a simple moving average basis flanked by three upper and three lower volatility bands scaled using Fibonacci ratios of the Average True Range. It enters long when the bar intersects a chosen target band and enters short when price touc

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Fibonacci Ratios

PineForge Anvil Percent Costs

by pineforge-4pass
1 stars

This Pine Script v6 strategy calculates two simple moving averages, one fast and one slow. It enters long positions when the fast SMA crosses above the slow SMA and closes long positions when the fast SMA crosses below the slow SMA. The strategy uses percent-o

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Anvil Percent Costs

Bollinger Bands Filter

by hasnocool
106 stars

This strategy plots Bollinger-style bands on the price chart from a simple moving average and a standard-deviation offset. It treats a close above the upper band as a long condition and a close below the lower band as a short condition, then colors the basis b

Strategy v4 Volatility & bandsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Filter

PineForge Archive Map Presence

by pineforge-4pass
1 stars

This strategy generates trading signals on the price chart using a regime-based RSI indicator. It selects an RSI threshold from an internal map based on the chosen regime or falls back to a configurable value. Long entries occur on RSI crossover above the thre

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Archive Map Presence
106 stars

This strategy plots customizable Bollinger Bands directly on the price chart using eleven selectable moving average types, including VAR, DEMA, ZLEMA, Hull, and Tillson T3. It generates long entry stop orders when price crosses above the lower band and short e

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy (MA type)

PineForge Atlas Array Rotation

by pineforge-4pass
1 stars

This strategy computes a rolling mean return over the last sampleCount bars and a price percent rank over rankLength bars. It also calculates RSI and ATR values. Long entries trigger when the price rank crosses above the entry rank threshold while the rolling

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Atlas Array Rotation

This strategy plots Bollinger Bands on the price chart using an EMA or SMA basis and a matching standard-deviation calculation. It enters long when price crosses back above the lower band and short when price crosses back below the upper band. An optional Intr

Strategy v4 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Strategy with Intraday Intensity Index

PineForge Breaker Method While

by pineforge-4pass
1 stars

The strategy builds a custom ThresholdLadder from RSI levels and counts how many levels the RSI value exceeds. When the required passes are reached it enters long when price crosses above the EMA trend line. It exits the position if the ladder condition breaks

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge Breaker Method While

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