TheStrat (ES 60-minute) self-test, 2026-10-28T10:26:21.409Z 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 2. Hand-made days A. 2-1-2 continuation, long: filled at 4006.25 at 11:29, target 4010 at 11:39 [ok] 156.74 $ (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.25 is below the opens (FTFC refuses it); the short at 3993.75 then fills, target 3990 [ok] FTFC: the refused long leaves the short working: 156.74 $ [ok] NOFTFC takes the long reversal (target the 2D's high 4000) and is stopped at 3993.75: -255.76 $ C. 3-1-2: 10:00 an outside bar (3990-4010), 11:00 inside (3996-4007), 12:00 up: 4007.25, target 4010 [ok] 106.74 $; 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.25, stop 3989.75, target 4012 [ok] 156.74 $ [ok] the short after the 09:00 2U fills at 3999.75; its target, the low of the 08:00 bar (4000), is not below the fill: 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.25: filled at its open (a gap at the first minute of the order bar is refused by FTFC instead, case F) [ok] the 12:00 bar does not reach 4006.25; the break in the 13:00 bar is too late (the order worked only during the next bar) [ok] one minute reaching 4006.25 and 4001.75: no trade from that bar [ok] inside bar high equal to the 2U high (4006, not broken): target 4006 is below the fill 4006.25: refused [ok] the same pattern 4 hours later (fill 15:29) and 3 hours earlier (fill 08:29): 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.25 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 (56.74 $) [ok] a minute opening below the stop exits at its open (4000) [ok] early close (Friday 29 Nov 2024, 13:15): the open trade closes at 13:15 [ok] the same pattern two hours later: the fill at 13:29 is after the early close: refused 3. The reference (strat_ref.js) against the engine on the real data [ok] STRAT-212: 259 trades; trades differing 0 [ok] STRAT-312: 67 trades; trades differing 0 [ok] STRAT-22: 569 trades; trades differing 0 [ok] STRAT-212-NOFTFC: 717 trades; trades differing 0 4. The control at offset 0 on the real data [ok] STRAT-212: offset 0 enters at all 259 real minutes with the same direction and distances (2 filled at the minute's open give the same result) [ok] STRAT-312: offset 0 enters at all 67 real minutes with the same direction and distances (1 filled at the minute's open give the same result) [ok] STRAT-22: offset 0 enters at all 569 real minutes with the same direction and distances (1 filled at the minute's open give the same result) [ok] STRAT-212-NOFTFC: offset 0 enters at all 717 real minutes with the same direction and distances (3 filled at the minute's open give the same result) PASSED