Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 63)

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

PineForge — Sextant CCI HMA

by pineforge-4pass
1 stars

PineForge — Sextant CCI HMA is a trend-following momentum strategy that combines the Commodity Channel Index with a Hull Moving Average filter. The strategy opens long positions when the CCI crosses above a specified entry level, provided the HMA is rising and

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Sextant CCI HMA

Ezieh Str.v2

by hasnocool
106 stars

Ezieh Str.v2 is a momentum and volatility strategy combining Bollinger Bands with two distinct RSI periods to identify trading opportunities. It opens long positions when a fast RSI crosses above an oversold threshold while price crosses over the lower Bolling

Strategy v4 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Ezieh Str.v2
1 stars

This overlay strategy keeps a bounded deque of one-bar rate-of-change values and measures how many are positive and their average. It enters one long position of two units when the positive share rises through the minimum share, the average return is positive,

Strategy v6 Oscillators & momentumMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Spectrum Array Deque

Fibs Limit Only

by hasnocool
106 stars

Fibs Limit Only is an automated limit order strategy designed for crypto futures trading. It calculates pivot highs and lows over a user-defined length to establish Fibonacci retracement and extension levels. Traders select a specific Fibonacci tier to place l

Strategy v4 Support & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Fibs Limit Only

PineForge — Terrace Pyramid

by pineforge-4pass
1 stars

This strategy plots the Trend EMA and Deep Terrace levels on the price chart to identify rising trends. It signals long pyramid entries in staged terraces when price crosses above the first, second, or third ATR-based levels during an upward trend, with up to

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Terrace Pyramid

Golden Buy

by hasnocool
106 stars

This strategy runs on the price chart under the title golden buy. It sets cash order size and a percent commission. Traders adjust an ATR stop-loss multiplier and a risk-reward ratio, and they can enable shorts or divergence filters. The visible inputs configu

Strategy v4 Oscillators & momentumDivergence
Updated 2 years ago · GPL-3.0 GitHub repository of Golden Buy
1 stars

This strategy computes the MACD with user-defined fast, slow, and signal lengths, then plots the MACD line, signal line, and histogram in a separate pane. It generates long entries on MACD crossover and short entries on MACD crossunder, but restricts signals t

Strategy v6 Oscillators & momentumSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Waypoint Weekday MACD

Highs and lows

by hasnocool
106 stars

Calculates dynamic entry and exit price levels based on rolling lowest and highest bars with optional Average True Range (ATR) offsets. It places limit orders to enter long positions at the lowest price level and exits at the highest price level. An optional t

Strategy v4 Mean reversionSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Highs and lows

Pivot Array Breakout

by pineforge-4pass
1 stars

Pivot Array Breakout is a breakout strategy that tracks dynamic pivot high resistance and pivot low support levels using array buffers. When a new pivot is identified, it is added to a size-limited array while older levels are removed. The strategy enters a lo

Strategy v6 BreakoutSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Array Breakout
106 stars

This strategy enters long trades based on standard Stochastic oscillator conditions combined with a 60-minute higher-timeframe trend filter. It opens positions when lower-timeframe Stochastic %D is below a buy threshold and both lower and higher-timeframe %D l

Strategy v4 Oscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of IK 60-15 Stochastic Strategy

Pivot Extension Break

by pineforge-4pass
1 stars

A strategy that detects confirmed swing highs and lows using left and right bar counts, remembers the latest of each, and trades breaks of them. It goes long when the close exceeds the last confirmed pivot high and short when the close falls below the last con

Strategy v6 BreakoutSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Extension Break

Line Break Strategy

by hasnocool
106 stars

Line Break Strategy generates trading signals by fetching Line Break chart data using a synthetic ticker context. It plots custom Line Break candlesticks in a separate pane and checks whether the line break bar closed higher or lower than its open. The strateg

Strategy v4 TrendCandlestick patterns Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Line Break Strategy

Pivot Point Levels Break

by pineforge-4pass
1 stars

A minimal strategy using the built-in Traditional pivot point levels. Each bar's levels are computed from the previous bar's high, low and close. It enters long when the close crosses above the first resistance level and short when it crosses below the first s

Strategy v6 Support & resistanceBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Point Levels Break

MA5X_L

by hasnocool
106 stars

MA5X_L is a long-only trend-following momentum strategy built on weighted and simple moving averages combined with an ATR trailing exit. It calculates four moving averages (short, medium, long, extra-long WMA/SMA) and enters long trades when the short WMA cros

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of MA5X_L

PVT EMA Cross

by pineforge-4pass
1 stars

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

Strategy v6 Volume
Updated 6 days ago · Apache-2.0 GitHub repository of PVT EMA Cross
106 stars

Order At Specified Time is a TradingView strategy that executes trades at a designated time of day within a specified backtest date range. At the user-configured UTC hour and minute, the strategy enters a short market position while simultaneously placing a lo

Strategy v4 Sessions & time
Updated 2 years ago · GPL-3.0 GitHub repository of Order At Specified Time

Hercules Srategy

by g-moe
3 stars

This strategy detects momentum breakouts identified as lightning candles where the absolute candle body size exceeds a user-defined tick threshold. It enters long positions on large bullish candles and short positions on large bearish candles, with an option t

Strategy v5 BreakoutOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Hercules Srategy

Range Filter

by pineforge-4pass
1 stars

Calculates an exponential moving average of candle ranges scaled by a multiplier to build an adaptive, stateful trend filter. It updates dynamic upper and lower bands that drift with price action and track market direction. The strategy enters long when the fi

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of Range Filter

Prototype

by hasnocool
106 stars

This strategy overlays Supertrend-style ATR trailing stop levels on the price chart alongside multi-period moving averages, volume metrics, and Bollinger Bands. It flags trend direction changes using an ATR offset channel, plotting buy and sell signals directl

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Prototype

Regex String Filter

by pineforge-4pass
1 stars

Calculates RSI and MACD indicators to evaluate trade signals parsed dynamically from an input text rule string. It uses regular expression matching to determine whether an RSI threshold rule, a MACD bullish signal line rule, or both must be satisfied. When all

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of Regex String Filter

Rapid Fire

by hasnocool
106 stars

This strategy draws on the price chart and enters long when the open crosses above the Parabolic SAR and is above a 50-period simple moving average of close. It enters short on the opposite cross below that average. Offset prices of 0.5 percent and 1.5 percent

Strategy v4 TrendMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Rapid Fire

RSI 14 Cross 50

by pineforge-4pass
1 stars

A minimal strategy that trades the 14-period RSI crossing the 50 midline. It enters long when RSI crosses up through 50 and short when it crosses down through 50, reversing the position on each opposite signal so only one direction is held at a time. It has no

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI 14 Cross 50

Simple MA 200 Cross

by hasnocool
106 stars

This strategy calculates a simple moving average of closing prices and executes a basic trend-following system on the main chart. It enters a long position when the closing price crosses above the moving average and exits the position when the price crosses be

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Simple MA 200 Cross

RSI EMA Signal

by pineforge-4pass
1 stars

A strategy that smooths the RSI with an EMA and trades crossovers between the two. It enters long when RSI crosses above its signal line while RSI is below 50, and short when RSI crosses below its signal while RSI is above 50. RSI length and signal length are

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI EMA Signal

This strategy overlays buy and sell signals on the price chart by combining selectable RSI conditions, ADX trend rules, and EMA pullback filters. Users can configure the RSI mode, toggle global EMA trend filtering, enforce EMA pullback requirements, and limit

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of SirPoggy Simple and Effective RSI Strategy

RSI MACD Combined State

by pineforge-4pass
1 stars

A minimal strategy that stays long while two conditions hold together: a 14-period RSI above 50 and the MACD line above its signal line, using 12, 26 and 9 settings. When either condition fails, it closes the long position. It never goes short, has no adjustab

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI MACD Combined State

Spread Entry Strategy

by hasnocool
106 stars

This strategy overlays bull and bear setup filters on the price chart. It compares a reference symbol, QQQ by default, on the daily timeframe with hot and cool percent-change levels, then combines RSI, DMI, three simple moving averages, Bollinger Bands, and Ke

Strategy v4 TrendOscillators & momentum Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Spread Entry Strategy

RSI with Bollinger Bands

by pineforge-4pass
1 stars

Calculates the Relative Strength Index (RSI) and wraps Bollinger Bands directly around the RSI series rather than price. It enters long positions when the RSI drops below its lower band and hooks back upward, and enters short positions when the RSI exceeds the

Strategy v6 Oscillators & momentumVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of RSI with Bollinger Bands
106 stars

This strategy evaluates trade entries by combining Stochastic RSI crossovers with MACD momentum and three exponential moving averages (8, 15, and 50 EMAs). Positions are filtered by directional alignment across indicators and date ranges. Exits are managed via

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Stoch RSI Crossover Strat + EMA

Session Isfirstbar VWAP Anchor

by pineforge-4pass
1 stars

A test strategy from a reference corpus that builds a VWAP restarted on the first bar of each trading session, using typical price times volume during market hours. It buys one unit when the close crosses above this session VWAP and closes the long when the cl

Strategy v6 Sessions & timeSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of Session Isfirstbar VWAP Anchor

Stochastic

by hasnocool
106 stars

This strategy combines a smoothed stochastic oscillator with three exponential moving averages. It opens a long position of 1000 units when the stochastic K line crosses above D and the 5-period and 15-period EMAs both cross above the 50-period EMA. It closes

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Stochastic

Session islastbar flatten

by pineforge-4pass
1 stars

This strategy enters long positions when a 9-period Simple Moving Average (SMA) crosses above a 21-period SMA during active market session hours. To avoid holding positions overnight, it automatically exits all open trades on the final bar of the session using

Strategy v6 Moving averagesSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of Session islastbar flatten

This strategy demonstrates how to place and cancel pending stop orders with syntax formatted for MT4 and MT5 webhook bridges. It generates entries using a smoothed Stochastic oscillator crossover and crossunder. Stop orders are placed at a configurable tick di

Strategy v4 Oscillators & momentumSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of TradingView Alerts to MT4 MT5 example with cancelling pending orders

Session Ismarket NYSE RTH Gate

by pineforge-4pass
1 stars

A test strategy from a reference corpus that only trades during regular market hours as reported by the session variable. Within those hours it buys one unit when a 9-period simple moving average crosses above a 21-period one and closes the long on the opposit

Strategy v6 Moving averagesSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of Session Ismarket NYSE RTH Gate

Triple EMA Scalper

by hasnocool
106 stars

This strategy plots three moving averages on the price chart, although the calculations use simple moving averages despite the EMA title. It enters long when the fastest average crosses above the other two and short when it crosses below them, limited to the L

Strategy v4 Moving averagesScalping
Updated 2 years ago · GPL-3.0 GitHub repository of Triple EMA Scalper

Session ispremarket NASDAQ gate

by pineforge-4pass
1 stars

This strategy evaluates premarket session activity on equity markets like NASDAQ. During premarket hours, it enters a long position whenever an intraday candle closes higher than its open price. Once the regular market session opens, the strategy automatically

Strategy v6 Sessions & timeOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of Session ispremarket NASDAQ gate

XAG strategy 1h

by hasnocool
106 stars

This overlay strategy is aimed at silver and combines a length-based simple moving average with a MACD-style histogram. Inside a user-set date window it looks for bullish or bearish candles aligned with the average and a rising or falling histogram. One mode a

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of XAG strategy 1h

Slow Stochastic Cross

by pineforge-4pass
1 stars

A strategy based on the slow stochastic oscillator. Raw %K is smoothed into slow %K and then averaged into %D, with adjustable lengths. It enters long when slow %K crosses above %D while below 80, and short when it crosses below %D while above 20, reversing th

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of Slow Stochastic Cross

Stochastic RSI

by pineforge-4pass
1 stars

This strategy calculates a smoothed Stochastic RSI oscillator and generates trading signals based on overbought and oversold crossovers. It opens a long position when the %K line crosses above %D while below the oversold threshold, and enters short when %K cro

Strategy v6 Oscillators & momentumMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of Stochastic RSI

Range Filter

by g-moe
3 stars

Range Filter is a chart strategy that estimates a smoothed price range from absolute bar-to-bar changes using two exponential averages and a multiplier. It plots a filtered price line plus high and low target bands on the price chart, colors bars by filter dir

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Range Filter

Supertrend ADX Filter

by pineforge-4pass
1 stars

The Supertrend ADX Filter strategy calculates Supertrend direction and ADX strength to generate trend signals. It plots the Supertrend line on the price chart in green for bullish and red for bearish. Long entries trigger on Supertrend direction change to bull

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of Supertrend ADX Filter

RSI Strategy

by g-moe
3 stars

The RSI Strategy calculates the Relative Strength Index with a user-defined length. It generates long entries on crossover above the oversold threshold and short entries on crossover below the overbought threshold. The strategy overlays signals directly on the

Strategy v5 Oscillators & momentumMean reversion
Updated 5 months ago · None stated GitHub repository of RSI Strategy

Swing Pivot ATR

by pineforge-4pass
1 stars

Swing Pivot ATR is a trend-breakout strategy that identifies swing highs and lows using pivot points and enters positions on price breakouts. It tracks historical pivot high and low levels, plotting them as steplines directly on the price chart. When price clo

Strategy v6 TrendBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of Swing Pivot ATR
1 stars

This strategy evaluates intraday trading execution for US equities during regular trading hours while handling overnight gaps. It calculates a 14-period Relative Strength Index (RSI) across price history without daily resets. Trades are gated by the market ses

Strategy v6 Oscillators & momentumSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of Symbol Equity RTH + Overnight Gaps AAPL

Tally Volume Index ROC

by pineforge-4pass
1 stars

A long-only strategy that measures the rate of change of the Negative Volume Index and Positive Volume Index over separate windows. It enters long when both growth rates first exceed their minimum thresholds and price is above a trend EMA. It exits when either

Strategy v6 VolumeTrend
Updated 6 days ago · Apache-2.0 GitHub repository of Tally Volume Index ROC

TArec_p02_UNT

by pineforge-4pass
1 stars

The strategy tests untested TA classes including ALMA, SAR and rolling correlation under bar magnifier. It enters long only when ALMA crosses above close, SAR flips below price and 20-period correlation of close and volume is positive. It exits long when SAR f

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

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