A couple of years ago I developed this little example of how to use a Genetic Algorithm in order to choose the best stocks to maximize the revenue taking into account a certain period previous to the evaluation. This is not a serious analysis or nothing close to it but it help the students od Intelligent Systems in the UDC to understand the parts and what can be done with Genetic Algorithm in a few lines of code.
It was develop in 2019 as a very simple example, therefore use it or adapt it at your own risk. No manteinence or warrantt is giving with it.