Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesVWAP Deviation Reversion
QuaScript

VWAP Deviation Reversion

Free

Fades quiet stretches from session VWAP

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
quascriptstrategyvwapmean-reversionintraday
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.

VWAP Deviation Reversionengine 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

Fades stretches away from the session VWAP measured in volume-weighted standard deviations, but only on low relative volume: a stretch made without participation tends to snap back, a stretch on heavy volume is often the start of a trend and is left alone. Entry: close beyond the 2-sigma VWAP band, relative volume below the limit, and a reversal bar. Exit: target at VWAP, stop beyond the 3-sigma band (at least 1 ATR away), flat at the session change. Risk: 1 % per trade.


Settings

Entry band (sigma): 2

Stop band (sigma): 3.2

Maximum relative volume: 1.2

Relative volume window: 48


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 2-sigma VWAP band, relative volume below the limit, and a reversal bar

Exit Conditions

  • ▸ target at VWAP, stop beyond the 3-sigma band (at least 1 ATR away), flat at the session change

Measured backtest

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

Backtest this strategy

-24.7%

Return

-4.61

Sharpe

-25.1%

Max DD

26.5%

Win Rate

313

Trades

MarketTradesReturnSharpeMax DDWin rateProfit factor
BTCUSDT 1h313-24.7%-4.61-25.1%26.5%0.42
ETHUSDT 1h448-24.6%-3.36-25.5%29.9%0.58

Past results on historical data do not predict future returns.

Source Code

Edit in IDE
quascript
1strategy "VWAP Deviation Reversion" {
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/// Fades stretches away from the session VWAP measured in volume-weighted standard deviations, but
12/// only on low relative volume: a stretch made without participation tends to snap back, a stretch
13/// on heavy volume is often the start of a trend and is left alone.
14/// Entry: close beyond the 2-sigma VWAP band, relative volume below the limit, and a reversal bar.
15/// Exit: target at VWAP, stop beyond the 3-sigma band (at least 1 ATR away), flat at the session change.
16/// Risk: 1 % per trade.
17use "viz/premium" as pr
18k_in = param.float(2.0, title = "Entry band (sigma)", min = 0.5, max = 4, step = 0.1, group = "Bands")
19k_stop = param.float(3.2, title = "Stop band (sigma)", min = 1, max = 6, step = 0.1, group = "Bands")
20rv_max = param.float(1.2, title = "Maximum relative volume", min = 0.3, max = 5, step = 0.1, group = "Filter")
21rv_len = param.int(48, title = "Relative volume window", min = 5, max = 1000, group = "Filter")
22(vw, up1, dn1) = ta.vwap(bar.typical, "day", 1)
23sdv = up1 - vw
24rv = volume / math.max(ta.sma(volume, rv_len), 1e-12)
25quiet = rv < rv_max
26a = ta.atr(20)
27long_sig = close[1] < vw[1] - k_in * sdv[1] and close > open and quiet
28short_sig = close[1] > vw[1] + k_in * sdv[1] and close < open and quiet
29flat = position.size == 0
30if flat and long_sig {
31 order.market("L", side.long)
32 exit.bracket("L exit", entry = "L", stop = math.min(vw - k_stop * sdv, close - a), target = vw)
33}
34if flat and short_sig {
35 order.market("S", side.short)
36 exit.bracket("S exit", entry = "S", stop = math.max(vw + k_stop * sdv, close + a), target = vw)
37}
38dom = time.day(time)
39if dom != dom[1] and position.size != 0 { exit.close_all() }
40risk.max_drawdown(25)
41pu = render.line(vw + k_in * sdv, "Upper band", color = color.translucent(color.rose.300, 45), width = 1)
42pv = render.line(vw, "VWAP", color = color.amber.300, width = 2)
43pd = render.line(vw - k_in * sdv, "Lower band", color = color.translucent(color.emerald.300, 45), width = 1)
44render.band(pu, pv, texture = "gradient", direction = "edges", upper_color = color.rose.500, lower_color = color.slate.900, opacity = 0.16, title = "Rich zone")
45render.band(pv, pd, texture = "gradient", direction = "edges", upper_color = color.slate.900, lower_color = color.emerald.500, opacity = 0.16, title = "Cheap zone")
46persist t = draw.table.create(anchor.top_right, 4, 2)
47if bar.is_last {
48 pr.heading(t, 2, "VWAP Deviation Reversion", "Strategy · quiet stretches")
49 pr.row(t, 2, "Deviation", str.format("{:+.2f} sigma", (close - vw) / math.max(sdv, 1e-12)), color.white)
50 pr.row(t, 3, "Relative volume", str.format("{:.2f}", rv), quiet ? pr.BULL : pr.WARN)
51}
52 
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.