The idea
This is Dicargo_Beam's open-source strategy, published as "Volatility Breakout Strategy". It maps the width of the previous day onto today's breakout levels: the daily close plus or minus the daily high-low range times a factor k gives the long and short triggers, and the stop is the midpoint between that trigger and the daily low or high. The author's chart is HTX:ETHUSDT on the 1-hour, so this entry is filed under ETH. The script does not hard-code a symbol.
It is long-only by default. The short switch is labelled "Short Postion Open??" in the source and defaults to off. There is also a Trend Following? filter, off by default, that compares the long-side and short-side trigger-to-stop ratios before a side is allowed. Daily open is fetched as well, but it is not used later.

How the lines are built
- Daily open, high, low, and close come from request.security on the same symbol, with a common offset that tries to avoid the still-forming daily bar and reduce lookahead. The daily open o is never used after it is fetched.
- The levels are not rebuilt on every 1-hour bar. They update only when hour[1] - hour > 1, that is, when the previous bar's hour is more than one hour above the current hour. On a 1-hour chart that usually happens at the date change (for example 23 to 0, a difference of 23). A gap after a weekend or a halt can also trip it.
- The long trigger lp is the daily close c plus (daily high h minus daily low l) times k, and k defaults to 0.6. The long stop sl is (l + lp) / 2, the midpoint of the daily low and the trigger.
- The short trigger sp is c minus the same range times k. The short stop sl2 is (h + sp) / 2. Those two lines are not plotted when shorts are off.
- If the trend filter is on, a long also needs lp/sl greater than sl2/sp, and a short needs the opposite. The filter is off by default, so both sides are treated as allowed.
Entry rules
- A long needs this bar's high already above lp (written as lp < high), no open trade (strategy.opentrades == 0), and a passing trend filter. The test uses the high, not the close, so it can become true before the bar finishes.
- Shorts are off by default. If Short Postion Open?? is turned on, a short is opened when the low is below sp, no trade is open, and the trend filter passes.
- Only one position is allowed at a time. The script will not add to an open trade.
Exits and position size
- A long is closed if close falls through sl, or if hour[1] - hour > 1 happens again — usually the same moment a new day starts and the triggers are rebuilt.
- If shorts are enabled, a short is closed if close rises through sl2, or on the same hour jump.
- The tester sizes at 100% of equity. The source does not set commission or slippage, so the tester uses platform defaults. Those settings apply to the tester only, not to live routing.
Inputs (defaults in the source)
| Input | Default | What it does |
|---|---|---|
| k | 0.6 | Multiple of the daily range used to project the triggers. |
| Short Postion Open?? | false | Whether shorts are allowed. The spelling is from the source. |
| Trend Following? | false | When on, filter each side by the ratio of its trigger to its stop. |
Caveats
- The refresh depends on hour in the chart's exchange timezone, which may not coincide with the exact close of the daily candle. A different venue or daylight-saving change can move the jump.
- Entries use the in-bar high, so the tester may fill before the bar closes. That is not the same rule as "only a close above counts as a breakout".
- At the start of a new day an open long is flattened, then the triggers are rebuilt from the new daily data. Whether another long can open immediately depends on whether the high later clears the new line.
- The default size is 100% of equity. On a market as active as ETH, that can produce very large swings. Treat position size as a separate decision when you test or change inputs.
- The author's chart is HTX ETHUSDT, 1-hour. Daily highs and lows will not match another exchange exactly, so the triggers will move as well.
Install it on TradingView
- Download the .pine file from Coinpred (a current membership is required; see the page) or check the original publication for a newer revision.
- Open the symbol and timeframe you want in TradingView, open the Pine Editor, paste the source, and add it to the chart.
- Start with the default k of 0.6 and longs only so you can see the trigger and the day-change exit, then change the multiple for your market and timeframe, and decide whether to enable shorts or the trend filter.
- The order size in the source applies to the strategy tester only. Live order routing has to be set separately.
- Crypto trades around the clock. The tester's timezone and session settings may differ from your venue by several hours, and this script reads hour directly, so the timezone matters.
About backtest figures
Source, license, and version
- Source: https://www.tradingview.com/script/vzWeDyXd-Volatility-Breakout-Strategy/
- Author: Dicargo_Beam (header © Dicargo_Beam)
- License: Mozilla Public License 2.0. Redistribution must keep the original copyright and license notices; if you modify the source file, the modified file must remain under MPL 2.0. Coinpred ships the unmodified source.
- Version: 7.0 in the publication record and pine-facade. scriptAccess is open_no_auth.



