Strategy · Pine Script v6 · On the chart

Dragon Breakout

by AlanGuo

A long strategy that plots five moving averages (25, 50, 100, 150 and 300 by default, SMA or EMA) and looks for a bullish candle that opens below and closes above at least a set number of them.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code286
Settings22inputs
LicenceNone stated
Last update7 months ago31 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

The breakout must come on volume above a ratio of its recent average and with a large enough body, then a retest within a short window is checked. A score threshold gates entries, and exits use a selectable average. Markers, retest levels and scores can be shown. There is no stop loss.

Details

Published by

AlanGuo on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Breakout, Moving averages

Markets

Any symbol

Timeframes

H4 and above

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
MA TypestringSMAma_type
MA Period 1int25ma_period_1
MA Period 2int50ma_period_2
MA Period 3int100ma_period_3
MA Period 4int150ma_period_4
MA Period 5int300ma_period_5
Min Cross Countint3min_cross_count
Volume Lookbackint20volume_lookback
Min Volume Ratiofloat1.2volume_min_ratio
Body Lookbackint20body_lookback
Breakout Lookbackint15breakout_lookback
Retest Windowint5retest_window
Show all 22 settings
SettingTypeDefaultVariable
Retest Body Ratiofloat0.5retest_body_ratio
Enable Backtestbooltrueenable_backtest
Min Score Thresholdfloat0.8min_score_threshold
Backtest Start Datetimetimestamp("2017-01-01 00:00")start_date
Backtest End Datetimetimestamp("2099-01-01 00:00")end_date
Exit MAstringMA 1exit_ma_option
Show MAsbooltrueshow_mas
Show Breakout Markersbooltrueshow_breakout_markers
Show Retest Levelsbooltrueshow_retest_levels
Show Scorebooltrueshow_score
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

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

Bollinger Breakout

by hackingthemarkets
189 stars

This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w

Strategy v4 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of Bollinger Breakout

12/26-IT Strategy

by hasnocool
106 stars

This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par

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

均线突破交易系统

by tangly1024
76 stars

This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of 均线突破交易系统

Bollinger bands examples

by tradingstrategy-ai
53 stars

This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open

Strategy v5 Volatility & bandsOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Bollinger bands examples
43 stars

This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.

Strategy v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m Strategy Candle Bar

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers