|
|
|
|
|
Find Your Edge... If you're still looking for an edge in the markets, mechanical trading systems are the best way to get it. Learn more.
|
Build Algorithm
The build algorithm used in Adaptrade Builder is illustrated below. The core element of the algorithm is genetic programming (GP), which evolves a population of trading strategies based on their fitness. Fitter strategies combine to produce offspring strategies in analogy to the biological processes of reproduction and evolution.
The gray-shaded boxes in the figure represent the input data, which includes the price data for the market of interest, the indicators and order types in the so-called build set, and the options and performance criteria (build goals) selected by the user.
The algorithm starts with the Strategy Generation step. An initial population of trading strategies is randomly developed from the available technical indicators and rule types in the build set. Any options that the user has selected, such as exiting all positions at end-of-day, are applied at this point. Each strategy is then evaluated over the price data for the market of interest, and a fitness value is assigned based on a weighted average of the build goals specified by the user. For example, you might select net profit and drawdown as the two performance metrics and weight each one equally. The fitness would then be the average of the (normalized) net profit and drawdown.
To generate new members of the population, members of the current population are selected at random, and the fitter ones are chosen as parents for crossover and mutation. A less fit member is selected at random to be replaced by the new member. The process is repeated until as many new members have been created as there are members in the current population. This step represents one generation.
If the user has selected the Reset on Out-of-Sample Performance option, the out-of-sample results for the top strategy are checked after each specified number of generations. If the results are not above the threshold chosen by the user, the process is reset, which causes the population to be re-initialized and the generation count to be reset to zero. After the specified number of generations has been successfully completed, the top strategies are listed in the Performance table in order of fitness.
Entry and Exit ConditionsThe GP process evolves two essential strategy elements simultaneously: entry and exit conditions and orders for entry and exit. The entry and exit conditions are represented as tree structures, as shown below.
The tree structure enables the generation of conditions with considerable complexity. Each node in the tree has between zero and three inputs, each of which leads to further branching. The tree is constructed recursively starting at the top with a logical operator (and, or, >, <, etc.) and proceeding to technical indicator functions, prices, and constants, such as indicator lengths. Each branch is terminated with a node that has no inputs. Available indicators in Builder are listed in Table 1, below. These are described in detail in the appendix to the user's guide. Custom indicators may be read into Builder as well.
Table 1. Available Indicators in Builder
The crossover operator of the GP process replaces a subtree in one parent
with a subtree from the other parent. For example, the subtree on the right of
the tree diagram, starting with “>” (i.e., SlowD(14) > FastK(5)), might be
replaced with a different subtree from another member of the population.
Mutation changes individual nodes in the tree. For example, the “Average” node
might be replaced with “Lowest” so that the subtree Average(H, 23) becomes
Lowest(H, 23). For additional information on the build process, including a description of the types of entry and exit orders and the general structure of trading strategies in Builder, please see the Introduction chapter in the user's guide.
Additional information on genetic programming for building trading strategies is available on the Articles page. Several newsletters illustrate the use of Builder and the genetic programming process.
Adaptrade Builder $1495 Lifetime License v1.x Terms & Conditions Ordering Information
|
|
||
Copyright © 2004-2013 Adaptrade Software. All rights reserved.