Turtle engine self-test 2026-10-14T06:05:20.476Z [PASS] N = 1 after 20 days of true range 1; then a day of true range 4 gives (19 x 1 + 4) / 20: 1, 1.15 [PASS] S1: long at the 20-day high + 1 tick (100.51), exit one tick below the 10-day low: 100.51 -> 101.19 (exit), expected exit 101.19 [PASS] S1: R = 2N at entry and the result in R after $0.30: 0.1900 R, by hand 0.1900 [PASS] S1 skip rule: the next 20-day breakout after a winner is skipped, and the failsafe 55-day breakout is taken (here the same day, at the 55-day low): skipped 1, failsafe 1, short fill 99.49, 20-day level 99.69, 55-day level 99.49 [PASS] S1: a losing breakout (out at the 10-day low, 99.49, above the 2N stop) does not block the next one: 2 trades, first exit at 99.49, skipped 0 [PASS] S2: an open above the 55-day high fills at the open (102): 102 [PASS] S2: a minute that crosses both the 55-day high and low gives no trade: trades 0, both 1 [PASS] S2: filled at 100.51 and stopped in the same minute at 2N below: 100.51 -> 98.38791345126316 (2N stop 98.3879) [PASS] S2: a stop gapped through fills at the open (97): 97 [PASS] S2-4U: units at 100.51, 101.01, 101.51, 102.01; all stopped at 100.01; result in R: 4 units, exit 100.01, -3.1000 R (by hand -3.1000) [PASS] S2-1U on the same days: one unit, no stop moved, out at the 20-day low (99.49) above its 2N stop (98.51): 1 unit, exit 99.49 (exit) [PASS] thin day: excluded from the valid days (levels and N), its minutes still execute: the stop, gapped through, fills at its open (98.0): valid 63 of 64, first trade 1 100.51 98 stop 2024-03-02T18:01, thin day opens 2024-03-02T18:01 thin=true real data: 7067434 minutes, 5736 days (5702 with at least 30 minutes), 2004-06-11 .. 2026-10-07 [PASS] daily bars equal a naive grouping by New York trading day: 5736 days, 0 differences [PASS] N equals a naive recomputation: largest difference 5.68e-14 [PASS] 10-, 20- and 55-day highs and lows equal a brute-force search (every 37th day): 0 differences [PASS] TT-S1-1U: engine and independent re-implementation agree trade by trade: 189 vs 189 trades, 0 differences [PASS] TT-S1-1U: control at offset 0 enters only on the real entry days and directions: 175 control entries of 189 real (the rest fall while a control position is still open) [PASS] TT-S1-4U: engine and independent re-implementation agree trade by trade: 189 vs 189 trades, 0 differences [PASS] TT-S1-4U: control at offset 0 enters only on the real entry days and directions: 182 control entries of 189 real (the rest fall while a control position is still open) [PASS] TT-S2-1U: engine and independent re-implementation agree trade by trade: 103 vs 103 trades, 0 differences [PASS] TT-S2-1U: control at offset 0 enters only on the real entry days and directions: 98 control entries of 103 real (the rest fall while a control position is still open) [PASS] TT-S2-4U: engine and independent re-implementation agree trade by trade: 117 vs 117 trades, 0 differences [PASS] TT-S2-4U: control at offset 0 enters only on the real entry days and directions: 106 control entries of 117 real (the rest fall while a control position is still open) EUR/USD data: 8326700 minutes, 5908 days (5906 with at least 30 minutes) [PASS] EUR TT-S1-1U: engine and independent re-implementation agree trade by trade: 202 vs 202 trades, 0 differences [PASS] EUR TT-S1-4U: engine and independent re-implementation agree trade by trade: 203 vs 203 trades, 0 differences [PASS] EUR TT-S2-1U: engine and independent re-implementation agree trade by trade: 122 vs 122 trades, 0 differences [PASS] EUR TT-S2-4U: engine and independent re-implementation agree trade by trade: 136 vs 136 trades, 0 differences [PASS] BTC cost: 0.1% of each fill, 0.21 on a round trip 100 -> 110: 0.21 [PASS] BTC swap nights: Thursday noon to Monday noon = 1 (Thu) + 3 (Fri) + 0 (Sat) + 0 (Sun) = 4; within one day 0; across one midnight 1; Saturday to Sunday 0: 4 0 1 0 [PASS] BTC: the S1 hand case with days on the UTC clock and the percent cost; result in R by hand: 0.239150 R, by hand 0.239150 [PASS] BTC scenario B: -20% a year / 365 of the fill price per night held (none for shorts): 11 nights, -0.063757 R [PASS] BTC scenario A: 10% a year of the fill price per calendar day held: 0.087676 R Bitcoin data: 4789278 minutes, 3332 days (3331 with at least 30 minutes), 2017-08-17 .. 2026-09-30 [PASS] BTC daily bars equal a naive grouping by UTC calendar date, every day of the week: 3332 days, 0 differences [PASS] BTC N equals a naive recomputation (relative): largest relative difference 8.72e-16 [PASS] BTC TT-S1-1U: engine and independent re-implementation agree trade by trade: 103 vs 103 trades, 0 differences [PASS] BTC TT-S1-1U: control at offset 0 enters only on the real entry days and directions [PASS] BTC TT-S1-4U: engine and independent re-implementation agree trade by trade: 103 vs 103 trades, 0 differences [PASS] BTC TT-S1-4U: control at offset 0 enters only on the real entry days and directions [PASS] BTC TT-S2-1U: engine and independent re-implementation agree trade by trade: 62 vs 62 trades, 0 differences [PASS] BTC TT-S2-1U: control at offset 0 enters only on the real entry days and directions [PASS] BTC TT-S2-4U: engine and independent re-implementation agree trade by trade: 75 vs 75 trades, 0 differences [PASS] BTC TT-S2-4U: control at offset 0 enters only on the real entry days and directions PASSED