Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesVacuum Breakout
QuaScript

Vacuum Breakout

Free

Range breakouts taken only inside an order book liquidity vacuum

0.0(0)
0 installs 0 0 comments
Q
433 listings

The QuaTick team's QuaScript analyses, run by the native C++ engine.

View Profile
quascriptstrategyorder-bookbreakoutliquidity
Free
Backtest this strategy Open in QuaCode Edit in IDE
Version
Updated
Compatible

Live engine preview

QuaScriptQuaScript

The QuaScript engine's own output on the chart the terminal uses. Change the settings or edit the code and press Run to recompute it.

Vacuum Breakoutengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)

About

Range breakouts taken only when the order book around the price is unusually thin (a liquidity vacuum: resting size within the band far below its own history), so there is little to stop the move. Stop at the other side of the half range, target a multiple of the risk. Needs the order book (L2): trades only on bars with a recorded book.


Settings

Band around mid (%): 0.5

Vacuum z-score: -1

Breakout range (bars): 20

Reward / risk: 2.5


Backtest it yourself

Open it on the backtesting page to run it on any symbol, interval and date range, then use Monte Carlo, optimisation, walk-forward and robustness tests.

Strategy Rules

Entry Conditions

    Exit Conditions

      Source Code

      Edit in IDE
      quascript
      1strategy "Vacuum Breakout" {
      2 overlay = true
      3 capital = 100000
      4 commission = 0.05
      5 slippage = 1
      6 sizing = risk_percent
      7 size = 1
      8 max_leverage = 1
      9}
      10/// Range breakouts taken only when the order book around the price is unusually thin (a liquidity
      11/// vacuum: resting size within the band far below its own history), so there is little to stop the
      12/// move. Stop at the other side of the half range, target a multiple of the risk.
      13/// Needs the order book (L2): trades only on bars with a recorded book.
      14pct = param.float(0.5, title = "Band around mid (%)", min = 0.02, max = 5, step = 0.01)
      15z_vac = param.float(-1.0, title = "Vacuum z-score", min = -4, max = 0, step = 0.1)
      16brk = param.int(20, title = "Breakout range (bars)", min = 3, max = 500)
      17rr = param.float(2.5, title = "Reward / risk", min = 0.5, max = 10, step = 0.1)
      18z = stat.zscore(math.log(math.max(book.liquidity(pct), 1e-12)), 200)
      19vac = z < z_vac
      20hi_n = ta.highest(high, brk)
      21lo_n = ta.lowest(low, brk)
      22hh = hi_n[1]
      23ll = lo_n[1]
      24mid = (hh + ll) / 2
      25flat = position.size == 0
      26if flat and vac and close > hh {
      27 order.market("L", side.long)
      28 exit.bracket("L exit", entry = "L", stop = mid, target = close + rr * (close - mid))
      29}
      30if flat and vac and close < ll {
      31 order.market("S", side.short)
      32 exit.bracket("S exit", entry = "S", stop = mid, target = close - rr * (mid - close))
      33}
      34risk.max_drawdown(25)
      35pu = render.line(hh, "Range high", color = color.translucent(color.violet.300, 40), width = 1)
      36pd = render.line(ll, "Range low", color = color.translucent(color.violet.300, 40), width = 1)
      37render.band(pu, pd, color = vac ? color.violet.500 : color.slate.600, opacity = 0.07, title = "Range")
      38render.background(vac ? color.translucent(color.violet.500, 90) : na)
      39 
      Read-only preview. Open in QuaCode to edit and deploy.

      Reviews

      No reviews yet. Be the first to review this listing.

      Discussion

      Sign in to join the discussion. Your posts and replies show up on your profile.