Appearance
Personalize your experience
Liquidity Wall Bounce
Admin's ChoiceFreeBuys defended bid walls, sells defended ask walls, stop beyond the wall
Live engine preview
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.
About
Buys the defence of a large resting bid and sells the defence of a large resting ask. A wall is the biggest level within the search window when it is several times the side's average level. The setup needs both views: the bar trades into the wall and closes back on the right side (OHLCV), and the wall is still there at the close with the book leaning the bounce's way (book). The stop sits just beyond the wall: if it is pulled or consumed the idea is wrong. Exit: target at a multiple of the risk, or the opposite wall if it is closer. Needs the order book (L2): backtests run only where the chart has recorded books.
Settings
Search window (% from mid): 1
Wall size (x average level): 3
Reward / risk: 2
Stop buffer (ATR): 0.2
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
- ▸ target at a multiple of the risk, or the opposite wall if it is closer
- ▸ Needs the order book (L2): backtests run only where the chart has recorded books
Source Code
Edit in IDE| 1 | strategy "Liquidity Wall Bounce" { |
| 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 | /// Buys the defence of a large resting bid and sells the defence of a large resting ask. A wall is |
| 11 | /// the biggest level within the search window when it is several times the side's average level. |
| 12 | /// The setup needs both views: the bar trades into the wall and closes back on the right side |
| 13 | /// (OHLCV), and the wall is still there at the close with the book leaning the bounce's way |
| 14 | /// (book). The stop sits just beyond the wall: if it is pulled or consumed the idea is wrong. |
| 15 | /// Exit: target at a multiple of the risk, or the opposite wall if it is closer. |
| 16 | /// Needs the order book (L2): backtests run only where the chart has recorded books. |
| 17 | win_pct = param.float(1.0, title = "Search window (% from mid)", min = 0.05, max = 10, step = 0.05, group = "Walls") |
| 18 | mult = param.float(3.0, title = "Wall size (x average level)", min = 1.2, max = 20, step = 0.1, group = "Walls") |
| 19 | rr = param.float(2.0, title = "Reward / risk", min = 0.5, max = 10, step = 0.1, group = "Exit") |
| 20 | buf = param.float(0.2, title = "Stop buffer (ATR)", min = 0, max = 3, step = 0.05, group = "Exit") |
| 21 | mid = book.mid |
| 22 | (bwp, bws) = book.wall(book.bid_side) |
| 23 | (awp, aws) = book.wall(book.ask_side) |
| 24 | bavg = book.bid_volume() / math.max(book.levels, 1) |
| 25 | aavg = book.ask_volume() / math.max(book.levels, 1) |
| 26 | bid_wall = bws >= mult * bavg and bwp >= mid * (1 - win_pct / 100) ? bwp : na |
| 27 | ask_wall = aws >= mult * aavg and awp <= mid * (1 + win_pct / 100) ? awp : na |
| 28 | a = ta.atr(14) |
| 29 | pres = book.pressure(0.25) |
| 30 | ready = not math.is_na(a) |
| 31 | long_sig = ready and not math.is_na(bid_wall[1]) and not math.is_na(bid_wall) and low <= bid_wall[1] and close > bid_wall[1] and pres > 0 |
| 32 | short_sig = ready and not math.is_na(ask_wall[1]) and not math.is_na(ask_wall) and high >= ask_wall[1] and close < ask_wall[1] and pres < 0 |
| 33 | flat = position.size == 0 |
| 34 | if flat and long_sig { |
| 35 | stop = bid_wall[1] - buf * a |
| 36 | tgt = close + rr * (close - stop) |
| 37 | order.market("L", side.long) |
| 38 | exit.bracket("L exit", entry = "L", stop = stop, target = math.is_na(ask_wall) ? tgt : math.min(tgt, ask_wall)) |
| 39 | } |
| 40 | if flat and short_sig { |
| 41 | stop = ask_wall[1] + buf * a |
| 42 | tgt = close - rr * (stop - close) |
| 43 | order.market("S", side.short) |
| 44 | exit.bracket("S exit", entry = "S", stop = stop, target = math.is_na(bid_wall) ? tgt : math.max(tgt, bid_wall)) |
| 45 | } |
| 46 | risk.max_drawdown(25) |
| 47 | render.step(bid_wall, "Bid wall", color = color.emerald.300, width = 2) |
| 48 | render.step(ask_wall, "Ask wall", color = color.rose.300, width = 2) |
| 49 | render.mark(long_sig and flat, shape = shape.triangle_up, at = anchor.below_bar, color = color.emerald.300, size = 0.8, title = "Bid wall bounce") |
| 50 | render.mark(short_sig and flat, shape = shape.triangle_down, at = anchor.above_bar, color = color.rose.300, size = 0.8, title = "Ask wall rejection") |
| 51 |
Reviews
No reviews yet. Be the first to review this listing.