Burton suggested in his book, "A Random Walk Down Wall Street", (1973) that, "A blindfolded monkey throwing darts at a newspaper's financial pages could select a portfolio that would do just as well as one carefully selected by experts." While evolution may have made man no more intelligent at picking stocks, Charles Darwin's theory has quite effective when applied more directly. (To help you pick stocks, check out How To Pick A Stock.)

TUTORIAL: Stock-Picking Strategies

What Are Genetic Algorithms?
Genetic algorithms (GAs) are problem solving methods (or heuristics) that mimic the process of natural evolution. Unlike artificial neural networks (ANNs), designed to function like neurons in the brain, these algorithms utilize the concepts of natural selection to determine the best solution for a problem. As a result, GAs are commonly used as optimizers that adjust parameters to minimize or maximize some feedback measure, which can then be used independently or in the construction of an ANN.

In the financial markets, genetic algorithms are most commonly used to find the best combination values of parameters in a trading rule, and they can be built into ANN models designed to pick stocks and identify trades. Several studies have demonstrated that these methods can prove effective, including "Genetic Algorithms: Genesis of Stock Evaluation" (2004) by Rama, and "The Applications of Genetic Algorithms in Stock Market Data Mining Optimization" (2004) by Lin, Cao, Wang, Zhang. (To learn more about ANN, see Neural Networks: Forecasting Profits.)

How Genetic Algorithms Work
Genetic algorithms are created mathematically using vectors, which are quantities that have direction and magnitude. Parameters for each trading rule are represented with a one-dimensional vector that can be thought of as a chromosome in genetic terms. Meanwhile, the values used in each parameter can be thought of as genes, which are then modified using natural selection.

For example, a trading rule may involve the use of parameters like Moving Average Convergence-Divergence (MACD), Exponential Moving Average (EMA) and Stochastics. A genetic algorithm would then input values into these parameters with the goal of maximizing net profit. Over time, small changes are introduced and those that make a desirably impact are retained for the next generation.

There are three types of genetic operations that can then be performed:

  • Crossovers represent the reproduction and biological crossover seen in biology, whereby a child takes on certain characteristics of its parents.
  • Mutations represent biological mutation and are used to maintain genetic diversity from one generation of a population to the next by introducing random small changes.
  • Selections are the stage at which individual genomes are chosen from a population for later breeding (recombination or crossover).

These three operators are then used in a five-step process:

  1. Initialize a random population, where each chromosome is n-length, with n being the number of parameters. That is, a random number of parameters are established with n elements each.
  2. Select the chromosomes, or parameters, that increase desirable results (presumably net profit).
  3. Apply mutation or crossover operators to the selected parents and generate an offspring.
  4. Recombine the offspring and the current population to form a new population with the selection operator.
  5. Repeat steps two to four.

Over time, this process will result in increasingly favorable chromosomes (or, parameters) for use in a trading rule. The process is then terminated when a stopping criteria is met, which can include running time, fitness, number of generations or other criteria. (For more on MACD, read Trading The MACD Divergence.)

Using Genetic Algorithms in Trading
While genetic algorithms are primarily used by institutional quantitative traders, individual traders can harness the power of genetic algorithms - without a degree in advanced mathematics - using several software packages on the market. These solutions range from standalone software packages geared towards the financial markets to Microsoft Excel add-ons that can facilitate more hands-on analysis.

When using these applications, traders can define a set of parameters that are then optimized using a genetic algorithm and a set of historical data. Some applications can optimize which parameters are used and the values for them, while others are primarily focused on simply optimizing the values for a given set of parameters. (To learn more about these program derived strategies, see The Power Of Program Trades.)

Important Optimization Tips and Tricks
Curve fitting (over fitting), designing a trading system around historical data rather than identifying repeatable behavior, represents a potential risk for traders using genetic algorithms. Any trading system using GAs should be forward-tested on paper before live usage.

Choosing parameters is an important part of the process, and traders should seek out parameters that correlate to changes in the price of a given security. For example, try out different indicators and see if any seem to correlate with major market turns.

The Bottom Line
Genetic algorithms are unique ways to solve complex problems by harnessing the power of nature. By applying these methods to predicting securities prices, traders can optimize trading rules by identifying the best values to use for each parameter for a given security. However, these algorithms are not the Holy Grail, and traders should be careful to choose the right parameters and not curve fit (over fit). (To read more about the market, check out Listen To The Market, Not Its Pundits.)

Related Articles
  1. Investing Basics

    3 Alternative Investments the Ultra-Rich Usually Own

    Learn about the ultra rich and what normally comprises their net worth; understand the top three alternative investments usually owned by the ultra rich.
  2. Chart Advisor

    These Oil & Gas Stocks Have Reversed

    It's been a long downtrend for oil stock owners, but there's hope. These four oil and gas stocks have reversed and may keep trending to the upside.
  3. Mutual Funds & ETFs

    Top 3 Commodities Mutual Funds

    Get information about some of the most popular and best-performing mutual funds that are focused on commodity-related investments.
  4. Mutual Funds & ETFs

    Top 4 Asia-Pacific ETFs

    Learn about four of the best-performing exchange-traded funds, or ETFs, that offer investors exposure to the Asia-Pacific region.
  5. Chart Advisor

    4 European Stocks to Consider Buying

    European companies, listed on US exchanges, that are providing buying opportunities right now.
  6. Investing Basics

    What Does In Specie Mean?

    In specie describes the distribution of an asset in its physical form instead of cash.
  7. Economics

    Calculating Cross Elasticity of Demand

    Cross elasticity of demand measures the quantity demanded of one good in response to a change in price of another.
  8. Investing Basics

    3 Key Signs Of A Market Top

    When stocks rise or fall, the financial fate of investors change, as well. There are certain signs that can reveal a stock’s course, and investors don’t need to be experts to spot them.
  9. Investing

    Have Commodities Bottomed?

    Commodity prices have been heading lower for more than four years, being the worst performing asset class of 2015 with more losses in cyclical commodities.
  10. Chart Advisor

    ChartAdvisor for October 2 2015

    Weekly technical summary of the major U.S. indexes.
  1. What are some of the most common technical indicators that back up Doji patterns?

    The doji candlestick is important enough that Steve Nison devotes an entire chapter to it in his definitive work on candlestick ... Read Full Answer >>
  2. Tame Panic Selling with the Exhausted Selling Model

    The exhausted selling model is a pricing strategy used to identify and trade based off of the price floor of a security. ... Read Full Answer >>
  3. Point and Figure Charting Using Count Analysis

    Count analysis is a means of interpreting point and figure charts to measure vertical price movements. Technical analysts ... Read Full Answer >>
  4. Where do penny stocks trade?

    Generally, penny stocks are traded through the use of the Over the Counter Bulletin Board (OTCBB) and through pink sheets. ... Read Full Answer >>
  5. Where can I buy penny stocks?

    Some penny stocks, those using the definition of trading for less than $5 per share, are traded on regular exchanges such ... Read Full Answer >>
  6. What assumptions are made when conducting a t-test?

    The common assumptions made when doing a t-test include those regarding the scale of measurement, random sampling, normality ... Read Full Answer >>

You May Also Like

Hot Definitions
  1. Section 1231 Property

    A tax term relating to depreciable business property that has been held for over a year. Section 1231 property includes buildings, ...
  2. Term Deposit

    A deposit held at a financial institution that has a fixed term, and guarantees return of principal.
  3. Zero-Sum Game

    A situation in which one person’s gain is equivalent to another’s loss, so that the net change in wealth or benefit is zero. ...
  4. Capitalization Rate

    The rate of return on a real estate investment property based on the income that the property is expected to generate.
  5. Gross Profit

    A company's total revenue (equivalent to total sales) minus the cost of goods sold. Gross profit is the profit a company ...
  6. Revenue

    The amount of money that a company actually receives during a specific period, including discounts and deductions for returned ...
Trading Center
You are using adblocking software

Want access to all of Investopedia? Add us to your “whitelist”
so you'll never miss a feature!