Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 8)

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

Mxwll Suite Strategy

by nishimweprince
1 stars

A strategy built on a smart money concepts toolkit that draws internal and external market structure with break of structure and change of character labels, swing order blocks, fair value gaps, previous day and 4-hour highs and lows, and automatic Fibonacci le

Strategy v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 1 year ago · None stated GitHub repository of Mxwll Suite Strategy
1 stars

A Pine v6 strategy on the price chart that applies a range filter to smooth price and detect direction, optionally on Heikin Ashi candles, with sampling period and multiplier settings. It also draws pivot-based support and resistance levels. Trades can be limi

Strategy v6 TrendSupport & resistance
Updated 1 year ago · MIT GitHub repository of Range Filter Buy and Sell

Trading Bot

by FedeHide
1 stars

This strategy executes long entries during a user-defined backtest time window. It calculates a 1-period Exponential Moving Average (EMA) and enters long trades automatically within the specified dates. Positions exit when the calculated EMA exceeds the positi

Strategy v5 ScalpingMoving averages
Updated 1 year ago · MIT GitHub repository of Trading Bot

ArminOscillator Strategy

by ali-derogar
1 stars

ArminOscillator Strategy is a strategy that applies a stochastic calculation to a long RSI, then smooths it into K and D lines. A long entry occurs when K crosses above D below 20 with price above a short SMA, or in a sideways case; a short entry mirrors this

Strategy v5 Oscillators & momentumMean reversion
Updated 1 year ago · None stated GitHub repository of ArminOscillator Strategy

MACD #2

by dollarkillerx
1 stars

The MACD #2 strategy plots two exponential moving averages with lengths 12 and 26 on the price chart. Buy signals trigger on the fast EMA crossing above the slow EMA when ATR(14) exceeds its prior value, entering a long position with one unit. The position clo

Strategy v5 Moving averagesOscillators & momentum
Updated 2 years ago · MIT GitHub repository of MACD #2

ema-strategy-algotrade

by akash-yellgetti
1 stars

A minimal strategy-type script for the price chart that draws a fast and a slow moving average, exponential or simple according to a toggle, and colours the lines and the area between them by the direction of the gap. Inputs set the source, the fast length at

Strategy v5 Moving averagesTrend
Updated 2 years ago · None stated GitHub repository of ema-strategy-algotrade

ITI

by darkshloser
1 stars

A Pine strategy script that overlays three SuperTrend lines with different periods and multipliers, plus a 100-period EMA, and computes the same SuperTrends on a higher timeframe set in minutes. A slope of the third SuperTrend is plotted over a bar-count input

Strategy v5 Trend
Updated 2 years ago · Apache-2.0 GitHub repository of ITI

EMA Crossover + RSI Strategy

by danielhyuncoder
1 stars

This strategy generates long signals on the price chart using EMA conditions and RSI levels. It enters long positions when the buy condition, based on EMA alignment checks over specified back bars, is satisfied. Exits occur at a stop loss calculated from the e

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · None stated GitHub repository of EMA Crossover + RSI Strategy

Grail Only Longs

by Wendigooor
1 stars

A long-only strategy based on a trailing stop approach, using a slow SMA, medium and fast EMAs, a pin bar test, and optional stochastic and money flow index filters that can read other timeframes. Exits use a trailing stop plus a hard stop expressed in pips. I

Strategy v5 TrendCandlestick patterns Repaints
Updated 2 years ago · None stated GitHub repository of Grail Only Longs

Absolute Swings Crypto

by yankeexlr
1 stars

A strategy-type script for crypto that combines Bollinger Bands (22 periods, 1.62 deviations) with %B and an 18-period RSI. It looks for %B crossing back above zero together with RSI crossing back above 28 as one sequence, and %B falling below 1.33 together wi

Strategy v5 Mean reversionOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Absolute Swings Crypto

3Commas Bot

by amico1234
1 stars

This strategy plots two moving averages on the price chart and uses their relationship to bias long or short trades. Entries can be limited to one direction or allowed to reverse. Stops sit beyond a swing high or low by an ATR multiple, and a reward-to-risk li

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of 3Commas Bot

Surfr

by RobACurtis
1 stars

A strategy that trades when price closes across a 50-period moving average after the previous close was on the other side. It also needs a Stochastic RSI condition on the chart timeframe, a limit on the stop distance in points, and agreement from a higher time

Strategy v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of Surfr

12/26-IT Strategy

by PlusGenie
1 stars

12/26-IT Strategy is a trend-following trading strategy that calculates 12 and 26 exponential moving averages alongside resistance levels and RSI bounds. It triggers long entries upon EMA crossovers, optionally filtered by resistance pivots and RSI ranges. The

Strategy v5 TrendMoving averages
Updated 2 years ago · MPL-2.0 GitHub repository of 12/26-IT Strategy

This intraday strategy opens a long when the MACD histogram crosses above zero and a short when it crosses below, only inside a chosen session and only while ADX is below a threshold of 25. Each trade has a fixed point-based stop loss and take profit relative

Strategy v5 Oscillators & momentumSessions & time
Updated 2 years ago · None stated GitHub repository of Day Trading With MACD and Point Target Stop

ADX Breakout

by merdunal
1 stars

A strategy that treats a low ADX, below 18 by default, as consolidation. It draws a box from the highest high and lowest low of the last 20 bars and enters when price crosses the box edge while ADX is low. The stop loss is half the box width and the profit tar

Strategy v5 BreakoutVolatility & bands
Updated 2 years ago · None stated GitHub repository of ADX Breakout
1 stars

A strategy that applies a k-nearest-neighbours classifier to RSI, ROC, CCI or volume features to estimate the next move, then trades long and or short with an optional moving average filter and volatility filter. Each position uses an ATR-multiple stop loss, a

Strategy v5 AI / machine learningTrend Repaints
Updated 2 years ago · None stated GitHub repository of kNN-Based Trend Following

GetTrend Strategy

by Bojack960
1 stars

This strategy tracks trends by comparing higher-timeframe open and close prices fetched via security calls. When the higher-timeframe close crosses above the open, a buy signal triggers, and a cross below triggers a sell signal, plotted with chart labels and c

Strategy v4 Trend Repaints
Updated 2 years ago · None stated GitHub repository of GetTrend Strategy
1 stars

A very simple strategy that opens a long position when the close has fallen for six bars in a row, and closes it on the first bar that closes higher than the previous bar. It sizes each trade at all of the account equity and has no stop loss or take profit. Th

Strategy v5 Mean reversion
Updated 2 years ago · None stated GitHub repository of Markov Down-Streak Strategy

2Mars Strategy

by facejungle
1 stars

A multi-entry strategy combining a moving average cross, Bollinger Band touches and an optional SuperTrend confirmation. Extra orders can open when price reaches chosen outer bands, up to three entries in the same direction. Take-profit levels use standard dev

Strategy v5 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of 2Mars Strategy

My Strategy

by athul-22
1 stars

This strategy generates trading signals using simple moving average crossovers combined with closed trade results. It opens a long position when a 14-period simple moving average crosses above a 28-period simple moving average, and opens a short position when

Strategy v5 Moving averagesTrend
Updated 3 years ago · None stated GitHub repository of My Strategy

Kondor EMA

by arrabyte
1 stars

Strategy that trades crossovers of a 7-period and a 25-period EMA, filtered by a 200-period EMA: longs when the fast line crosses above and the slow line is above the trend line, shorts in the opposite case. Stop loss uses an ATR multiple, with a risk-reward t

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of Kondor EMA
1 stars

A strategy that scores MACD, on-balance volume, ADX and DMI conditions into a single value and trades on that value. Inputs set long entry and exit thresholds and short entry and exit thresholds, along with DMI and ADX lengths and signal levels. Long and short

Strategy v5 Oscillators & momentumTrend
Updated 3 years ago · None stated GitHub repository of Money Printer Go BRRRRRR Backtest

X Trend

by Sikako
1 stars

X Trend is an overlay strategy that identifies trend direction and potential entry points using a custom X Trend trailing line, exponential moving averages, and Half Trend calculations. It includes optional Impulse MACD filtering designed to avoid ranging mark

Strategy v5 TrendMoving averages
Updated 3 years ago · None stated GitHub repository of X Trend
1 stars

A strategy that combines an Ichimoku-style cloud built from Donchian midpoints, MACD, a stochastic and ATR on the price chart. ATR-based stop loss and take profit multipliers, each defaulting to 1.0, set exit distances. A position side setting limits trading t

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · MIT GitHub repository of FXFUNDINGMATE Trend Indicator

12-BB

by sam30606
1 stars

This overlay strategy combines a Bollinger-style band with separate ATR upper and lower envelopes and optional ADX, Volume Flow Indicator, and RSI filters. It sizes positions as a percentage of equity. Settings change band length and multiplier, ATR periods an

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of 12-BB
1 stars

A strategy written for 15-minute charts that looks for pullbacks within an uptrend. It requires the 50 EMA above the 200 EMA, the close below the 50 EMA, a recent oversold reading on a smoothed Stochastic RSI, and a stochastic cross up that is higher than an e

Strategy v5 Oscillators & momentumMean reversion
Updated 3 years ago · GPL-3.0 GitHub repository of Fluffy 15M Stochastic RSI Top
1 stars

A long-only strategy hard-coded to the BTCUSDT 5-minute series through a security request. It enters long when price crosses a 9-period simple moving average while RSI is below 50. It closes all positions when price is one percent above the average entry price

Strategy v5 Moving averagesMean reversion
Updated 3 years ago · MIT GitHub repository of Advanced Crypto Trading Strategy

FTSMA

by timurista
1 stars

A strategy that uses a Fourier transform of recent prices, with a selectable lookback and three chosen sinusoid components, together with fast, medium and slow moving averages of selectable type, including EMA, ALMA and FRAMA. Optional linear regression smooth

Strategy v4 Moving averagesTrend Repaints
Updated 3 years ago · None stated GitHub repository of FTSMA

Btcperp H1

by WMW333
1 stars

This Pine v4 strategy trades Bitcoin perpetual futures on an hourly chart using candle spikes and volume. It goes short on a green candle with a large upper spike and goes long on a red candle with a large lower spike, when volume exceeds a threshold, the prio

Strategy v4 VolumeBreakout
Updated 4 years ago · None stated GitHub repository of Btcperp H1
1 stars

This strategy template plots indicators directly on the price chart, including exponential moving averages, relative strength index, and average directional movement. It incorporates position management options such as account leverage, percentage-based positi

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Strategy Template

Eth Strategy

by samliu0206
1 stars

This script aggregates spot and perpetual futures price data across multiple cryptocurrency exchanges to calculate a volume-weighted futures premium index. It computes the log ratio between perpetual futures and spot prices, applies a user-selected moving aver

Strategy v4 Moving averagesMean reversion
Updated 4 years ago · None stated GitHub repository of Eth Strategy

Hammers & Stars Strategy

by namdar-nejad
1 stars

This Pine v4 strategy trades hammer and shooting star candles on the price chart. Entry candles can be filtered by size relative to ATR and by an optional EMA, and a Fibonacci level defines how far into the candle the close must be. Stop loss is an ATR multipl

Strategy v4 Candlestick patterns
Updated 4 years ago · None stated GitHub repository of Hammers & Stars Strategy

This strategy draws a Donchian channel with a very long default period of 1440 bars, its midline and a 250-period simple moving average. It places limit orders to sell at the upper band after a high touches it and to buy at the lower band after a low touches i

Strategy v4 BreakoutMean reversion
Updated 4 years ago · MIT GitHub repository of Greeffer's Donchian Channel Strategy
1 stars

This trend-following strategy overlays fast and slow Hull Moving Averages, Parabolic SAR, Chaikin Money Flow, a Volume Oscillator, and Heikin Ashi candle confirmation on the main price chart. Long entries occur when price and fast HMA are above the slow HMA, S

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of KRJ Swing HMA Volume Sar HA
1 stars

This strategy builds trades from two configurable moving averages, each selectable from eleven types with its own source, length, offset and ALMA settings. Optional modules add RSI-based take profit and stop levels and an ATR comparison as confirmation, and it

Strategy v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of All Moving Average Strategy

Stoch Strat

by GoatGodXBT
1 stars

Stoch Strat is an overlay trading strategy that combines Stochastic Oscillator crossovers, MACD histogram momentum, and 50/100 Exponential Moving Averages for trend filtering. It generates long signals when Stochastic crosses up in oversold conditions while pr

Strategy v5 TrendOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Stoch Strat

Commercial Strategy

by AnimaLibera
1 stars

This Pine v4 strategy is built on the weekly CFTC net position of commercial traders in commodity or financial futures, requested by contract code from an external Quandl data feed. It scales the net position within its three-year range into an index, and trea

Strategy v4
Updated 5 years ago · Custom licence GitHub repository of Commercial Strategy

MACD Rise and Fall

by RayRuizheLi
1 stars

This strategy calculates the MACD line and plots it as a colored histogram in a separate pane. Instead of traditional crossovers, it tracks consecutive rising or falling values on the MACD line. It enters long positions after a configurable number of consecuti

Strategy v4 Oscillators & momentumMoving averages
Updated 6 years ago · None stated GitHub repository of MACD Rise and Fall

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated yesterday · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
330 stars

This strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities. It enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specifi

Strategy v5 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger bands + Aroon [Alorse]
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
193 stars

This strategy calculates a chart-timeframe MACD oscillator alongside a higher-timeframe Simple Moving Average (SMA) trend filter using security requests. It triggers long signals when the MACD line crosses above its signal line while the higher-timeframe price

Strategy v6 TrendOscillators & momentum
Updated yesterday · Apache-2.0 GitHub repository of PineForge MTF Tutorial — HTF SMA Filter

200DMA last DOM - ajh

by hasnocool
106 stars

This strategy executes a long-only trend-following system based on a simple moving average, designed primarily for daily charts. It plots the moving average directly on the price chart and evaluates trading signals strictly on a user-defined day of the month,

Strategy v5 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 200DMA last DOM - ajh
104 stars

This strategy combines Bollinger Bands with a short RSI to fade moves that leave the bands and then return. A long requires the prior bar below the lower band and oversold, then a close back inside the band while RSI is between 30 and 50. Shorts mirror that at

Strategy v5 Oscillators & momentumVolatility & bands
Updated 3 years ago · MIT GitHub repository of Bollinger Bands and RSI Strategy

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