Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesLiquidity Impact Breakout
QuaScript

Liquidity Impact Breakout

Free

Range breakouts when Amihud illiquidity is high

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

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

View Profile
quascriptstrategyliquiditybreakout
Free
Backtest this strategy Open in QuaTick IDE 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.

Liquidity Impact 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

Takes range breakouts when liquidity is thin. Amihud illiquidity (absolute return per unit of traded value) is ranked against its own history; when it is high, a given order moves price further, so breakouts through a recent range tend to travel instead of being absorbed. Entry: close beyond the N-bar range with the illiquidity rank above the threshold. Exit: stop at the range middle, target `reward` R, trailing after 1R. Risk: 1 % per trade. Method: Amihud (2002) illiquidity, percentile rank.


Settings

Range bars: 36

Illiquidity window: 24

Rank history: 500

Thin-liquidity rank: 70

Target (R): 2


Measured backtests

Run by the backtest engine on public candles, 2025-11-01 to 2026-11-01, with the script's own commission and slippage, on BTCUSDT 1h (Binance) and ETHUSDT 1h (Binance). The figures per market are in the Measured backtest panel below. Past results do not predict future returns.


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

  • ▸ close beyond the N-bar range with the illiquidity rank above the threshold

Exit Conditions

  • ▸ stop at the range middle, target `reward` R, trailing after 1R

Measured backtest

BTCUSDT 1h (Binance), 2025-11-01 to 2026-11-01 · backtest engine, script costs included

Backtest this strategy

-10.4%

Return

-0.85

Sharpe

-14.1%

Max DD

31.1%

Win Rate

74

Trades

MarketTradesReturnSharpeMax DDWin rateProfit factor
BTCUSDT 1h74-10.4%-0.85-14.1%31.1%0.79
ETHUSDT 1h72-14.6%-1.45-17.6%27.8%0.71

Past results on historical data do not predict future returns.

Source Code

Edit in IDE
quascript
1strategy "Liquidity Impact Breakout" {
2 overlay = true
3 capital = 100000
4 commission = 0.05
5 slippage = 1
6 sizing = risk_percent
7 max_leverage = 1
8 size = 1
9 pyramiding = 1
10}
11/// Takes range breakouts when liquidity is thin. Amihud illiquidity (absolute return per unit of
12/// traded value) is ranked against its own history; when it is high, a given order moves price
13/// further, so breakouts through a recent range tend to travel instead of being absorbed.
14/// Entry: close beyond the N-bar range with the illiquidity rank above the threshold. Exit: stop at
15/// the range middle, target `reward` R, trailing after 1R. Risk: 1 % per trade.
16/// Method: Amihud (2002) illiquidity, percentile rank.
17use "viz/premium" as pr
18range_n = param.int(36, title = "Range bars", min = 5, max = 500, group = "Breakout")
19ami_len = param.int(24, title = "Illiquidity window", min = 5, max = 500, group = "Liquidity")
20rank_n = param.int(500, title = "Rank history", min = 50, max = 5000, group = "Liquidity")
21thin = param.float(70, title = "Thin-liquidity rank", min = 30, max = 99, group = "Liquidity")
22reward = param.float(2.0, title = "Target (R)", min = 0.5, max = 10, step = 0.1, group = "Risk")
23hi = ta.highest(high, range_n)
24lo = ta.lowest(low, range_n)
25mid = (hi + lo) / 2
26rank = stat.percent_rank(hft.amihud(ami_len), rank_n)
27thin_now = rank > thin
28flat = position.size == 0
29up_b = thin_now and close > hi[1]
30dn_b = thin_now and close < lo[1]
31if flat and up_b {
32 order.market("L", side.long)
33 exit.bracket("L exit", entry = "L", stop = mid[1], target = close + (close - mid[1]) * reward, trail_offset = close - mid[1], trail_trigger = close + (close - mid[1]))
34}
35if flat and dn_b {
36 order.market("S", side.short)
37 exit.bracket("S exit", entry = "S", stop = mid[1], target = close - (mid[1] - close) * reward, trail_offset = mid[1] - close, trail_trigger = close - (mid[1] - close))
38}
39risk.max_drawdown(25)
40ph = render.line(hi, "Range high", color = color.translucent(color.amber.300, thin_now ? 20 : 70), width = 1)
41pl = render.line(lo, "Range low", color = color.translucent(color.amber.300, thin_now ? 20 : 70), width = 1)
42render.band(ph, pl, color = color.translucent(color.amber.500, thin_now ? 88 : 98), opacity = 1, title = "Range")
43render.mark(up_b, shape = shape.arrow_up, at = anchor.below_bar, color = color.amber.300, text = "Thin", title = "Thin breakout up")
44render.mark(dn_b, shape = shape.arrow_down, at = anchor.above_bar, color = color.amber.300, text = "Thin", title = "Thin breakout down")
45persist t = draw.table.create(anchor.top_right, 4, 2)
46if bar.is_last {
47 pr.heading(t, 2, "Liquidity Impact Breakout", "Strategy · Amihud illiquidity")
48 pr.row(t, 2, "Illiquidity rank", str.format("{:.0f} / 100", rank), thin_now ? pr.WARN : color.white)
49 pr.row(t, 3, "Breakouts", thin_now ? "Followed" : "Ignored", color.white)
50}
51 
Read-only preview. Open in the QuaTick IDE 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.