Weekly anchored VWAP (Trader Dale) self-test, 2026-10-28T08:10:37.915Z 1. Loader and the weekly VWAP [ok] the volume loader reads the same 8326700 minutes as fx_data.js (largest price difference after rounding to the 0.00001 grid 0.0e+0), last 2026-09-28 15:46 [ok] tick volume: whole numbers >= 0 in every minute (0 minutes with 0) [ok] VWAP per bar 110005, 110062 points (hand: 110005, 110062); the minute with no volume counts for nothing [ok] new week after the 3-day gap: the sums restart (first bar VWAP undefined, then 120010) [ok] week starts and ends, final VWAP sums of week A [ok] a bar with an undefined VWAP changes nothing [ok] a low exactly at the VWAP touches it (exact test 4 x price x V vs S) 2. Hand-made weeks (filler week of 520 bars, then the base week; VWAP 0, ATR 100 points unless stated) A. bias, pullback, confirmation: bullish from bar 2; pullback at bar 6; confirmed at bar 7 [ok] bias: none in the filler week and over bars 0-1, bullish from the bar whose low is above the VWAP (bar 2), unchanged by a straddling bar [ok] one long signal: pullback bar 6, confirmation bar 7 [ok] confirmation on the pullback bar itself (bar 6), then bar 7 touches and confirms again [ok] confirmation on the 3rd bar after the pullback (bars 7 and 8 bearish) [ok] no confirmation by the 3rd bar after: the pullback lapses; the bullish bar 10 (4th after, low above the VWAP) is no signal [ok] a bar entirely below the VWAP after the pullback turns the bias bearish and cancels it; the bullish bar 8 is no signal [ok] the bias restarts at each week: bullish at the end of the base week, none at the first bar of the next (the same week again: one signal in each) B. AV-BAR, the base trade: fill 60, stop at the swing low -50 (110 points >= 0.5 ATR, <= 3 ATR), target 200 - 1 pip = 190 (130 points >= 1R); target at bar 9 minute 19 [ok] entry at the first minute of bar 8, stop -50, target 190 [ok] exit 190 at bar 9 minute 19: +13 pips - 1 = +12 pips = 1.0909 R C. AV-TRAIL: the stop moves to -10 (swing low of bar 6, known at the close of bar 8, after the entry), then to 90 (bar 11, known at bar 13); out at 90 in bar 14 [ok] exit 90 at bar 14 minute 20 (trailing stop), 0.1818 R [ok] without the second swing low the stop stays at -10 (exit -10) D. stop rules (AV-TRAIL, so the target cannot veto the trade) [ok] ATR 250: -50 is 110 < 125 away (too close), the next swing low down, -200 (260 <= 750), is used (stop -200, next swing) [ok] ATR 30: the nearest swing low is 110 > 90 away: fixed stop 60 - 1.5 x 30 = 15 (stop 15) [ok] only the swing low of bar 10 left, 517 bars back (> 480): no swing, fixed stop 60 - 375 (stop -315) [ok] ATR 101 keeps the swing (110 >= 50.5); a fixed stop of 1.5 x 21 = 31.5 rounds to 32 points E. targets (AV-BAR) [ok] previous week's VWAP 110180.25 (nearer than the swing high): rounded down to 110180, target 110170 = exactly 1R, kept; exit at bar 9 minute 17 (0.9091 R) [ok] previous week VWAP at 150: target 140 is 80 < 110 points away: no trade [ok] no swing high above and the previous week VWAP below: no barrier, no trade [ok] a previous week VWAP above the swing high (110250.6) is farther: the swing high is the barrier F. exits (AV-BAR) [ok] stop and target in one minute: the stop (-1R - 1 pip = -1.0909 R) [ok] a minute opening below the stop exits at its open (-70) [ok] a minute opening above the target exits at its open (195) [ok] the target is not checked in the entry minute (a high of 200 there is ignored) [ok] AV-TRAIL never stopped: closed at the last minute of the week (here also the end of the data) [ok] with a later week: closed at the week's last minute, reason weekend (1.3636 R) G. the last 2 hours of the week and the week end [ok] week ending with bar 11: the entry minute (bar 8) opens 120 minutes before the last minute closes: no entry [ok] week ending with bar 12: 150 minutes left: entry [ok] confirmation on the last bar of the week: the next minute is in the next week: no entry H. a short (the base weeks turned upside down) [ok] AV-BAR short: fill -60, stop 50, target -190 (1.0909 R) [ok] AV-TRAIL short: trailed to 10, then -90 [ok] short: previous week VWAP 109819.75 rounded up to 109820, target 109830 [ok] short: stop and target in one minute: the stop I. one position at a time and the control on hand-made weeks [ok] AV-TRAIL: a second signal (pullback bar 10, confirmation bar 11) while the trade is open is missed [ok] moved by one week (circular: to the filler week): entered 240 minutes into that week, same 110-point stop and 130-point target 3. The reference (av_ref.js) against the engine on the real data [ok] AV-BAR: 828 trades, 12320 signals; trades differing 0 [ok] AV-TRAIL: 8541 trades, 12320 signals; trades differing 0 [ok] every stop rule occurs on the real data (AV-TRAIL): next swing 6140, fixed (too far) 74, nearest swing 2324, fixed (no swing) 3 4. The control at offset 0 on the real data [ok] AV-BAR: offset 0 reproduces all 828 trades (differences 0) [ok] AV-TRAIL: offset 0 reproduces all 8541 trades (differences 0) PASSED