Pine Library · 3,040 open-source scripts

Free TradingView Strategy Scripts (page 56)

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

4 MA Strat

by hasnocool
106 stars

Calculates four selectable moving averages (SMA, EMA, WMA, RMA, HMA, or ALMA) with custom periods to generate crossover trading signals directly on the price chart. Signals are triggered when a selected moving average crosses another, with an optional fourth m

Strategy v4 Moving averagesTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 4 MA Strat

Trailering O002

by ruckard
13 stars

This long-only strategy plots on the price chart and sizes entries according to how many trigger conditions are met. It manages exits by tightening the stop and extending the take profit from the price's maximum excursion, with optional take profit and risk-re

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

This strategy calculates a 10-period and a 20-period simple moving average directly on the price chart. It triggers long entries on SMA bullish crossovers and short entries on SMA bearish crossunders, formatting alert payloads into JSON string templates for we

Strategy v5 Moving averagesTrend Repaints
Updated 5 months ago · None stated GitHub repository of Messing with Alerts & Calc Every Tick
1 stars

This strategy is a validation probe that opens one long at 08:00 and one short at 20:00 when the position is flat. Each entry sets an ATR-based stop, a limit at twice that stop distance, and a trailing stop whose trail points equal the current ATR. ATR length

Strategy v6 Volatility & bandsSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 91 - atr trail fixed entry

Squarify v2 BT

by nishpa800
1 stars

A strategy backtest version of a 46-signal study that combines standard deviation displacement, pullback pockets, relative volume tiers and fair value gap structures. Each enabled signal can trigger a buy or sell on the price chart. Inputs set three displaceme

Strategy v5 VolumeSMC / ICT / price action
Updated 2 months ago · None stated GitHub repository of Squarify v2 BT

TnS_IctCombo_V6

by raybird
1 stars

This Pine Script strategy identifies high-confluence trading opportunities using ICT and SMC logic. It calculates a confluence score from HTF bias via EMA, FVG detection with lookback, liquidity sweep confirmation, market structure shift breaks, premium discou

Strategy v6 SMC / ICT / price actionTrend Repaints
Updated 2 months ago · None stated GitHub repository of TnS_IctCombo_V6

4x EMA + Volume

by hasnocool
106 stars

This strategy plots four exponential moving averages on the price chart and filters trades with a smoothed Ease of Movement oscillator. In the default mode it opens a long when price and the four averages are stacked upward and Ease of Movement is positive, th

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 4x EMA + Volume

Trailering P010

by ruckard
13 stars

A trading strategy that combines k-nearest neighbors (KNN) classification logic with custom position management and automated Zignaly signal execution. It evaluates historical price excursions and KNN patterns to identify entry opportunities and set dynamic ex

Strategy v5 AI / machine learning
Updated 1 year ago · None stated GitHub repository of Trailering P010
1 stars

This validation strategy tests position reversal mechanics via stop orders without explicit closing calls. It executes a long market entry at 00:15 when flat, then submits a short stop entry just below the bar low at 00:45 to trigger an automated position flip

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 92 - flip stop no paired close

TnS_StochDiv_V6

by raybird
1 stars

This Pine Script strategy detects causal reversals using a smoothed stochastic oscillator to track momentum. It identifies harmonic divergences in price versus the oscillator and applies a Kronos resonance proxy based on phase coherence. ATR dynamically sets s

Strategy v6 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of TnS_StochDiv_V6

5-10-20 Cross

by hasnocool
106 stars

This strategy combines three exponential moving averages with a Supertrend indicator to generate trend-following trade entries directly on the price chart. A long position is entered when the fastest EMA is above the medium EMA, the medium EMA is above the slo

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5-10-20 Cross

Trailering Q004

by ruckard
13 stars

Trailering Q004 is an execution strategy that generates automated trading signals integrated with Zignaly webhooks. It uses historical statistical advice and price excursion limits to enter long or short positions based on sub-strategy trigger conditions. The

Strategy v5 TrendMean reversion
Updated 1 year ago · None stated GitHub repository of Trailering Q004
1 stars

This validation strategy tests TradingView order execution behavior and position sizing during stop-entry position flips when pyramiding is set to 2. It opens long entries at specific times of day (0:15 and 6:15), sets opposite stop orders paired with exit com

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 93 - flip stop pyramiding 2

This strategy evaluates multi-factor breakout confluence using a customized scoring system on the price chart. It checks Minervini-style Volatility Contraction Pattern trend templates, TTM squeeze volatility compression, volume dry-up with OBV accumulation, mo

Strategy v6 BreakoutVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Breakout Confluence V6

7-RSI strategy

by hasnocool
106 stars

This strategy overlays the price chart and compares seven RSI readings, each calculated on its own timeframe from one minute through one day. The user chooses a long or short bot. Entries depend on every RSI meeting a threshold, while a percentage take profit

Strategy v4 Oscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 7-RSI strategy

Trailering S002

by ruckard
13 stars

Trailering S002 is a long-only automated strategy template built for Zignaly webhook execution. It evaluates historical price stats and maximum excursion to trigger long trades, dynamically adjusting capital allocation based on active signal conditions. The sc

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Trailering S002

A test strategy from a reference corpus that re-issues a pending stop entry every bar. When the 8-period EMA is above the 21-period EMA it places a buy stop at the previous bar high and cancels the sell stop, and otherwise it places a sell stop at the previous

Strategy v6 Moving averagesBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 94 Stop Entry Cancel No Regime Close
1 stars

This strategy draws on the price chart and filters directional signals with four optional checks. It compares a fast exponential moving average with a slower one, requires volume above its average when the volume audit is on, and aligns close with a higher-tim

Strategy v6 Moving averagesVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Fakeout Confirmed

This strategy calculates an Adaptive Hull Moving Average (HMA+) that dynamically adjusts its period based on market volatility measured by fast and slow ATR indicators. It uses slope angle calculations to categorize market conditions into trending, consolidati

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 72s Strategy: Adaptive Hull Moving Average+ pt.1

Volty Expan Close Strategy

by TWODS-CAPITAL
37 stars

Volty Expan Close Strategy is a volatility expansion breakout strategy that enters long or short positions when price exceeds the closing price by a specified ATR multiple. It calculates an ATR-based volatility threshold using a simple moving average of true r

Strategy v5 Volatility & bandsBreakout
Updated 3 years ago · MIT GitHub repository of Volty Expan Close Strategy

Trailering T002

by ruckard
13 stars

This automated trading strategy operates in a separate pane and is designed to integrate with Zignaly copy-trading and profit-sharing webhooks. It focuses on long positions, adjusting position size based on the number of triggered sub-strategy consensus condit

Strategy v5 Trend
Updated 1 year ago · None stated GitHub repository of Trailering T002
1 stars

A test strategy from a reference corpus that checks order flipping with stop entries set so far from price that they always fill at the next bar open. At 08:00 it places a short stop entry and at 14:00 a long one, closing the opposite position each time, so ea

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 95 Multi-Cycle Open Fill Stops
1 stars

TnSovereign Fakeout Filter V6 is a trend-following strategy designed to reduce false breakouts by evaluating entries against a four-layer scoring system. It checks fast and slow EMA crossovers alongside volume surges, higher-timeframe trend alignment, and ATR

Strategy v6 TrendMoving averages Repaints
Updated 2 months ago · None stated GitHub repository of TnSovereign Fakeout Filter V6

8 Day Run

by hasnocool
106 stars

Inspired by Linda Raschke's strategy for T-note futures, this script identifies extended trends where price remains on one side of a 5-period SMA for more than eight consecutive bars. It enters long on the first pullback below the SMA following an eight-bar bu

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8 Day Run

My Strategy

by be-thomas
65 stars

This strategy plots on the price chart and compares a 14-period simple moving average of close with a 28-period simple moving average. It opens a long when the faster average crosses above the slower average and opens a short when the faster average crosses be

Strategy v4 TrendMoving averages
Updated 5 days ago · GPL-3.0 GitHub repository of My Strategy

Trailering U002

by ruckard
13 stars

Trailering U002 is an automated strategy designed to connect TradingView signals directly to the Zignaly copy-trading platform. It executes long positions guided by historical statistical advice and price excursion calculations, adjusting position sizing accor

Strategy v5
Updated 1 year ago · None stated GitHub repository of Trailering U002
1 stars

A test strategy from a reference corpus that repeats an order-flipping check with processing of orders at bar close switched on. At 08:00 it places a short stop entry and at 14:00 a long one, with stops set so far away that they fill at the next open, and clos

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 96 Multi-Cycle POOC Cross-Bar

This overlay strategy enters when a fair-value gap is larger than a minimum ATR multiple, volume exceeds 1.5 times its 20-bar average, and path efficiency over 20 bars clears a threshold. Longs also require price below a lookback high, and shorts require price

Strategy v6 SMC / ICT / price actionVolume
Updated 2 months ago · None stated GitHub repository of TnSovereign Imbalance Confluence

8 Whittle Down

by hasnocool
106 stars

This strategy executes short positions during the end-of-day session (14:29–15:00) when the price is below the 200-day simple moving average. If price moves higher against the initial short trade, it scales into the position by submitting a second short order

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8 Whittle Down

Trailering V005

by ruckard
13 stars

Trailering V005 is an automated trading strategy template designed for integration with the Zignaly platform. It calculates position sizing and entry conditions based on price excursion and historical statistical metrics, adjusting exposure depending on trigge

Strategy v5 Sessions & time
Updated 1 year ago · None stated GitHub repository of Trailering V005
6 stars

SMC Scalping State Engine v2.2.1 is a Pine Script v5 strategy that plots Smart Money Concepts elements on the XAUUSD price chart. It uses a state transition system to detect market structure breaks, order blocks, fair value gaps, key levels and EMA alignments

Strategy v5 SMC / ICT / price actionTrend
Updated 7 months ago · None stated GitHub repository of SMC Scalping State Engine v2.2.1
1 stars

The strategy detects range expansion by comparing the previous bar's range to its ATR multiple. It places pending stop entries above highs of up bars or below lows of down bars. On trigger it enters positions with take profit and stop loss in ticks using OCA g

Strategy v6 Volatility & bandsSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 97 - tp/sl gap reversal oca

TnSovereign NeuraRL

by raybird
1 stars

An experimental strategy that applies a small reinforcement learning agent, a dueling deep Q-network built with the NeuraLib library, to chart data. An eight-value state vector from price z-score, RSI, ATR ratio, EMA slope, volume, MACD and candle features fee

Strategy v6 AI / machine learning
Updated 2 months ago · None stated GitHub repository of TnSovereign NeuraRL

888 BOT Backtest

by hasnocool
106 stars

888 BOT Backtest is a multi-indicator trading strategy that evaluates market conditions by combining a Jurik Moving Average, Range Filter, Average Directional Index (ADX), Parabolic SAR, volume-weighted RSI, MACD, and volume thresholds. Each individual filter

Strategy v4 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 888 BOT Backtest
65 stars

This script is an educational demonstration from the TradingView documentation illustrating order execution mechanics on the next bar open. During the first 100 bars of a chart, it places alternating market orders: entering a long position whenever flat, and r

Strategy v4
Updated 5 days ago · GPL-3.0 GitHub repository of Next Bar Open Execution Demo

Trailucering A002

by ruckard
13 stars

Trailucering A002 is a Pine Script strategy template designed for automated crypto trading via Zignaly webhook alerts. It identifies market breakout opportunities and executes trades directly on the main price chart. Position exits are managed using customizab

Strategy v5 Breakout
Updated 1 year ago · None stated GitHub repository of Trailucering A002
3 stars

MicroQuant Trend Strat is a trend-following strategy overlaid on the price chart that utilizes a modified Supertrend calculation built with EMA bands and Average True Range volatility bounds. It opens long positions when the trend direction turns bullish and s

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of MicroQuant Trend Strat
1 stars

This strategy identifies trend changes using a dual moving average crossover. It computes fast and slow simple moving averages of the close price and generates long entry signals on fast SMA crossover above slow and short signals on crossover below. Upon entry

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 97a - tp/sl bracket isolate
106 stars

This strategy calculates an exponential moving average smoothed Vortex Indicator and plots the positive and negative vortex lines alongside a threshold in a separate pane. It enters long when the difference between VI+ and VI- crosses above a specified positiv

Strategy v4 Oscillators & momentumTrend
Updated 2 years ago · GPL-3.0 GitHub repository of [Guz] Vortex Indicator Custom V2

Oca Cancel Demo

by be-thomas
65 stars

This strategy places a long entry named LE and a short entry named SE whenever the bar year is greater than 2014 and less than 2016. It defines no exits, stop loss, take profit, or position sizing, so opened trades have no close rule. There are no user inputs.

Strategy v4
Updated 5 days ago · GPL-3.0 GitHub repository of Oca Cancel Demo

Traiversal A001

by ruckard
13 stars

Traiversal A001 is a breakout reversal strategy designed primarily for cryptocurrency trading. It identifies reversal entry opportunities three candles following a breakout and closes positions when a breakout in the opposite direction occurs. The script inclu

Strategy v5 BreakoutMean reversion
Updated 1 year ago · None stated GitHub repository of Traiversal A001
3 stars

This strategy executes trades based on a modified Supertrend indicator combining exponential moving averages, price channels, and ATR bands. It enters long positions when the trend direction turns bullish and short positions when it turns bearish, filtered by

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of MicroQuant Trend Strat +TS
1 stars

This strategy identifies long and short positions using a dual moving average crossover on the price chart. The fast and slow simple moving averages generate crossover signals that trigger market entries. The script caps the number of intraday filled orders to

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe 97b - intraday cap isolate
1 stars

A reversal strategy that looks for liquidity sweeps: price pokes beyond the prior swing high or low and closes back inside. Entries must agree with a higher-timeframe EMA 50 and 200 trend, pass an ATR volatility corridor and a candle body check, and optionally

Strategy v6 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of TnSovereign Reversal Engine

A Strategy for Leledec

by hasnocool
106 stars

This Pine Script strategy identifies major and minor Leledec exhaustion bars by tracking consecutive price bar comparisons against past closes and checking local extremes over set lookback lengths. It overlays visual markers directly on the price chart for det

Strategy v4 Mean reversionCandlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of A Strategy for Leledec

OCA Cancel Demo

by be-thomas
65 stars

This script is a TradingView documentation example demonstrating One-Cancels-All (OCA) strategy order execution in Pine Script v4. When bar timestamps fall between the years 2015 and 2016, it submits concurrent long and short entries under a single OCA group n

Strategy v4
Updated 5 days ago · GPL-3.0 GitHub repository of OCA Cancel Demo

UnfairValueGap A004

by ruckard
13 stars

UnfairValueGap A004 is a strategy that identifies value gaps on the price chart and trades based on gap filling dynamics. It calculates the distance between the current price and the far side of a recent gap, taking positions in anticipation of trend continuat

Strategy v5 SMC / ICT / price actionMoving averages
Updated 1 year ago · None stated GitHub repository of UnfairValueGap A004
1 stars

A test strategy from a reference corpus that arms pending stop entries after a range expansion. When the previous bar's range exceeds a multiple of the prior ATR, it places a buy stop at the previous high if that bar closed up, or a sell stop at the previous l

Strategy v6 BreakoutVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 97c Range Expansion Pending Stop

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