Self-test of cci_spec.md, 2026-11-08T12:52:39.346Z ok CCI by hand on bar 19 (= 9.5 / 0.075 = 126.666...) ok CCI by hand on bar 20 (typical price at its SMA 11.025: (10.5 - 11.025) / (0.015 x MD)) ok no CCI before 20 bars ok MD = 0 gives CCI 0 ok typical price = (H + L + C) / 3 ok BRK-LS: long above +100 until <= +100; short below -100 until >= -100 ok BRK-LS: a cross needs the previous value at or below +100 (starting above +100 gives no long) ok BRK-LS: long exit and short entry on one close ok BRK-L: shorts stay flat ok REV-LS: long when back above -100, out at >= 0 ok REV-LS: long out when back at or below -100 (failed) ok REV-LS: short when back below +100, out at <= 0 or >= +100 ok ZERO-LS: the side of zero, 0 keeps the previous side, flat before the first nonzero ok a change at bar 1 fills at the open of the minute after the bar (minute 4) ok a reversal closes and opens at the same fill ok going flat closes at the next minute open ok a change on the last bar does not open (no minute follows), nothing open closes at the end ok a position open at the end closes at the last close ok costs: $0.30 per round trip, R from the signal bar data: 7067434 minutes, 129857 one-hour bars ok CCI-BRK-LS: every trade enters at the minute after its signal bar, on a change of the target - 11900 trades ok CCI-BRK-LS: engine = reference, trade by trade - engine 11900, reference 11900, differences 0 ok CCI-BRK-LS: the control at offset 0 = the real trades ok CCI-BRK-L: every trade enters at the minute after its signal bar, on a change of the target - 6111 trades ok CCI-BRK-L: engine = reference, trade by trade - engine 6111, reference 6111, differences 0 ok CCI-BRK-L: the control at offset 0 = the real trades ok CCI-REV-LS: every trade enters at the minute after its signal bar, on a change of the target - 11894 trades ok CCI-REV-LS: engine = reference, trade by trade - engine 11894, reference 11894, differences 0 ok CCI-REV-LS: the control at offset 0 = the real trades ok CCI-ZERO-LS: every trade enters at the minute after its signal bar, on a change of the target - 12417 trades ok CCI-ZERO-LS: engine = reference, trade by trade - engine 12417, reference 12417, differences 0 ok CCI-ZERO-LS: the control at offset 0 = the real trades PASSED