Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

DC Breakout Strategy - This is simplicity at its finest.

A Pine Script v5 strategy built on SMA (close, 8), Highest (high[1], 20) and Lowest (low[1], 20). It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. 17 settings; defaults include Length Fast MA 8, Length Slow MA 32 and Source Fast MA close.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does DC Breakout Strategy - This is simplicity at its finest. repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 18 of 18 trades.
How did DC Breakout Strategy - This is simplicity at its finest. do on BTCUSDT 1D with default settings?
+10.84%
From 26 Jan 2024 to 21 Oct 2026, over 57 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does DC Breakout Strategy - This is simplicity at its finest. run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 57 before, 57 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
Does DC Breakout Strategy - This is simplicity at its finest. use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does DC Breakout Strategy - This is simplicity at its finest. run in Zeal Terminal?
Yes
It compiles in 18 ms and runs 1,000 bars in 50 ms, in the browser.

BTCUSDT · 1D · default settings

  • Fast MA
  • Slow MA
  • Upper
  • Lower
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (12)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,108,340$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
+10.84%
$108,357.00
Buy and hold
+102.5%
same period
Closed trades
57
23 won · 34 lost
Profitable
40.4%
of closed trades
Profit factor
1.60
gross profit ÷ gross loss
Max drawdown
8.32%
−$87,404.20

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    3 settings do nothing

    “Backtest Start Date”, “Backtest End Date”, “ Color Lower Channel” are declared but never read.

  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
backtest window
Backtest Start Datetimestamp("01 Jan 2017 00:00 +0000")timeunused
Backtest End Datetimestamp("01 Jan 2100 00:00 +0000")timeunused
Moving Average Inputs
Length Fast MA8int · min 1fast
Length Slow MA32int · min 1slow
Color Fast MAcolor.new(color.red, 0)colorFast MA
Color Slow MAcolor.new(color.purple, 0)colorSlow MA
Source Fast MAclosesourcefast
Source Slow MAclosesourceslow
Donchian Channels Inputs
Length Upper Channel20int · min 1h1
Length Lower Channel20int · min 1l1
Fill Colorcolor.new(color.gray, 100)colorfill
Color Upper Channelcolor.new(color.white, 0)colorUpper Lower
Color Lower Channelcolor.new(color.white, 0)colorunused
ATR Position Size Inputs
Leverage Used1int · min 1amount
Point Value/ATR Multipliers from Entry4int · min 1amount
ATR Period14int · min 1atr
Risk Per Trade0.01floatamount

What it calculates

  • SMASource Fast MA (close), Length Fast MA (8)fast · line 15
  • SMASource Slow MA (close), Length Slow MA (32)slow · line 16
  • Highesthigh[1], Length Upper Channel (20)h1 · line 22
  • Lowestlow[1], Length Lower Channel (20)l1 · line 23
  • ATRATR Period (14)atr · line 35
  • Crossoverfast, slowentrycondition1 · line 38
  • Crossunderfast, slowsellcondition1 · line 40

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

closecloseprice datalen1Length Fast MAsetting · 8len2Length Slow MAsetting · 32highhighprice dataLength1Length Upper Channelsetting · 20lowlowprice dataLength2Length Lower Channelsetting · 20high · low · closehigh · low · closeprice datalengthATR Periodsetting · 14riskRisk Per Tradesetting · 0.01pointvaluePoint Value/ATR Multipl…setting · 4leverageLeverage Usedsetting · 1fastSMA→ fastslowSMA→ slowh1Highest→ h1l1Lowest→ l1atrATR→ atrentrycondition1Crossover→ entrycondition1sellcondition1Crossunder→ sellcondition1amountamountvalueentrycondition2entrycondition2conditionsellcondition2sellcondition2conditionentry:longOpen longstrategy.entryclose:longClose longstrategy.closeentry:shortOpen shortstrategy.entryclose:shortClose shortstrategy.closeplot:17Fast MAplotplot:18Slow MAplotplot:27Upperplotplot:28Lowerplotfill:29Fillfill

Order rules

OrderFires whenBy defaultLine
Open long long(close > h1 and entrycondition2)On44
Close long(sellcondition1 and sellcondition2)On46
Open short short(close < l1 and sellcondition2)On48
Close short(entrycondition1 and entrycondition2)On50

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

No

No repainting patterns in the source, and the live replay matched history.

18/18trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D+10.8%+102.5%5740%1.608.3%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+22.2%+5.5%4628%2.497.8%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+10.7%+9.8%5248%1.775.4%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+16.1%+8.4%4141%2.496.6%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.9%+16.7%6237%1.068.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+33.4%+21.5%4544%3.856.9%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+19.3%+148.3%4536%2.0512.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−15.6%+17.1%6028%0.4018.8%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Settings heatmap

Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (Length Fast MA 14, Length Slow MA 27) made +12.0% before 26 Dec 2025 and +2.8% after it, worse than the defaults' +4.7% after. Tuning on the past did not carry forward. 86% of the 64 combinations made money in-sample and 94% out-of-sample.

Before 26 Dec 2025 · in-sample
Length Slow MA ↓ · Length Fast MA →45678101114
16+5%+9%+7%+8%+11%+10%+8%+11%
19+7%+6%+9%+8%+6%+9%+10%+11%
22+3%+6%+5%+4%+5%+3%+1%+4%
27+3%+1%+0%+3%+4%+5%+6%+12%
32+2%+2%+5%+7%+6%+5%+5%+7%
38+2%+2%+1%+2%+1%−0%−1%+0%
45+1%+1%−1%−1%+1%+1%+1%−0%
54+1%−1%−2%−2%−0%+5%+5%+6%
From 26 Dec 2025 · out-of-sample
Length Slow MA ↓ · Length Fast MA →45678101114
16+4%+5%+6%+6%+3%+3%+3%+3%
19+5%+4%+6%+5%+5%+5%+5%+5%
22+6%+5%+5%+6%+5%+4%+5%+4%
27+5%+4%+5%+6%+5%+4%+4%+3%
32+5%+5%+6%+6%+5%+3%+3%+3%
38+8%+8%+9%+9%+5%+3%+3%+5%
45+8%+4%+3%+2%+1%−1%−0%−2%
54+2%+2%+2%+2%+2%+1%+1%−3%

Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market1233%$22,773.40
Sideways market3238%$69,059.50
Falling market1354%$16,524.00

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

7.2%

The 95th percentile of the worst drawdown when the same 57 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 3.0% to 7.2%; the tick is what actually happened, 7.3%. Order luck alone moves it this much.

0%8%
All 57 trades
SideEntryExitBarsP&L
long27 Feb 2024 54,476.508 Apr 2024 69,360.4041$23,638.50
long28 Feb 2024 57,037.308 Apr 2024 69,360.4040$18,274.50
long29 Feb 2024 62,432.108 Apr 2024 69,360.4039$8,297.65
short2 May 2024 58,365.0018 May 2024 67,024.0016−$6,763.36
long18 May 2024 67,024.0016 Jun 2024 66,228.3029−$724.30
long21 May 2024 71,446.6016 Jun 2024 66,228.3026−$4,726.38
short24 Jun 2024 63,210.0019 Jul 2024 63,987.9025−$1,075.12
short25 Jun 2024 60,293.3019 Jul 2024 63,987.9024−$4,539.92
short5 Jul 2024 57,050.0019 Jul 2024 63,987.9014−$8,311.26
long20 Jul 2024 66,660.006 Aug 2024 54,018.8017−$12,323.30
long22 Jul 2024 68,165.406 Aug 2024 54,018.8015−$14,218.00
short6 Aug 2024 54,018.8027 Aug 2024 62,834.0021−$6,977.44
short7 Sep 2024 53,963.0019 Sep 2024 61,760.0012−$7,271.03
long19 Sep 2024 61,760.0011 Oct 2024 60,326.4022−$1,495.24
long20 Sep 2024 62,948.0011 Oct 2024 60,326.4021−$2,742.69
long27 Sep 2024 65,174.0011 Oct 2024 60,326.4014−$5,434.61
long16 Oct 2024 67,074.1026 Dec 2024 99,429.6071$36,940.30
long19 Oct 2024 68,428.0026 Dec 2024 99,429.6068$37,444.20
long21 Oct 2024 69,032.0026 Dec 2024 99,429.6066$39,520.60
long18 Jan 2025 104,077.007 Feb 2025 96,554.4020−$4,899.91
short25 Feb 2025 91,552.9028 Mar 2025 87,232.0031$3,401.49
short26 Feb 2025 88,680.4028 Mar 2025 87,232.0030$1,061.11
short27 Feb 2025 84,250.1028 Mar 2025 87,232.0029−$2,025.77
short7 Apr 2025 78,430.0018 Apr 2025 84,947.9011−$4,618.61
long23 Apr 2025 93,443.006 Jun 2025 101,509.0044$5,891.32
long2 May 2025 96,489.906 Jun 2025 101,509.0035$4,305.20
long9 May 2025 103,262.006 Jun 2025 101,509.0028−$1,489.94
short6 Jun 2025 101,509.0012 Jun 2025 108,645.006−$6,184.63
long10 Jul 2025 111,234.005 Aug 2025 115,055.0026$3,810.06
long11 Jul 2025 116,010.005 Aug 2025 115,055.0025−$857.88
long12 Jul 2025 117,528.005 Aug 2025 115,055.0024−$2,172.98
long14 Aug 2025 123,306.0022 Aug 2025 112,500.008−$9,585.40
short26 Aug 2025 110,112.0015 Sep 2025 115,268.0020−$3,972.61
short30 Aug 2025 108,377.0015 Sep 2025 115,268.0016−$5,207.17
long17 Sep 2025 116,789.0028 Sep 2025 109,636.0011−$7,377.99
long4 Oct 2025 122,232.0016 Oct 2025 110,763.0012−$10,652.30
short5 Nov 2025 101,497.0015 Dec 2025 88,172.2040$8,372.12
short15 Nov 2025 94,594.0015 Dec 2025 88,172.2030$3,762.95
short18 Nov 2025 92,215.1015 Dec 2025 88,172.2027$2,440.14
long5 Jan 2026 91,529.7026 Jan 2026 86,670.4021−$4,992.74
long6 Jan 2026 93,859.7026 Jan 2026 86,670.4020−$7,208.68
long14 Jan 2026 95,414.0026 Jan 2026 86,670.4012−$8,622.17
short26 Jan 2026 86,670.407 Mar 2026 68,114.0040$19,037.70
short30 Jan 2026 84,650.207 Mar 2026 68,114.0036$15,743.00
short1 Feb 2026 78,741.107 Mar 2026 68,114.0034$8,529.27
long17 Mar 2026 74,884.7029 Mar 2026 66,377.0012−$7,086.01
long14 Apr 2026 74,418.0021 May 2026 77,552.2037$3,016.61
long18 Apr 2026 77,072.0021 May 2026 77,552.2033$462.41
long5 May 2026 79,861.0021 May 2026 77,552.2016−$2,648.80
short23 May 2026 75,539.5010 Jul 2026 63,230.0048$15,382.40
short29 May 2026 73,617.5010 Jul 2026 63,230.0042$13,060.50
short2 Jun 2026 71,408.9010 Jul 2026 63,230.0038$10,479.30
long15 Jul 2026 65,044.003 Aug 2026 63,570.0019−$1,799.63
long22 Jul 2026 66,556.103 Aug 2026 63,570.0012−$4,065.74
long21 Aug 2026 73,027.0018 Sep 2026 76,417.0028$4,735.65
long22 Aug 2026 78,338.0018 Sep 2026 76,417.0027−$2,260.80
long22 Sep 2026 86,620.0015 Oct 2026 81,682.0023−$4,917.81

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
DC Breakout Strategy - This is simplicity at its finest. this page—v5 strategy+10.8%578.3%
Trend Following with Donchian Channels and MACD by Robrecht99highest lowest sma atrv5 strategy−1.0%122.7%
BuyHigh-SellLow Strategy by Trendoscopesma highest lowest atrv4 strategy+12.4%46.7%
ATR + STC + MA by Romediuslowest highest atr smav5 strategy−1.2%153.3%
-NoSKi Hammer-Star -w angle of ema Backtester - by noski1atr sma highest lowestv5 strategydoes not run in Zeal Terminal
AlignedMA and Cumulative HighLow Strategy V2 by Trendoscopesma atr highest lowestv4 strategy−40.8%1650.9%

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • 3 settings use the untyped input() (line 11, 12, 34). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

Same 57 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 11: input() → input.source()
  • Line 12: input() → input.source()
  • Line 34: input() → input.float()
⋯len2 = input.int(32, minval=1, title="Length Slow MA", group="Moving Average Inputs")-src1 = input(close, title="Source Fast MA")+src1 = input.source(close, title="Source Fast MA")-src2 = input(close, title="Source Slow MA")+src2 = input.source(close, title="Source Slow MA")maFast = input.color(color.new(color.red, 0), title = "Color Fast MA", group = "Moving Average Inputs", inline = "maFast")⋯length = input.int(title = "ATR Period", defval = 14, minval = 1, group ="ATR Position Size Inputs")-risk = input(title = "Risk Per Trade", defval = 0.01, group = "ATR Position Size Inputs")+risk = input.float(title = "Risk Per Trade", defval = 0.01, group = "ATR Position Size Inputs")atr = ta.atr(length)⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 57 before, 57 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © Robrecht99-//@version=5+//@version=6strategy("Simplicity at its finest", overlay=true, margin_long=0, margin_short=0, pyramiding=3)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 18 msYes 1,000 bars in 50 msNot measured
PineTSNot testedNot testedNot measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Robrecht99//@version=5strategy("Simplicity at its finest", overlay=true, margin_long=0, margin_short=0, pyramiding=3)// Backtest Range //Start = input.time(defval = timestamp("01 Jan 2017 00:00 +0000"), title = "Backtest Start Date", group = "backtest window")Finish = input.time(defval = timestamp("01 Jan 2100 00:00 +0000"), title = "Backtest End Date", group = "backtest window")// Moving Averages //len1 = input.int(8, minval=1, title="Length Fast MA", group="Moving Average Inputs")len2 = input.int(32, minval=1, title="Length Slow MA", group="Moving Average Inputs")src1 = input(close, title="Source Fast MA")src2 = input(close, title="Source Slow MA")maFast = input.color(color.new(color.red, 0), title = "Color Fast MA", group = "Moving Average Inputs", inline = "maFast")maSlow = input.color(color.new(color.purple, 0), title = "Color Slow MA", group = "Moving Average Inputs", inline = "maSlow")fast = ta.sma(src1, len1)slow = ta.sma(src2, len2)plot(fast, color=maFast, title="Fast MA")plot(slow, color=maSlow, title="Slow MA")// Donchian Channels //Length1 = input.int(title="Length Upper Channel", defval=20, minval=1, group="Donchian Channels Inputs")Length2 = input.int(title="Length Lower Channel", defval=20, minval=1, group="Donchian Channels Inputs")h1 = ta.highest(high[1], Length1)l1 = ta.lowest(low[1], Length2)fillColor = input.color(color.new(color.gray, 100), title = "Fill Color", group = "Donchian Channels Inputs")upperColor = input.color(color.new(color.white, 0), title = " Color Upper Channel", group = "Donchian Channels Inputs", inline = "upper")lowerColor = input.color(color.new(color.white, 0), title = " Color Lower Channel", group = "Donchian Channels Inputs", inline = "lower")u = plot(h1, "Upper", color=upperColor)l = plot(l1, "Lower", color=upperColor)fill(u, l, color=fillColor)// ATR and Position Size //leverage = input.int(title = "Leverage Used", defval = 1, minval = 1, group = "ATR Position Size Inputs")pointvalue = input.int(title = "Point Value/ATR Multipliers from Entry", defval = 4, minval = 1, group = "ATR Position Size Inputs")length = input.int(title = "ATR Period", defval = 14, minval = 1, group ="ATR Position Size Inputs")risk = input(title = "Risk Per Trade", defval = 0.01, group = "ATR Position Size Inputs")atr = ta.atr(length)amount = (risk * strategy.initial_capital / (pointvalue * atr * leverage))// Buy and Sell Conditions //entrycondition1 = ta.crossover(fast, slow)entrycondition2 = fast > slowsellcondition1 = ta.crossunder(fast, slow)sellcondition2 = slow > fast// Buy and Sell Signals //if (close > h1 and entrycondition2)    strategy.entry("long", strategy.long, qty=amount)if (sellcondition1 and sellcondition2)    strategy.close(id="long")if (close < l1 and sellcondition2)    strategy.entry("short", strategy.short, qty=amount)if (entrycondition1 and entrycondition2)    strategy.close(id="short")