I got confirmation that your script had no peeking bias. So the result from the previous version was in fact correct, but the test result from the current version was wrong, due to a bug. The bug affects systems when TICKS mode is set and trades are entered in a TMF due to exit reversal.

Sorry for that. This will be fixed in the next update, but inbetween set the FAST flag additionally to TICKS. This will emulate the TICKS mode of the previous version and should produce a correct result.