Genetic algorithms are algorithms that mimic natural selection. This is a simple evolving algorithm that trades top stocks. Essentially, momentum strategies are randomly generated. Based on how those strategies would perform over a period of time (30 days), the best performers, or parents, are selected. Using attributes these parents have, new algorithms are generated that have similar attributes to the parents. This process is then repeated. Trades are made using the overall best performing algorithm.
Here's a cool example of a genetic algorithm: http://rednuht.org/genetic_cars_2/
Although the strategies being evolved are basic and don't perform great, this is just meant to be an example. I think there are a lot of ways one could extend this, like moving away from momentum or importing relevant data from a CSV file. There are also some variables that can easily be adjusted that may lead to better results, and the code is commented. Clone this, play around with it, and let me know what you think!