Trendline self-test, 2026-10-22T18:47:59.367Z 1. Hand-worked pieces A. swing points (k = 2): lows 10 9 8 9 10 9 7 9 10 -> swing lows at bars 2 and 6, known at bars 4 and 8; no swing at a tie [ok] swing lows [[2,8,4],[6,7,8]]; the tie at bars 10-11 is not a swing B. the fan: A0 = 100 at bar 0; candidates 110 (bar 10), 115 (bar 20), 130 (bar 30); closes 101 + 0.5 j except a close of 110 at bar 25 [ok] A0 -> the most recent unbroken candidate (bar 30): [[0,30]] [ok] a close at bar 35 below every candidate line: no upward line [ok] a newer candidate whose line is broken by an earlier close is refused; the fan keeps bar 30 [ok] fan of two lines: [[0,30],[30,36]] (the second starts at the first one's B) C. signals with given lines: breakout short below the up line, long above the down line; bounce at the down line; a touch without a close back is no bounce [ok] breakout: close 95 < 96 short; close 109 > 105 long; inside: none [ok] bounce: high 106 >= 105 and close 104 < 105: short; close 106 above the line: no bounce D. the stop: short at 100 with a down line 110 -> 105 over bars 1..6; the stop follows the line + 1 tick and never moves up; a later bar opening above the stop fills at its open [ok] stops 110, 109, 108, 107, 107 (no guide), 107 (flatter line refused) -> exit at the 107 open: -50.76 [ok] no guiding line: no trade; entry 100 already at the stop (99 + 1): no trade 2. Event-driven lines against a full recomputation at every bar (synthetic random walks, k = 3 and 5) [ok] seed 7, k 3: lines identical at all 3000 bars [ok] seed 11, k 5: lines identical at all 3000 bars [ok] seed 23, k 5: lines identical at all 3000 bars 3. Engine against the independent reference [ok] synthetic walk 5, TL-BO-5: 49 trades, reference 49, identical [ok] synthetic walk 5, TL-BO-10: 23 trades, reference 23, identical [ok] synthetic walk 5, TL-BN-5: 135 trades, reference 135, identical [ok] synthetic walk 5, TL-BN-10: 68 trades, reference 68, identical [ok] synthetic walk 19, TL-BO-5: 15 trades, reference 15, identical [ok] synthetic walk 19, TL-BO-10: 8 trades, reference 8, identical [ok] synthetic walk 19, TL-BN-5: 110 trades, reference 110, identical [ok] synthetic walk 19, TL-BN-10: 43 trades, reference 43, identical real data: 2347033 minutes 2020-01-01 18:01 .. 2026-09-25 17:00 New York; 39623 hourly bars [ok] TL-BO-5: 1286 trades, reference 1286 (6 s), identical [ok] TL-BO-10: 660 trades, reference 660 (4 s), identical [ok] TL-BN-5: 1920 trades, reference 1920 (6 s), identical [ok] TL-BN-10: 1184 trades, reference 1184 (4 s), identical 4. Control at offset 0 [ok] TL-BO-5: 1286 control trades identical to the real ones [ok] TL-BO-10: 660 control trades identical to the real ones [ok] TL-BN-5: 1920 control trades identical to the real ones [ok] TL-BN-10: 1184 control trades identical to the real ones PASSED