Head-and-shoulders engine self-test 2026-10-16T19:36:27.122Z [PASS] volatility by hand (window 3): s(t) is the sample standard deviation of the log changes of bars t-3 .. t-1, undefined before bar 4 [PASS] zigzag by hand: pivots and the bars that confirm them (3% cut-off): T1@3 P6@8 T11@13 P16@18 T21@22 P26@27 T31@33 P36@38 T46@49 [PASS] zigzag: the first of equal closes (bars 3 and 4) is the peak, and the new leg starts from the lowest close after it (not the 100 of bar 1): 1:3@5 -1:6@9 [PASS] zigzag: the cut-off moves with s(t): a drop of about 1.5% from the peak is not enough while the cut-off is 2%, and confirms the peak once s falls to 1%: -1:1@4 1:4@6 [PASS] top by hand: valid (rise before it, head highest, time and height symmetry), found when the right shoulder is confirmed [PASS] top by hand: neckline through the troughs (105 at bar 21, 106 at bar 31), break at the first close below it (bar 41), height 19.5 [PASS] top by hand: target = neckline at the break - height = 87.5; stop = highest high from the bar after T2 to the break (a wick of 120) [PASS] pattern rule 1 by hand: no rise before it (the earlier peak, 118, is above the left shoulder) -> rejected: rule failed: 1 [PASS] pattern rule 2 by hand: a head (114) below the left shoulder -> rejected: rule failed: 2 [PASS] pattern rule 3 by hand: a right side 2.5 times longer than the left (30 bars against 10) -> rejected: rule failed: 3 [PASS] pattern rule 4 by hand: a second trough (111) above the middle of the left shoulder and its trough (110) -> rejected: rule failed: 4 [PASS] break too late: no close below the neckline within as many bars after the right shoulder as from the left to the right (20) -> dropped [PASS] the next pivot (a trough at 108, confirmed before any close below the neckline) ends the pattern -> dropped [PASS] inverse pattern by hand (the mirror image): break above the neckline at bar 41, height 19.5, target 112.5, stop = the lowest low (83.5): b 41 h 19.5 target 112.5 stop 83.5 [PASS] stop and target in the same minute: the stop is taken [PASS] a stop gapped through fills at the minute's open (98, not 99) [PASS] a target gapped through fills at the open (103, not 102) [PASS] the stop can be hit in the entry minute [PASS] short: the stop (101) is above, taken first when both are touched [PASS] no level touched: closed at the last minute's close, flagged [PASS] entry at the open of the first minute after the break bar; a break while a position is open is not taken; a break in the bar where the previous trade ended is taken: 11-26 31-60 [PASS] long only ignores tops and takes the next inverse pattern after the previous trade has ended: 1:11-26 1:41-41 [PASS] result in R: (direction x (exit - entry) - $0.30) / height; financing scenarios A and B as in the other gold tests [PASS] synthetic HS-LS-3: engine and re-implementation agree trade by trade, and on the patterns found and broken: 90 vs 90 trades, 0 differences; patterns 133 vs 133, breaks 95 vs 95 [PASS] synthetic HS-L-3: engine and re-implementation agree trade by trade, and on the patterns found and broken: 50 vs 50 trades, 0 differences; patterns 133 vs 133, breaks 95 vs 95 [PASS] synthetic HS-LS-6: engine and re-implementation agree trade by trade, and on the patterns found and broken: 16 vs 16 trades, 0 differences; patterns 31 vs 31, breaks 18 vs 18 [PASS] synthetic HS-L-6: engine and re-implementation agree trade by trade, and on the patterns found and broken: 8 vs 8 trades, 0 differences; patterns 31 vs 31, breaks 18 vs 18 [PASS] synthetic: the control at offset 0 reproduces the real trades: 90 of 90 [PASS] synthetic: tops give shorts and inverse patterns longs; long only never shorts real data: 7067434 minutes, 512811 fifteen-minute bars, 2004-06-11 00:19 .. 2026-10-07 16:57 New York; patterns found k=3: 451 (broken 282), k=6: 211 (broken 138) [PASS] real data: the 15-minute bars equal a naive aggregation of the minutes (every 997th bar): 515 bars checked, 0 differences [PASS] real data: the volatility equals a naive recomputation (every 4001st bar): 0 differences [PASS] HS-LS-3: engine and independent re-implementation agree on every zigzag pivot, pattern, break and trade: 279 vs 279 trades, 0 differences ; pivots 21797 vs 21797; patterns 451 vs 451 [PASS] HS-LS-3: control at offset 0 reproduces the real trades: 279 of 279, 0 differences [PASS] HS-L-3: engine and independent re-implementation agree on every zigzag pivot, pattern, break and trade: 142 vs 142 trades, 0 differences ; pivots 21797 vs 21797; patterns 451 vs 451 [PASS] HS-L-3: control at offset 0 reproduces the real trades: 142 of 142, 0 differences [PASS] HS-LS-6: engine and independent re-implementation agree on every zigzag pivot, pattern, break and trade: 135 vs 135 trades, 0 differences ; pivots 7435 vs 7435; patterns 211 vs 211 [PASS] HS-LS-6: control at offset 0 reproduces the real trades: 135 of 135, 0 differences [PASS] HS-L-6: engine and independent re-implementation agree on every zigzag pivot, pattern, break and trade: 64 vs 64 trades, 0 differences ; pivots 7435 vs 7435; patterns 211 vs 211 [PASS] HS-L-6: control at offset 0 reproduces the real trades: 64 of 64, 0 differences PASSED