With the help of some other algorithms that I have found through the community, I made my first approach to ERP5 investing strategy. 

The strategy was suposed to select new stocks every 3 months but as you can see if you backtest , it seems that it only picks a few in the first year. I dont know if it is really a bug in the code or is the algorithm that thinks this stocks are always the best. 

Feel free to make changes! One good change would be some risk management like stoploss on each stocks, maybe drawdown could be reduced.