Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 62)

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

1 stars

This strategy calculates a fast EMA, a slow EMA, and an ATR value to implement a trend-following trading model with cash position sizing. It enters long trades when the fast EMA crosses above the slow EMA. Positions are exited when the fast EMA crosses below t

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Cashflow Cash Costs

Buy and hold strategy

by hasnocool
106 stars

This strategy simulates a buy-and-hold or short-and-hold position across a user-defined date window. It enters a single long or short position when the bar time reaches the start date and holds that position continuously until the end date passes, where it tri

Strategy v4
Updated 2 years ago · GPL-3.0 GitHub repository of Buy and hold strategy

Session Wicks

by g-moe
3 stars

Session Wicks is a price-chart strategy that combines a Heikin Ashi weighted moving average, an RSI compared with its moving average, and a smoothed stochastic. Bullish and bearish states come from the Heikin Ashi average falling or rising and from RSI sitting

Strategy v5 Oscillators & momentumMoving averages
Updated 5 months ago · None stated GitHub repository of Session Wicks
1 stars

The PineForge Compass Partial Ladder strategy identifies trend-following opportunities using a fast and slow Exponential Moving Average (EMA) crossover. Upon entering a long position, the strategy manages risk and profit targets using Average True Range (ATR)

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Compass Partial Ladder

This strategy tests calendar-day buy-and-hold timing on the price chart. Inside a user-set start and end date, it opens a long entry whenever the calendar day of the month matches the entry day. If the exit-day option is on, it closes every position on the day

Strategy v4 Sessions & time
Updated 2 years ago · GPL-3.0 GitHub repository of Buy and Hold, which day of month is best to buy?
1 stars

PineForge — Constellation Bands is a mean-reversion strategy displayed on the price chart. It calculates standard Bollinger Bands alongside price volatility. A long entry triggers when the close price crosses back above the lower band while remaining below the

Strategy v6 Mean reversionVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Constellation Bands

Buy Any Bar By Chenyco

by hasnocool
106 stars

This dollar-cost averaging backtesting strategy executes periodic buy entries within a user-defined date window. The script calculates position size based on a fixed USD amount input for each executed trade, accumulating long positions at regular intervals. On

Strategy v4
Updated 2 years ago · GPL-3.0 GitHub repository of Buy Any Bar By Chenyco
1 stars

This strategy uses RSI with bull and bear threshold crossovers to trade opposite market pairs. It enters long when RSI crosses above 58 and short when below 42, automatically closing the opposite position first. Entry size is 8 percent of equity with 0.05 perc

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Crosscurrent Market Pair

Buy every Month

by hasnocool
106 stars

This strategy simulates a monthly dollar-cost averaging investment plan over a user-defined date range. It executes an initial long position at the start of the date window and continues to add long entries at the start of each subsequent month or year. Positi

Strategy v4
Updated 2 years ago · GPL-3.0 GitHub repository of Buy every Month
1 stars

This strategy models market regimes using principal variance concentration between price and volume. It builds a 2x2 correlation matrix from price and volume rate-of-change, then calculates its eigenvalues. It enters long positions when the principal eigenvalu

Strategy v6 TrendVolume
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Eigen Matrix Covariance

Buy The Dip

by hasnocool
106 stars

Calculates a historical dip level based on the lowest low over a specified lookback period. It enters a long strategy position when the current bar close falls below the previous dip level. Positions are managed with take profit and stop loss exits placed at f

Strategy v4 Mean reversionVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dip
1 stars

This strategy plots adaptive upper and lower triggers on the price chart. It builds the channel from the highest high and lowest low over channelLength bars, then adjusts the width by the average logarithmic price movement captured across the lookback period u

Strategy v6 BreakoutVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Forge Loop Channel
106 stars

Buy The Dips - MA200 Optimised is a mean-reversion strategy that measures short-term percentage price changes alongside a simple moving average trend filter. It opens long positions when price experiences a steep drop exceeding three percent while remaining ab

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dips - MA200 Optimised
1 stars

The Pine Script strategy calculates fast and slow EMAs along with RSI and ATR on the price chart. It enters long positions when the configuration string matches trend confirmation, fast EMA crosses above slow EMA, and RSI exceeds a threshold. It exits on fast-

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Glyph String Regex
106 stars

This trend-following strategy identifies buying opportunities during bullish pullbacks on the price chart. It defines a bull market when the 50-period simple moving average trades above the 200-period moving average. Long entries trigger when the RSI drops bel

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Buy The Dips in Bull Market

Supertrend

by g-moe
3 stars

This strategy calculates trend direction using a multi-timeframe Supertrend formula based on ATR and median price, paired with RSI and Bollinger Band indicators. It enters positions when the Supertrend flips direction, plotting uptrend and downtrend bands with

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Supertrend
1 stars

This strategy plots a trend EMA and a working pullback limit on the price chart. It enters long only when flat, the EMA is rising, and close is above the EMA, placing a limit buy a set fraction of ATR below the EMA. If that trend condition fails while still fl

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Keystone Limit Pullback
106 stars

This strategy plots on the price chart and opens one buy-and-hold position between a user-chosen start and end time. By default it enters long with 100 percent of equity when the bar time is inside that window; a boolean input switches the same entry to short.

Strategy v4
Updated 2 years ago · GPL-3.0 GitHub repository of Buy-and-hold strategy stats
1 stars

The Kiln Power Efficiency strategy computes an EMA trend line and a squared displacement efficiency metric from price moves relative to ATR. It plots both on the price chart. The strategy enters long trades on EMA crossover above the trend when efficiency exce

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Kiln Power Efficiency
106 stars

This strategy executes trend-following breakout trades based on Donchian channels, moving average alignment, and long-term price extremes. It evaluates alignment across seven moving average periods alongside multi-period and yearly high or low filters. Long po

Strategy v4 TrendBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BuyHigh-SellLow Strategy
3 stars

This strategy plots exponential moving averages of length 1, 15, and 21 on the price chart and also calculates a length-5 simple moving average. It enters long when the length-1 average crosses above the length-15 average and the close is above the previous cl

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of 2 EMA cross 10 EMA Strategy
1 stars

This strategy enters long when the fast EMA crosses above the slow EMA and RSI exceeds the entry threshold. It closes when the fast EMA crosses under the slow EMA, RSI falls below the exit threshold, or the open position reaches the maximum hold bars. A stop s

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Lattice Confirmed Pivot
106 stars

This strategy calculates higher-timeframe pivot points, defaulting to Fibonacci calculations across configurable resolutions or symbol-based multipliers. It evaluates price interactions against these pivot levels to execute trades according to the selected tra

Strategy v4 Support & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of BuyHighSellLow - Pivot points

Gap Filling Strategy

by regalouisei
2 stars

This strategy detects daily opening gaps and trades them on the price chart. It marks an up or down gap from the current open and close versus the previous bar, then stores the prior extreme as the fill level. By default it buys down gaps and shorts up gaps, e

Strategy v4 Mean reversionSessions & time Repaints
Updated 8 months ago · None stated GitHub repository of Gap Filling Strategy

PineForge — Ledger History NA

by pineforge-4pass
1 stars

This strategy plots a smoothed historical price anchor on the price chart by averaging historical closing prices. It enters a long position when price crosses under an entry threshold set below the smoothed anchor. The trade closes when price crosses back abov

Strategy v6 Mean reversionMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Ledger History NA

BuyTheDip

by hasnocool
106 stars

BuyTheDip is a strategy script that identifies upward moving average alignments across multiple timeframes using SMA, EMA, HMA, RMA, VWMA or WMA types. It plots Bollinger Bands on the price chart and enters long positions when alignment scores reach 1 and pric

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

This strategy demonstrates position sizing with leverage and margin in Pine Script using a Stochastic Oscillator indicator. It plots the %K and %D lines in a separate pane with upper and lower threshold levels. Long entries trigger when %K crosses above %D bel

Strategy v4 Oscillators & momentum
Updated 8 months ago · None stated GitHub repository of How to Use Leverage and Margin in PineScript
1 stars

This strategy trades long only on the price chart. It enters when a fast exponential moving average crosses above a slower one and sizes the next order from the last closed trade: the recovery quantity after a negative result and the full quantity otherwise. I

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Ledger Outcome Throttle
106 stars

This strategy plots an Ichimoku cloud on the price chart and opens long or short trades from a selectable crossover. Signal choices cover Tenkan and Kijun, price against those lines or the cloud, and cloud color, with optional confirmation that price is beyond

Strategy v4 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of BV's ICHIMOKU CLOUD SIGNAL TESTER
2 stars

This strategy plots in a separate pane and tests a selected oscillator with one of six entry logics: moving average, moving-average crossover, zero cross, extremes, mean reversion, or take profit. Users scale and time-adjust one of three oscillators and can li

Strategy v4 Oscillators & momentumMoving averages
Updated 8 months ago · None stated GitHub repository of Oscillator Evaluator (Analysis tool)
1 stars

The PineForge — Meridian DMI Regime strategy evaluates trend direction and momentum using the Directional Movement Index, Average Directional Index, and an Exponential Moving Average. It enters long trades when +DI crosses above -DI, provided ADX exceeds the d

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Meridian DMI Regime
106 stars

This strategy evaluates multiple MACD entry techniques on the price chart. It calculates standard or SMA-based MACD line, signal line, and histogram values, offering selectable trigger models including continuation crosses, reversal crosses, histogram zero cro

Strategy v4 Oscillators & momentumMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of BV's MACD SIGNAL TESTER

PMax Explorer

by regalouisei
2 stars

The PMax Explorer strategy calculates the Profit Maximizer indicator by applying an ATR trailing stop band to various moving average types including EMA, VAR, ZLEMA, and TSF. It plots the selected moving average and PMax line directly on the price chart to tri

Strategy v4 TrendMoving averages
Updated 8 months ago · None stated GitHub repository of PMax Explorer

PineForge — Mosaic Map Regime

by pineforge-4pass
1 stars

PineForge — Mosaic Map Regime is a trend-following strategy that dynamically scales trading signals using volatility regimes. It calculates an Exponential Moving Average and ATR, using a map to assign risk weights based on whether ATR percentage exceeds an exp

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Mosaic Map Regime

The CDC Action Zone V.3 Test strategy calculates fast and slow exponential moving averages to generate trend-following buy and sell signals. It plots EMA lines, custom bar colors, buy and sell labels, and a visual ribbon directly on the main price chart. The s

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of CDC Action Zone V.3 Test ++Position Size Fix+Float

PineForge — Orbit MTF Trend

by pineforge-4pass
1 stars

Orbit MTF Trend is a multi-timeframe strategy that plots higher-timeframe and local exponential moving averages on the price chart. It generates long entries on local EMA crossover above the higher EMA and closes positions on the reverse crossover. Risk manage

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Orbit MTF Trend

Crypto Price Scalper

by hasnocool
106 stars

Crypto Price Scalper is a long-only trading strategy designed for cryptocurrency charts. It combines a custom price-range oscillator, calculated from the highest high and lowest low over a user-defined candle period, with the Vortex Indicator. A long trade ope

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Crypto Price Scalper
3 stars

This strategy combines two sets of Bollinger Bands with a Laguerre RSI oscillator plotted on the price chart. It generates buy and sell signals when price touches the upper or lower bands or zones. The strategy allows enabling or disabling entries and includes

Strategy v5 Mean reversionVolatility & bands
Updated 5 months ago · None stated GitHub repository of BB + LaRSI Strategy

Grid Like Strategy

by regalouisei
2 stars

Grid Like Strategy calculates a dynamic baseline overlay that steps up or down whenever price moves beyond a defined point threshold. It enters long positions when the baseline moves upward and short positions when it moves downward, automatically placing take

Strategy v4 Support & resistanceBreakout
Updated 8 months ago · None stated GitHub repository of Grid Like Strategy

PineForge — Prism Matrix Vote

by pineforge-4pass
1 stars

The PineForge Prism Matrix Vote strategy plots two EMAs on the price chart and calculates a vote score from four factors: EMA crossover, price above fast EMA, RSI above 52, and ATR relative to close. It enters long positions when the vote score crosses above a

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Prism Matrix Vote
106 stars

This strategy plots a mapped EMA-and-standard-deviation difference in a separate pane and trades moving-average crossovers filtered by that line. After the 50-period EMA crosses the 200-period SMA, it waits for price to stay on the crossover side and for the m

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of EMA Difference Mapping with Trades

Grover Llorens Activator

by regalouisei
2 stars

The Grover Llorens Activator strategy calculates a custom volatility trailing stop line based on Average True Range and price movement. It generates buy signals when price crosses above the activator line and short signals when price crosses below. Positions a

Strategy v4 TrendVolatility & bands
Updated 8 months ago · None stated GitHub repository of Grover Llorens Activator
1 stars

This strategy enters one long position when a fast exponential moving average crosses above a slow one. While the trade is open, it keeps an ATR stop and target under the same exit identifier. For the first revision hold bars those distances stay wide; afterwa

Strategy v6 Moving averagesVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Revision Exit Replacement

Estrategia Booz

by hasnocool
106 stars

This strategy trades moving-average crossovers on the price chart. It buys when a fast exponential moving average crosses above a slow one in an uptrend, and sells on the opposite cross in a downtrend. An optional source average and a longer trend filter, each

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

PineForge — Rivet Calc Fill

by pineforge-4pass
1 stars

This strategy identifies bullish trends using a fast EMA crossing above a slow EMA to enter long positions when no trade is open. Once entered it attaches a stop loss and limit order using ATR multiplied by the input values of 1.7 and 2.2 respectively. The fas

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Rivet Calc Fill

ETH_buy_3commas

by hasnocool
106 stars

This strategy overlays a Cipher B style WaveTrend study on the price chart and is titled for Ethereum buy alerts aimed at 3Commas. It calculates a WaveTrend channel and a short moving average, and can mark buy, sell, gold, and divergence dots. Settings change

Strategy v4 Oscillators & momentumDivergence
Updated 2 years ago · GPL-3.0 GitHub repository of ETH_buy_3commas

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