It seems that the problem is the WFO

When I comment this part out, the number of trades match.
Code
NumWFOCycles=3;



Why are the WFO results different when I optimize the whole portfolio with an asset loop and when I optimize for each asset independently?