TheStrat (gold 60-minute) self-test, 2026-10-28T12:04:27.178Z 1. Calendar keys, bar numbers, period opens [ok] Sunday 31 Mar 18:01 is trading day Monday 1 April (month April, same week as Friday 5 April); 17:00 ends a day, 18:01 starts the next [ok] opens at 11:30 Wednesday: month and week 4000 (Sunday 18:01), day 4003 (Tuesday 18:01, set by hand), 60-minute bar (12:00) 4004 [ok] bar numbers 09:00-13:00: 1 2U 1 2U 1 (flat bars equal to the bar before are 1s; equal highs and lows are not broken) [ok] one-minute bars as 60-minute bars: equal high and low -> 1; both broken -> 3; equal high, lower low -> 2D; inside -> 1 [ok] tick arithmetic on the cent grid 2. Hand-made days A. 2-1-2 continuation, long: filled at 4006.01 at 11:29, target 4010 at 11:39 [ok] 3.69 $/oz (continuation) [ok] NOFTFC takes the same trade; no 3-1-2 and no 2-2 reversal here B. 2-1-2 reversal (2D, inside, up): the long at 3998.01 is below the opens (FTFC refuses it); the short at 3993.99 then fills, target 3990 [ok] FTFC: the refused long leaves the short working: 3.69 $/oz [ok] NOFTFC takes the long reversal (target the 2D's high 4000) and is stopped at 3993.99: -4.32 $/oz C. 3-1-2: 10:00 an outside bar (3990-4010), 11:00 inside (3996-4007), 12:00 up: 4007.01, target 4010 [ok] 2.69 $/oz; not a 2-1-2 D. 2-2 reversal: 09:00 a 2U (high 4012), 10:00 a 2D (3990-4008), 11:00 takes out 4008: long 4008.01, stop 3989.99, target 4012 [ok] 3.69 $/oz [ok] the short after the 09:00 2U is reached at 09:30 (stamp), before 09:31: refused [ok] the mirror image: a short after a 2U, same result E. orders: a gap fill, an order expiring, both orders in one minute, a target not beyond the fill, the 09:31-15:00 window [ok] the 11:20 minute opens at 4007, above the buy stop 4006.01: filled at its open [ok] the 12:00 bar does not reach 4006.01; the break in the 13:00 bar is too late (the order worked only during the next bar) [ok] one minute reaching 4006.01 and 4001.99: no trade from that bar [ok] inside bar high equal to the 2U high (4006, not broken): target 4006 is below the fill 4006.01: refused [ok] the same pattern 4 hours later (fill 15:29) and 3 hours earlier (fill 08:29): refused [ok] Wednesday without its 12:01-14:00 minutes (270 minutes from 09:31 to 16:00, under 300): not a usable day, refused F. FTFC: the week (and month) open and the day open above the fill refuse it; the 60-minute bar open too [ok] month and week open 4007 (Sunday 18:01) / day open 4007 (Tuesday 18:01): the long at 4006.01 is refused [ok] the 12:00 bar opens at 4006.50, gapping above the buy stop: fill 4006.50 is not above the bar open: refused (NOFTFC takes it) G. exits [ok] stop and target in one minute: the stop [ok] target not reached: closed at 16:00 at 4008 (1.69 $/oz) [ok] a minute opening below the stop exits at its open (4000) 3. The reference (strat_gold_ref.js) against the engine on the real data (clock corrected and uncorrected) [ok] corrected clock, STRAT-212: 1060 trades; trades differing 0 [ok] corrected clock, STRAT-312: 197 trades; trades differing 0 [ok] corrected clock, STRAT-22: 1358 trades; trades differing 0 [ok] corrected clock, STRAT-212-NOFTFC: 3206 trades; trades differing 0 [ok] uncorrected clock, STRAT-212: 1058 trades; trades differing 0 [ok] uncorrected clock, STRAT-312: 197 trades; trades differing 0 [ok] uncorrected clock, STRAT-22: 1359 trades; trades differing 0 [ok] uncorrected clock, STRAT-212-NOFTFC: 3213 trades; trades differing 0 4. The control at offset 0 on the real data [ok] STRAT-212: offset 0 enters at all 1060 real minutes with the same direction and distances (42 filled at the minute's open give the same result) [ok] STRAT-312: offset 0 enters at all 197 real minutes with the same direction and distances (4 filled at the minute's open give the same result) [ok] STRAT-22: offset 0 enters at all 1358 real minutes with the same direction and distances (36 filled at the minute's open give the same result) [ok] STRAT-212-NOFTFC: offset 0 enters at all 3206 real minutes with the same direction and distances (132 filled at the minute's open give the same result) PASSED