This does not answer my actual question:

How should I do this? I want to compute a stock selection at the end of the WFOCycle and only trade that selection in TESTMODE and TRAINMODE.

But I assume then there is no way.