Building Trading Systems Using Automatic Code Generation

Posted: Feb 03, 2011 |Comments: 0 |

As more and more traders have moved to automated trading, the interest in systematic trading strategies has increased. While some traders develop their own trading strategies, the steep learning curve required to develop and implement a trading system is an impediment to many traders. A recently developed solution to this problem is the use of computer algorithms to automatically generate trading system code. The goal of this approach is to automate many of the steps in the traditional process of developing trading systems.

Automatic code generation software for building trading systems is often based on genetic programming (GP), which belongs to a class of techniques called evolutionary algorithms. Evolutionary algorithms and GP in particular were developed by researchers in artificial intelligence based on the biological concepts of reproduction and evolution. A GP algorithm "evolves" a population of trading strategies from an initial population of randomly generated members. Members of the population compete against each other based on their "fitness." The fitter members are selected as "parents" to produce a new member of the population, which replaces a weaker (less fit) member.

Two parents are combined using a technique called crossover, which mimics genetic crossover in biological reproduction. In crossover, part of one parent's genome is combined with part of the other parent's genome to produce the child genome. For trading system generation, genomes can represent different elements of the trading strategy, including various technical indicators, such as moving averages, stochastics, and so on; different types of entry and exit orders; and logical conditions for entering and exiting the market.

Other members of the population are produced via mutation, is which one member of the population is selected to be modified by randomly changing parts of its genome. Typically, a majority (e.g., 90%) of new members of the population are produced via crossover, with the remaining members produced via mutation.

Over successive generations of reproduction, the overall fitness of the population tends to increase. The fitness is based on a set of build goals that rank or score each strategy. Examples of build goals include various performance measures, such as the net profit, drawdown, percentage of winners, profit factor, and so on. These can be stated as minimum requirements, such as a profit factor of at least 2.0, or as objectives to maximize, such as maximizing the net profit. If there are multiple build goals, a weighted average can be used to form the fitness metric. The process is stopped after some number of generations or when the fitness stops increasing. The solution is generally taken as the fittest member of the resulting population, or the entire population might be sorted by fitness and saved for further review.

Because genetic programming is a type of optimization, over-fitting is a concern. This is typically addressed using out-of-sample testing, in which data not used to evaluate the strategies during the build phase is used to test them afterwards. Essentially, each candidate strategy constructed during the build process is a hypothesis that is either supported or refuted by the evaluation and further supported or refuted by the out-of-sample results.

There are several benefits to building trading systems via automatic code generation. The GP process enables the synthesis of strategies given only a high level set of performance goals. The algorithm does the rest. This reduces the need for detailed knowledge of technical indicators and strategy design principles. Also, the GP process is unbiased. Whereas most traders have developed biases for or against specific indicators and/or trading logic, GP is guided only by what works. Moreover, by incorporating proper trading rule semantics, the GP process can be designed to produce logically correct trading rules and error-free code. In many cases, the GP process produces results that are not only unique but non-obvious. These hidden gems would be nearly impossible to find any other way. Lastly, by automating the build process, the time required to develop a viable strategy can be reduced from weeks or months to a matter of minutes in some cases, depending on the length of the input price data file and other build settings.

Questions and Answers

Ask
200 Characters left
Rate this Article
  • 1
  • 2
  • 3
  • 4
  • 5
  • 0 vote(s)
    Feedback
    Print
    Re-Publish
    Source:  http://www.articlesbase.com/day-trading-articles/building-trading-systems-using-automatic-code-generation-4163043.html

    Article Tags:

    trading systems

    ,

    trading strategies

    ,

    automated trading

    ,

    systematic trading

    ,

    developing trading systems

    ,

    genetic programming

    ,

    automatic code generation

    These hidden gems could be nearly impossible to seek out some other way. Lastly, by automating the build process, the time required to develop a viable strategy may be reduced from weeks or months to a matter of minutes in some instances, relying on the length of the input worth information file and different build settings.

    By: minil Financel Feb 28, 2011

    The growing Indian market is attracting investors on the ground of the promising and assured return. The online trading is very popular these days and most of the people prefer it for quick money.

    By: Capitalaiml Finance> Day Tradingl May 26, 2012

    Learn the fundamentals of committing cash in Stocks, Ties, Common resources, Merchandise, Actual estate We create Getting Inventory Industry straightforward for you with a comprehensive guide to committing. Any effective stock market buyer must be acquainted with the fundamentals of stock market committing.

    By: wellindiaarticlel Finance> Day Tradingl May 24, 2012

    Online share trading is one of the most popular financial markets in the world today; however, any people are hesitant in starting due to not knowing a lot about it. This article will help explain what online share trading is all about, how you can get involved for a low initial investment and what to consider before, during and after trading.

    By: Tom Robertsl Finance> Day Tradingl May 23, 2012

    The stock market is mostly used to create money. . I am sharing my investment strategy as a retail investor. Most financial experts recommend investors to initially contact a financial advisor. Able to provide advice, it can ensure that the money an investor get a good return or not.

    By: Deeptil Finance> Day Tradingl May 18, 2012

    This article has discussed about the importance of Stop orders. Stop orders act like the life jackets

    By: manasal Finance> Day Tradingl May 18, 2012
    Mike Bryant

    Many traders have adopted systematic trading methods in recent years. Trading systems help remove the emotion from trading and enable trading strategies to be automated so that the buy and sell signals can be executed automatically without manual intervention. This article discusses the types of software tools that are available to help develop profitable trading strategies.

    By: Mike Bryantl Finance> Day Tradingl Feb 03, 2011 lViews: 124
    Mike Bryant

    Systematic trading methods are the basis for trading systems and automated trading strategies. They consist of technical indicators or other mathematical methods that are used to generate objective buy and sell signals in the financial markets. Some of the most popular methods have been in use since before the advent of computers, while other methods are more recent. This article lists ten of the most popular systematic methods found in trading systems.

    By: Mike Bryantl Finance> Day Tradingl Feb 03, 2011 lViews: 141
    Mike Bryant

    Trading systems or strategies use a predefined set of trading rules to generate objective buy and sell signals. While the variety of trading systems is almost limitless, most profitable trading systems have certain elements in common. Whether you build your own strategy or purchase one, trading a strategy with these characteristics will maximize your chances of success.

    By: Mike Bryantl Finance> Day Tradingl Feb 03, 2011
    Mike Bryant

    Systematic trading is a popular and potentially profitable way to trade a variety of markets, including stocks, futures, and foreign exchange. In systematic trading, a trading system generates buy and sell signals using a predefined set of trading rules. In many cases, the trading system can be automated so that it will automatically execute the buy and sell orders through a brokerage. This article outlines the basic steps to getting started with systematic trading.

    By: Mike Bryantl Finance> Day Tradingl Feb 03, 2011

    Discuss this Article

    Author Box
    Articles Categories
    All Categories
    Quantcast