I appear to have an issue with Trailing Stop when using IB broker.

Trailing stop setup in the code:

Trail = optimize(5,5,10)*ATR(100);
TrailLock = optimize(50,50,95);

Please review the log file below. There were two trades opened on EUR/USD recently. Both with Trailing stops and TrailLocks.
For one trade, the trailing stop was set to 1.11305, (highlighted at bold below) and 10 mins later the stop was triggered and closed the trade at 1.11027. 1.11027 should not have triggered the stop and the price was nowhere near 1.11305 where the stop was.

Note, that I am running the same script with FXCM broker and this issue did not appear on that account.


[EUR/USD:CNTR:S5838] Short 1@1.11900 Risk 253 tl at 05:00:00

[Tue 19-08-13 06:00] 2201 0 -7.30 \ (1.11933)
[Tue 19-08-13 07:00] 2207 0 -7.30 \ (1.11933)
[Tue 19-08-13 08:00] 2433 0 -6.04 \ (1.11926)
[Tue 19-08-13 09:00] 2435 0 -4.96 \ (1.11920)
[Tue 19-08-13 10:00] 2389 0 -29.80 \ (1.12058)
[Tue 19-08-13 11:00] 2352 0 -48.70 \ (1.12163)
[Tue 19-08-13 12:00] 2359 0 -46.00 \ (1.12148)
[Tue 19-08-13 13:00] 2348 0 -49.78 \ (1.12169)
[Tue 19-08-13 14:00] 2471 0 +8.18 / (1.11847)
[Tue 19-08-13 15:00] 2454 0 +2.60 / (1.11878)
[Tue 19-08-13 16:00] 2467 0 +10.88 / (1.11832)
[Tue 19-08-13 17:00] 2479 0 +17.00 / (1.11798)
[EUR/USD:CNTR:S3322] Short 1@1.11798 Risk 280 tl at 17:00:00

[Tue 19-08-13 18:00] 1949 0 +29.86 // (1.11759)
[Tue 19-08-13 19:00] 1947 0 +37.78 // (1.11737)
[Tue 19-08-13 20:00] 1964 0 +37.78 // (1.11737)
[Tue 19-08-13 21:00] 1826 0 -107 \\ (1.12140)
[Tue 19-08-13 22:00] 1968 0 +39.94 // (1.11731)
!Not connected EUR-CASH--0--IDEALPRO--USD
!Not connected EUR-CASH--0--IDEALPRO--USD
!Account U1629920
[Tue 19-08-13 23:00] 1956 0 +33.10 // (1.11750)
[Wed 19-08-14 00:00] 1942 0 +27.34 // (1.11766)

Wednesday 19-08-14 Profit +27.34 ----
[Wed 19-08-14 01:00] 1936 0 +21.94 // (1.11781)
[Wed 19-08-14 02:00] 1970 0 +42.46 // (1.11724)
[Wed 19-08-14 03:00] 1940 0 +30.94 // (1.11756)
[Wed 19-08-14 04:00] 1977 0 +47.50 // (1.11710)
[Wed 19-08-14 05:00] 1970 0 +43.54 // (1.11721)
[Wed 19-08-14 06:00] 2007 0 +62.62 // (1.11668)
[Wed 19-08-14 07:00] 1930 0 +23.02 // (1.11778)
[Wed 19-08-14 08:00] 1906 0 +15.10 /\ (1.11800)
[Wed 19-08-14 09:00] 1936 0 +26.62 // (1.11768)
[Wed 19-08-14 10:00] 1921 0 +19.06 // (1.11789)
[Wed 19-08-14 11:00] 1922 0 +15.46 /\ (1.11799)
[Wed 19-08-14 12:00] 1886 0 +1.42 /\ (1.11838)
[Wed 19-08-14 13:00] 1933 0 +23.74 // (1.11776)
[Wed 19-08-14 14:00] 2061 0 +97.18 // (1.11572)
[Wed 19-08-14 15:00] 2125 0 +125 // (1.11494)
[Wed 19-08-14 16:00] 2168 0 +145 // (1.11438)
[Wed 19-08-14 17:00] 2165 0 +143 // (1.11444)
[Wed 19-08-14 18:00] 2185 0 +153 // (1.11417)
[Wed 19-08-14 19:00] 2203 0 +163 // (1.11390)
[Wed 19-08-14 20:00] 2226 0 +182 // (1.11337)
[Wed 19-08-14 21:00] 2084 0 +43.90 // (1.11720)
[Wed 19-08-14 22:00] 2185 0 +152 // (1.11421)
!Not connected EUR-CASH--0--IDEALPRO--USD
!Not connected EUR-CASH--0--IDEALPRO--USD
[Wed 19-08-14 23:00] 2168 0 +144 // (1.11443)
[Thu 19-08-15 00:00] 2187 0 +159 // (1.11400)

Thursday 19-08-15 Profit +132 ----
[Thu 19-08-15 01:00] 2181 0 +152 // (1.11421)
[Thu 19-08-15 02:00] 2187 0 +159 // (1.11400)
[Thu 19-08-15 03:00] 2177 0 +153 // (1.11417)
[Thu 19-08-15 04:00] 2137 0 +131 // (1.11478)
[Thu 19-08-15 05:00] 2111 0 +118 // (1.11513)
[Thu 19-08-15 06:00] 2127 0 +128 // (1.11487)
[Thu 19-08-15 07:00] 2134 0 +128 // (1.11487)
[Thu 19-08-15 08:00] 2135 0 +130 // (1.11481)
[Thu 19-08-15 09:00] 2131 0 +129 // (1.11484)
[Thu 19-08-15 10:00] 2117 0 +120 // (1.11508)
[Thu 19-08-15 11:00] 2095 0 +109 // (1.11540)
[Thu 19-08-15 12:00] 2116 0 +118 // (1.11513)
[Thu 19-08-15 13:00] 2178 0 +151 // (1.11422)
[Thu 19-08-15 14:00] 2388 0 +257 // (1.11127)
[EUR/USD:CNTR:S5838] Trail 1@1.11900 Stop 1.11329 at 14:24:27
[EUR/USD:CNTR:S5838] Trail 1@1.11900 Stop 1.11305 at 14:24:37
[EUR/USD:CNTR:S5838] Stop 1@1.11027: +156 at 14:34:27


[Thu 19-08-15 15:00] 2827 +156 +129 / (1.11074)