Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Volatility Breakout Strategy [Angel Algo]

A Pine Script v5 strategy built on ATR (20). It has 2 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. 1 setting; defaults include Length 20.

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 Volatility Breakout Strategy [Angel Algo] repaint?
No
No repainting patterns were found in the source. The live replay was not measured: the script acts only when barstate.isconfirmed is true, which Zeal Terminal's engine never reports during a live replay (it does not run a bar's closing update in live mode), so the replay cannot test this script.
How did Volatility Breakout Strategy [Angel Algo] do on BTCUSDT 1D with default settings?
+3.12%
From 26 Jan 2024 to 21 Oct 2026, over 18 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Volatility Breakout Strategy [Angel Algo] 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: 18 before, 23 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 Volatility Breakout Strategy [Angel Algo] use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Volatility Breakout Strategy [Angel Algo] run in Zeal Terminal?
Yes
It compiles in 17 ms and runs 1,000 bars in 36 ms, in the browser.

BTCUSDT · 1D · default settings

  • ATR
  • Shape
  • Shape
  • 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 (1)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$1,046,520$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
+3.12%
$31,158.10
Buy and hold
+102.5%
same period
Closed trades
18
8 won · 10 lost
Profitable
44.4%
of closed trades
Profit factor
1.43
gross profit ÷ gross loss
Max drawdown
3.63%
−$36,560.50

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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

    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
Length20intatr

What it calculates

  • ATRLength (20)atr · line 7

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.

high · low · closehigh · low · closeprice datalengthLengthsetting · 20highhighprice datalowlowprice dataclosecloseprice dataatrATR→ atrupper_breakoutupper_breakoutvaluelower_breakoutlower_breakoutvaluelong_conditionlong_conditionconditionshort_conditionshort_conditionconditionlong_entrylong_entryconditionshort_entryshort_entryconditionactive_signal_colorColouractive_signal_colorentry:Volatility Breakout LongOpen Volatility Breakou…strategy.entryentry:Volatility Breakout ShortOpen Volatility Breakou…strategy.entryplot:9ATRplotplot:14Upper Breakout Levelplotplot:15Lower Breakout Levelplotplotshape:22plotshapeplotshapeplotshape:24plotshapeplotshapefill:27Fillfill

Order rules

OrderFires whenBy defaultLine
Open Volatility Breakout Long longlong_conditionOn31
Open Volatility Breakout Short shortshort_conditionOn33

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.

Not measuredAn engine gap, not the scriptThe script acts only when barstate.isconfirmed is true, which Zeal Terminal's engine never reports during a live replay (it does not run a bar's closing update in live mode), so the replay cannot test this script. The answer comes from the checks on the source alone.
  • 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+3.1%+102.5%1844%1.433.6%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+1.2%+5.5%2143%1.471.2%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−0.2%+9.8%2945%0.730.3%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%2343%1.410.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.0%+16.7%2133%0.580.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%2143%1.630.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.0%+148.3%2148%0.720.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.0%+17.1%1833%0.800.0%8 May 2026 – 21 Oct 2026

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

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market450%$9,861.64
Sideways market1242%$17,216.60
Falling market250%$4,079.89

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

How bad could the drawdown be?

5.6%

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

0%6%
All 18 trades
SideEntryExitBarsP&L
long27 Feb 2024 54,476.5020 Mar 2024 61,937.4022$7,460.93
short20 Mar 2024 61,937.404 May 2024 62,882.0045−$944.60
long4 May 2024 62,882.0025 Jun 2024 60,293.3052−$2,588.71
short25 Jun 2024 60,293.3016 Jul 2024 64,724.1021−$4,430.76
long16 Jul 2024 64,724.106 Aug 2024 54,018.8021−$10,705.20
short6 Aug 2024 54,018.809 Aug 2024 61,686.003−$7,667.18
long9 Aug 2024 61,686.0028 Aug 2024 59,415.0019−$2,271.00
short28 Aug 2024 59,415.0015 Oct 2024 66,084.0048−$6,669.00
long15 Oct 2024 66,084.0019 Dec 2024 100,204.0065$34,120.00
short19 Dec 2024 100,204.003 Mar 2025 94,270.0074$5,934.02
long3 Mar 2025 94,270.007 Apr 2025 78,430.0035−$15,840.00
short7 Apr 2025 78,430.0023 Apr 2025 93,443.0016−$15,013.00
long23 Apr 2025 93,443.0023 Sep 2025 112,651.00153$19,208.00
short23 Sep 2025 112,651.0029 Sep 2025 112,164.006$487.03
long29 Sep 2025 112,164.0011 Oct 2025 112,774.0012$610.53
short11 Oct 2025 112,774.0014 Jan 2026 95,414.0095$17,360.50
long14 Jan 2026 95,414.0021 Jan 2026 88,427.707−$6,986.33
short21 Jan 2026 88,427.7020 Aug 2026 69,334.80211$19,092.90

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
Volatility Breakout Strategy [Angel Algo] this page—v5 strategy+3.1%183.6%
SOJA PIVOT by ParaBellum68atrv4 strategy+3.3%918.2%
Volatility System by EduardoMattjeatrv5 strategy+150.2%221.5%
ATR Stop Buy Strategy by phobo3satrv4 strategyNo trades on this market
VBand Strategy by Saravanan_Ragavanatrv4 strategyNo trades on this market
ATR Mean Reversion Strategy V1 by Bcullen175atrv5 strategy−20.0%7959.6%

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.

  • 1 setting uses the untyped input() (line 5). 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 18 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 5: input() → input.int()
⋯// Inputs-length = input(title="Length", defval=20)+length = input.int(title="Length", defval=20)// Calculate the average true range (ATR)⋯

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: 18 before, 23 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.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/-//@version=5+//@version=6strategy("Volatility Breakout Strategy [Angel Algo]", overlay = true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 17 msYes 1,000 bars in 36 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///@version=5strategy("Volatility Breakout Strategy [Angel Algo]", overlay = true)// Inputslength = input(title="Length", defval=20)// Calculate the average true range (ATR)atr = ta.atr(length)// Plot the ATR on the chartplot(atr, color=color.blue, linewidth=2, title="ATR")// Calculate the upper and lower breakoutsupper_breakout = high + atrlower_breakout = low - atr// Plot the upper and lower breakouts on the chartul = plot(upper_breakout[1], color = color.new(color.green, 100), linewidth=2, title="Upper Breakout Level")ll = plot(lower_breakout[1], color = color.new(color.red, 100), linewidth=2, title="Lower Breakout Level")// Create the signalslong_entry = ta.crossover(close, upper_breakout[1]) and barstate.isconfirmedshort_entry = ta.crossunder(close, lower_breakout[1]) and barstate.isconfirmedactive_signal_color =ta.barssince(long_entry) < ta.barssince(short_entry) ?    color.new(color.green,85) : color.new(color.red,85)// Plot the signals on the chartplotshape(long_entry and ta.barssince(long_entry[1]) > ta.barssince(short_entry[1]), location=location.belowbar, style=shape.triangleup,    color=color.green, size=size.normal, text = "Bullish breakout", textcolor = color.green)plotshape(short_entry and ta.barssince(long_entry[1]) < ta.barssince(short_entry[1]), location=location.abovebar, style=shape.triangledown,    color=color.red, size=size.normal,text = "Bearish breakout",  textcolor = color.red)// Fill the space between the upper and lower levels with the color that indicates the latest signal directionfill(ul,ll, color=active_signal_color)   long_condition = long_entry and strategy.position_size <= 0 and barstate.isconfirmedshort_condition = short_entry and strategy.position_size >= 0 and barstate.isconfirmedif long_condition    strategy.entry("Volatility Breakout Long", strategy.long)if short_condition    strategy.entry("Volatility Breakout Short", strategy.short)