VWAP engine self-test 2026-10-14T10:00:23.282Z [PASS] session found, 78 five-minute bars, first bar closes 09:35, last 16:00: 1 sessions, 78 bars [PASS] VWAP and its volume-weighted standard deviation by hand (bar 2): 101 0.5773502691885756 [PASS] VW-TREND: positions alternate, each flip closes one trade and opens the next at the same minute, flat at the close: S 11:06-13:46, L 13:46-15:41, S 15:41-16:00 [PASS] VW-REV is the exact mirror: same times, opposite side, gross equal and opposite [PASS] costs: $30.76 a trade, so a flip pays two round trips (one per trade) [PASS] the first crossing is filled at the open of the minute after the signal bar [PASS] bands: a long when a bar closes between -2 and -3 SD, stop 1 tick below -3 SD at that bar: signal 11:10, vwap 11:51 [PASS] bands: out at the next open after the first bar that closes at or above the VWAP [PASS] bands: no signal before 10:00, none beyond the 3 SD line, a long inside the region [PASS] bands: a stopped trade fills at the stop (or at the minute open if the minute opened beyond it): {"r":"stop","x":98.08440518934262,"s":98.08440518934262} [PASS] early close: the session ends at 13:15 and the last position is closed there [PASS] synthetic VW-TREND: engine and re-implementation agree trade by trade: 171 vs 171, 0 differences [PASS] synthetic VW-REV: engine and re-implementation agree trade by trade: 171 vs 171, 0 differences [PASS] synthetic VW-BANDS: engine and re-implementation agree trade by trade: 278 vs 278, 0 differences real data: 2378027 minutes, 1737 sessions, 2020-01-02 .. 2026-09-25 [PASS] 5-minute session bars and the VWAP equal a naive recomputation (every 7th session): 19100 bars, 0 differences [PASS] early-close sessions come from the exchange calendar: 58 early closes [PASS] VW-TREND: engine and independent re-implementation agree trade by trade: 11707 vs 11707 trades, 0 differences [PASS] VW-TREND: control at offset 0 reproduces the real trades: 11707 of 11707, 0 differences [PASS] VW-REV: engine and independent re-implementation agree trade by trade: 11707 vs 11707 trades, 0 differences [PASS] VW-REV: control at offset 0 reproduces the real trades: 11707 of 11707, 0 differences [PASS] VW-BANDS: engine and independent re-implementation agree trade by trade: 7803 vs 7803 trades, 0 differences [PASS] VW-BANDS: control at offset 0 reproduces the real trades: 7803 of 7803, 0 differences PASSED