RSI 30/70 engine self-test 2026-10-14T13:26:57.663Z [PASS] RSI: NaN before the 14th change; 100 when there is no loss; Wilder averages after the seed: 100, 100, 86.66666666666667 [PASS] RSI: the seed is the plain average of the first 14 gains and losses: 65 vs 65 [PASS] EMA seeded with the simple average [PASS] long: RSI up through 30 at bar 2, filled at the next minute open (bar 3 open 101); out when RSI reaches 70 (bar 5), at the next open (bar 6 opens at 104): {"dir":1,"date":"2024-01-03","entryT":28404604,"exitT":28404607,"entry":101,"exit":104,"R":2,"stop":null,"reason":"rsi","gross":1.5,"pnl":1.35,"usd":2.7,"pnlA":1.349991358658453,"pnlB":1.35,"nights":0,"signalT":28404603} [PASS] short: RSI down through 70 at bar 2 (long and short only), out at RSI <= 30 (bar 5); long only ignores it; RSI back over 30 at bar 6 opens a long: -1@101 1@105 | 1 [PASS] one position at a time: a second cross up through 30 while long is ignored: 1 [PASS] filter: a long below its EMA200 is not taken [PASS] filter: above its EMA200 the long is taken, same exit as the classic version [PASS] stop 1R = 2 below the fill (99): touched in bar 4, filled at the stop: {"dir":1,"date":"2024-01-03","entryT":28404604,"exitT":28404605,"entry":101,"exit":99,"R":2,"stop":99,"reason":"stop","gross":-1,"pnl":-1.15,"usd":-2.3,"pnlA":-1.1500028804471822,"pnlB":-1.15,"nights":0,"signalT":28404603} [PASS] stop in the entry minute [PASS] a stop gapped through fills at the open (97.2): {"dir":1,"date":"2024-01-03","entryT":28404604,"exitT":28404605,"entry":101,"exit":97.2,"R":2,"stop":99,"reason":"stop","gross":-1.8999999999999986,"pnl":-2.0499999999999985,"usd":-4.099999999999997,"pnlA":-2.0500028804471806,"pnlB":-2.0499999999999985,"nights":0,"signalT":28404603} [PASS] swap nights equal the count of the earlier gold tests (17:00 New York, Wednesday three) on 400 holding periods: 0 differences [PASS] scenario A: 3% a year of the entry per calendar day; scenario B: nights x -0.5703 for a long real data: 7067434 minutes, 2004-06-11 00:19 .. 2026-10-07 16:57 New York (stamps at the minute's close) [PASS] 5-minute RSI equals a naive recomputation (first 30 sample bars): largest difference 0.00e+0 [PASS] RS-M5-LS: engine and independent re-implementation agree trade by trade: 10881 vs 10881 trades, 0 differences [PASS] RS-M5-LS-F: engine and independent re-implementation agree trade by trade: 3590 vs 3590 trades, 0 differences [PASS] RS-M5-L: engine and independent re-implementation agree trade by trade: 5440 vs 5440 trades, 0 differences [PASS] RS-M5-L-F: engine and independent re-implementation agree trade by trade: 1938 vs 1938 trades, 0 differences [PASS] 60-minute RSI equals a naive recomputation (first 30 sample bars): largest difference 0.00e+0 [PASS] RS-H1-LS: engine and independent re-implementation agree trade by trade: 1074 vs 1074 trades, 0 differences [PASS] RS-H1-LS-F: engine and independent re-implementation agree trade by trade: 363 vs 363 trades, 0 differences [PASS] RS-H1-L: engine and independent re-implementation agree trade by trade: 537 vs 537 trades, 0 differences [PASS] RS-H1-L-F: engine and independent re-implementation agree trade by trade: 203 vs 203 trades, 0 differences [PASS] RS-H1-LS: control at offset 0 reproduces the real trades: 1074 of 1074, 0 differences [PASS] RS-H1-LS-F: control at offset 0 reproduces the real trades: 363 of 363, 0 differences [PASS] RS-H1-L: control at offset 0 reproduces the real trades: 537 of 537, 0 differences [PASS] RS-H1-L-F: control at offset 0 reproduces the real trades: 203 of 203, 0 differences PASSED