For my stock trading algorithm I wanted to compute trade statistics while training in the EXITRUN and then sort the stocks based on performance and only use the best 25 stocks in the test run. For that I would have written a file containing the stock selection and read that during the test run.

Now I tried a bit but found out, that I somehow don't have all the statistics of all the stocks in the EXITRUN.

It seems the script is run multiple times, every time with just one asset and it is run multiple times, for each parameter step once.

So I get multiple EXITRUNs but I don't know which one will be the correct one.


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.