Optimization can be a valuable tool, but running an optimization over a broad range of parameters can also be time consuming. When optimizing a trading system with three parameters, it is possible to have 20,000 or even 50,000 combinations. A system with seven or eight parameters could have millions of combinations. Assuming that each test took one second, one million combinations would take 11.5 days to test completely.
If that 11-day optimization could be run in a couple of hours, the efficiency of creating trading systems could be greatly increased. This is possible by using genetic algorithms.
Genetic algorithms belong to the class of stochastic search methods that also includes techniques such as simulated annealing, threshold acceptance and some forms of “branch and bound.” Whereas most stochastic search methods operate on a single solution to the problem, genetic algorithms operate on a population of solutions.
To use a genetic algorithm, you must encode solutions to your problem in a structure that can be stored in the computer. This object is known as a genome or chromosome. The genetic algorithm creates a population of genomes, and then applies crossover and mutation to the individuals in the population to generate new individuals. It uses various selection criteria so that it picks the best individuals for mating and subsequent crossover. Your objective function, such as net profit or win percentage, determines how good each individual is.
The genetic algorithm is simple, but it performs well on many different types of problems. There are many ways to modify the basic algorithm and many parameters that can be tweaked. If the objective function is right, the representation is right and the operators are right, then variations on the genetic algorithm and its parameters will result in only minor improvements.
Genetic algorithms are a good solution for a wide range of uses when developing trading systems. They can be used for finding optimal sets of parameters because fitness functions can be developed incorporating measures of performance and robustness. Genetic algorithms can also be used to combine trading concepts and effectively evolve trading rules. It’s a smart approach to optimization if implemented correctly and it should not require any coding to use it as an optimizer.
Using genetic algorithms to evolve trading rules is becoming more feasible. It requires programming ability but allows for dynamic development of trading systems and the ability to test ideas. This process, which would normally take months, can be accomplished in a few days.