pin bar self-test, run 2026-11-24T12:53:01.124Z [PASS] shape: lower tail exactly two thirds of the range is a bullish pin bar [PB-BRK] [PASS] shape: one cent less (open 1000.99) is not a pin bar [PB-BRK] [PASS] shape: a down-coloured bar with the long lower tail is a bullish pin bar [PB-BRK] [PASS] shape: a doji at the high end (open = close = high) is a bullish pin bar [PB-BRK] [PASS] shape: the bearish mirror (upper tail 210 of 300 cents, high above the last 10 highs) [PB-BRK] [PASS] size: range $0.40 = ATR(14) of the bar before passes [PB-BRK] [PASS] size: range $0.39 < ATR(14) $0.40 fails [PB-BRK] [PASS] nose: a low equal to the 10-bar low fails [PB-BRK] [PASS] nose: one cent below the 10-bar low passes [PB-BRK] [PASS] nose: a lower low 11 bars back does not count [PB-BRK] [PASS] break: filled by touch at 1002.01, R 3.02, target 1008.05 reached [PB-BRK] [PASS] break: a gapped open at 1002.50 fills at the open, then the stop at 998.99 [PB-BRK] [PASS] break: not reached in the next bar, cancelled (a later break is not taken) [PB-BRK] [PASS] break, fill minute: the stop counts (low 998.90 in the fill minute) [PB-BRK] [PASS] break, fill minute: the target does not count; the next minute opens beyond it and fills at its open [PB-BRK] [PASS] break: stop and target in one later minute, the stop is taken [PB-BRK] [PASS] break, bearish: sell stop at 997.99 filled by touch, stop 1001.01 [PB-BRK] [PASS] half: filled on the third bar at 1000.50, R 1.51, target 1003.52 [PB-HALF] [PASS] half: not reached in three bars, cancelled (the fourth bar does not fill) [PB-HALF] [PASS] half: an open at 998.50, beyond the stop, gives no trade [PB-HALF] [PASS] half: an open below the level but above the stop fills at the open (1000.30) [PB-HALF] [PASS] a pin bar while a trade is open is ignored [PB-BRK] [PASS] a trade stopped inside the pin bar's own bar leaves that bar free [PB-BRK] [PASS] a pin bar while a half order is working is ignored [PB-HALF] [PASS] trend: a bullish pin bar closing above the EMA(200) is traded [PB-TREND] [PASS] trend: a bullish pin bar closing below the EMA(200) is not [PB-TREND] [PASS] trend: the same bar is traded without the filter [PB-BRK] [PASS] trend: a bearish pin bar closing below the EMA(200) is traded [PB-TREND] [PASS] trend: a bearish pin bar closing above the EMA(200) is not [PB-TREND] [PASS] long only: a bearish pin bar is not traded [PB-BRK-L] [PASS] long only: a bullish pin bar is traded [PB-BRK-L] [PASS] EMA(200) of 230 closes at 1000 = 1000 real data: 7067434 minutes, 2004-06-11 01:19 .. 2026-10-07 16:57; 129857 one-hour bars [PASS] 1-hour bars: engine 129857, re-implementation 129857; 0 differ [PASS] ATR(14) largest difference 2.52e-13; EMA(200) largest difference 0.00e+0 (dollars) [PASS] pin bars: engine 2008, re-implementation 2008, identical bar by bar [PASS] PB-BRK: engine 1252 trades, re-implementation 1252; 0 differ [PASS] PB-TREND: engine 526 trades, re-implementation 526; 0 differ [PASS] PB-HALF: engine 1415 trades, re-implementation 1415; 0 differ [PASS] PB-BRK-L: engine 754 trades, re-implementation 754; 0 differ [PASS] no look-ahead, data cut after the bar closing 2011-04-19 06:00: 595 pin bars and 1159 completed trades (four variants) identical to the full data [PASS] no look-ahead, data cut after the bar closing 2015-09-28 10:00: 1033 pin bars and 2013 completed trades (four variants) identical to the full data [PASS] no look-ahead, data cut after the bar closing 2020-02-28 16:00: 1427 pin bars and 2762 completed trades (four variants) identical to the full data [PASS] no look-ahead, data cut after the bar closing 2024-07-23 01:00: 1841 pin bars and 3599 completed trades (four variants) identical to the full data [PASS] PB-BRK control at offset 0: moved entries = the 1252 real fills; 1245 control trades, 1245 of them at a real fill minute with the same direction and R (the rest dropped by the one-position rule, as the control enters at the minute's open) [PASS] PB-TREND control at offset 0: moved entries = the 526 real fills; 522 control trades, 522 of them at a real fill minute with the same direction and R (the rest dropped by the one-position rule, as the control enters at the minute's open) [PASS] PB-HALF control at offset 0: moved entries = the 1415 real fills; 1413 control trades, 1413 of them at a real fill minute with the same direction and R (the rest dropped by the one-position rule, as the control enters at the minute's open) [PASS] PB-BRK-L control at offset 0: moved entries = the 754 real fills; 749 control trades, 749 of them at a real fill minute with the same direction and R (the rest dropped by the one-position rule, as the control enters at the minute's open) 47 checks, 0 failed PASSED