Scalping — CVD-Divergence Fade Updated Analysis

A lookahead audit of this strategy's own backtest code (strategy_engine.py), checking for the same bug classes found in E3, E4, and E8's shared codebase.

1 · What was checked

Read strategy_engine.py's e5_cvd_divergence() function looking specifically for the two bug patterns already found elsewhere in this codebase: an entry price that uses the same bar whose close confirmed the signal (E4's bug), and a reference value computed from a full day or window rather than causally (E8's and E3's bug). Neither pattern is present: run_hi, run_lo, and the running CVD total are all updated strictly bar-by-bar as the scan loop advances, never touching a future bar; the entry price already uses the next bar's open, matching the correct convention used elsewhere in the file. No IVA or volume-profile fields are read at all, so E5 is also unaffected by E3's profile-target bug.

2 · The shared finalize_trade() crash bug — minor impact here

The crash-and-silently-drop-a-symbol's-trades bug documented on the E4/E8 pages does technically affect E5, but only marginally: 2 of 166 screened-universe symbols are dropped as-coded; patching the crash recovers them. This is a much smaller effect than on E3 (where the same bug dropped the majority of the universe), simply because E5 fires far fewer signals per symbol.

3 · Day-level ATR sizing bug, fixed

E5's stop distance is sized off the same day["atr15"] field found to be a full-day (not causal) value on the E3 page — a single scalar per calendar day computed from that day's last 15-minute bar, applied to every signal on that day regardless of what time it fired. Re-testing with a proper causal ATR instead:

UniverseNet PF, day-level ATR (crash-patched)Net PF, causal ATR
Top 1000.6620.744
Screened 1660.7150.780

Unlike E3, the causal-ATR fix moves E5's net PF up slightly rather than down — but not by enough to matter: E5 stays clearly net-unprofitable (net PF well under 1.0) either way. This bug also affects E3 and E4's reproductions on this site; it does not affect the separate ATR-VWAP variant study, which computes its own causal rolling ATR independently.

4 · What this means

Of the four strategies sharing this codebase, E5 is the one whose original implementation was already honest. Its failure — a 43.3% win rate and net PF 0.66–0.78 depending on ATR treatment — is a real, uninflated verdict on the underlying idea: a new session price extreme unconfirmed by CVD does not, on this evidence, reliably fade back. That's a cleaner negative result than E3, E4, or E8 produced, precisely because there was no lookahead bug propping it up in the first place.

All figures above come from this project's from-scratch reproduction: Bybit V5 public kline API, 5-minute bars, Jan 1 – Aug 25 2026, top 100 perps by 24h USDT turnover plus the original 166-symbol screened list. Cost basis: 0.055% taker + 0.02% slippage per side, round-trip. See the E3 updated analysis for the concrete example demonstrating the day-level-ATR distortion, and the OI+CVD+Volume confluence page, §11–14, for the broader hardening pass this audit was part of.