Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesOrder Block Retest
QuaScript

Order Block Retest

Free

Enters on retests of fresh order blocks

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
quascriptstrategyorder-blocks
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.

Order Block Retestengine 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

After a structure break, waits for price to return into the order block that caused it and enters with a limit order at the block's midpoint; the stop sits beyond the block and the target at the swing extreme. Built on the smc libraries.


Settings

Swing legs: 5

Reward (R): 2.5


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

    Exit Conditions

      Measured backtest

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

      Backtest this strategy

      10.7%

      Return

      0.52

      Sharpe

      -22.1%

      Max DD

      23.3%

      Win Rate

      30

      Trades

      MarketTradesReturnSharpeMax DDWin rateProfit factor
      BTCUSDT 1h3010.7%0.52-22.1%23.3%0.77
      ETHUSDT 1h6-1.9%-0.74-4.3%33.3%0.66

      Past results on historical data do not predict future returns.

      Source Code

      Edit in IDE
      quascript
      1strategy "Order Block Retest" {
      2 overlay = true
      3 capital = 100000
      4 commission = 0.05
      5 sizing = risk_percent
      6 size = 0.5
      7 max_objects = 200
      8}
      9/// After a structure break, waits for price to return into the order block that caused it and
      10/// enters with a limit order at the block's midpoint; the stop sits beyond the block and the
      11/// target at the swing extreme. Built on the smc libraries.
      12use "smc/structure" as st
      13use "smc/zones" as zn
      14 
      15legs = param.int(5, title = "Swing legs", min = 2, max = 20)
      16rr = param.float(2.5, title = "Reward (R)", min = 1, max = 10, step = 0.1)
      17 
      18(dir, up, down, hh, ll) = st.structure(legs)
      19(found, ob) = zn.order_block(legs)
      20a = ta.atr(14)
      21persist zone = zn.Zone()
      22persist armed = false
      23if found and position.size == 0 {
      24 zone := ob
      25 armed := true
      26 draw.zone.create(ob.born, ob.top, bar.index + 30, ob.bottom, color = color.translucent(ob.bullish ? color.sky.500 : color.orange.500, 80), text = "OB")
      27}
      28if armed and position.size == 0 {
      29 entry = zone.mid()
      30 risk_px = zone.width() * 0.75 + a * 0.25
      31 if zone.bullish {
      32 order.limit("L", side.long, entry)
      33 exit.bracket("L exit", entry = "L", stop = zone.bottom - a * 0.25, target = entry + risk_px * rr)
      34 } else {
      35 order.limit("S", side.short, entry)
      36 exit.bracket("S exit", entry = "S", stop = zone.top + a * 0.25, target = entry - risk_px * rr)
      37 }
      38}
      39// a mitigated block is no longer tradeable
      40if armed and zone.mitigated() {
      41 armed := false
      42 order.cancel_all()
      43}
      44if position.size != 0 { armed := false }
      45render.step(armed ? zone.mid() : na, "Pending entry", color = color.amber.400, stroke = style.dashed)
      46render.mark(up, shape = shape.tag_up, at = anchor.below_bar, color = color.sky.400, text = "BOS")
      47render.mark(down, shape = shape.tag_down, at = anchor.above_bar, color = color.orange.400, text = "BOS")
      48 
      49 
      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.