It is peeking at the test data. Because OptimalF is taken from the complete test, the current walk affects the factors and is thus not completely out of sample. The effect is not large, but it is there.

OptimalF calculation needs as many trades as possible, that's why it's taken from the complete test by default.