How Genetic Algorithms Can Improve a Trading System
by Murray Ruggiero
The following
is an excerpt from Murray Ruggiero's Cybernetic Trading Strategies
The process of developing a good trading strategy requires an iterative process of development and testing that could require weeks or months for even a market wizard. A technology called “genetic algorithms” can speed up this process by a factor of 1,000 to 10,000 or more, and allow the trader to incorporate his or her expertise into this solution.
Genetic algorithms were invented by John Holland during the mid-1970s to solve hard optimization problems. This method uses the natural selection, so-called “survival of the fittest”, to solve optimization problems using computer software.
There are three main components to a genetic algorithm: first, a way of describing the problem in terms of a genetic code, like a DNA chromosome; second, a way to simulate evolution by creating offspring of the chromosomes, each being slightly different from its parents; and third, a way to evaluate the goodness of each of the offspring.
Genetic algorithms have many uses in developing trading applications. Some of these are: 1) evolving a neural network, 2) evolving trading rules, 3) combining or selecting multiple trading strategies or 4) using money management applications.
Neural Usage: There are two different types of applications in using genetic algorithms to build neural nets. The first is to evolve inputs and/or the configuration of your network.
Genetic algorithms can find near-optimal solutions for NP Complete type problems. These are problems in which the number of combinations makes it impossible to try all of them in a lifetime. Genetic algorithms can intelligently search subsets of these solutions to find a near-optimal solution for these problems quickly, even on a desktop computer. This makes it practical to search for the best possible input and configurations for our neural network architecture.
To select the configuration, we’ll use a neural network that had 49 inputs and 10 hidden nodes for our example. Ideally, we would like to eliminate inputs from our model that can be removed without degrading the trading performance. Even for a network of this size, trying all of the combinations becomes an NP complete type problem. However, we could use genetic algorithms to select a near optimal architecture for this neural network.
The first step in developing this solution is to design our chromosome. We’ll use two genes. The first will contain 49 binary elements, one for each input. The second gene will contain information used in the internals of the neural network. These are: the number of hidden nodes, the initial weight range and learning rate.
Next, we need to develop a fitness function. We’ll base our fitness function on actual trading performance of the neural network tested using a simple system and not the accuracy of the neural network or its correlation with the target.
Genetic Algorithms
|