Zeal Terminal Open Zeal Terminal

Pine Script v5 · Strategy

[TH] Volatility Breakout

A Pine Script v5 strategy with no technical-analysis calculation. It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays no commission. 2 settings; defaults include Password Your Password and K 0.5.

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 [TH] Volatility Breakout repaint?
No
No repainting patterns were found in the source.
Does [TH] Volatility Breakout run in Pine Script v6?
Not tested
The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L6:C0: no source was supplied for the library 'dokang/TradingHook/1'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download.
Does [TH] Volatility Breakout use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does [TH] Volatility Breakout run in Zeal Terminal?
No
Not yet: it imports the library dokang/TradingHook/1, whose source is not available here, so it does not run here
Does not run in Zeal Terminal yetIt imports the library dokang/TradingHook/1, whose source is not available here, so it does not run here. The settings, logic and review below are read from the source, which does not need a run.

Review

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

  • 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.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    1 setting has no label

    In the settings dialog k (line 10) shows an empty name. The labels on this page come from the variable names.

  • 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
PasswordYour Passwordstringentry Buy close Buy
K (no label in the script)0.5float · min 0.0 · step 0.1entry_price

What it calculates

No technical-analysis calculation: the script works on prices and settings directly.

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.

lowlowprice datahighhighprice dataclosecloseprice datakKsetting · 0.5heightheightvalueentry_priceentry_pricevalueentry:BuyOpen Buystrategy.entryclose:BuyClose Buystrategy.closeplot:12plotplot

Order rules

OrderFires whenBy defaultLine
Open Buy longinTradeOn18
Close BuyinTradeOn19

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.

The live replay needs a run, and this script does not run in Zeal Terminal yet; 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 timingprocess_orders_on_close = true: orders fill at the signal bar's close.

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

Similar scripts

No other indicator or strategy here shares enough of its calculations.

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

The v5 script does not run in Zeal Terminal's engine (Pine Script v5 Error at @L6:C0: no source was supplied for the library 'dokang/TradingHook/1'. Libraries cannot be fetched from TradingView; supply the source in the 'libraries' option. No libraries were supplied.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © dokang-//@version=5+//@version=6password = input.string("Your Password", title="Password", confirm = true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2No It imports the library dokang/TradingHook/1, whose source is not available here, so it does not run hereNot 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/// © dokang//@version=5password = input.string("Your Password", title="Password", confirm = true)strategy("[TH] Volatility Breakout", overlay=true, initial_capital = 10000, currency = currency.KRW, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, process_orders_on_close = true, pyramiding = 2)import dokang/TradingHook/1 as THif timeframe.period != "D"    runtime.error("This strategy is only available in 1-day timeframe.")height = high-lowk = input.float(0.5, minval = 0.0, step = 0.1)entry_price = close+height*kplot(entry_price, color = color.yellow, linewidth=2, offset = 1)var inTrade = falseif barstate.islastconfirmedhistory    inTrade := true    if inTrade    strategy.entry("Buy", strategy.long, stop = entry_price, alert_message = TH.buy_message(password, order_name = "Volatility Breakout Buy"))    strategy.close("Buy", comment = "Sell",alert_message = TH.sell_message(password, "100%", order_name = "Volatility Breakout Sell"))