Trading Systems: Constructing A System
  1. Trading Systems: Introduction
  2. Trading Systems: What Is A Trading System?
  3. Trading Systems: Designing Your System - Part 1
  4. Trading Systems: Designing Your System - Part 2
  5. Trading Systems: Constructing A System
  6. Trading Systems: Troubleshooting And Optimization
  7. Trading Systems: Conclusion

Trading Systems: Constructing A System

So far, we have discussed the basic components of trading systems, the criteria they have to meet, and some of the many empirical decisions that a system designer must make. In this section, we will examine the process of constructing a trading system, the considerations that need to be made, and some key points to remember.

The Six-Step System Construction

1. Setup - To begin constructing a trading system you will need several things:

  • Data - Because the system designer must use extensive backtesting, past price history is essential to constructing a trading system. Such data can be integrated into trading system development software, or as a separate data feed. Live data is often provided for a monthly fee while aged data can be obtained for free.

  • Software - Although it is possible to develop a trading system without software, it is highly impractical. Ever since the late '90s, software has become an integral part of building trading systems. Some common features enable the trader to do the following:

    • Automatically place trades - This often requires permission from the broker's end because a constant connection must be in place between your software and the brokerage. Trades must be executed immediately and at exact prices in order to ensure conformity. To have your software place trades for you, all you need to do is input the account number and password, and everything else is done automatically. Please note that using this feature is strictly optional.

    • Code a trading system - This software feature implements a proprietary programming language that allows you to build rules easily. For example, MetaTrader uses MQL (MetaQuotes Language). Here's an example of its code to sell if free margin is less than $5,000:

      If FreeMargin < 5000, then exit;

      Often, just reading the manual and experimenting should allow you to pick up on the basics of the language your software uses.

    • Backtest your strategy - System development without backtesting is like playing tennis without a racquet. System development software often contains a simple backtesting application that allows you to define a data source, input account information, and backtest for any amount of time with the click of a mouse. Here is an example from MetaTrader:

      After the back test is run, a report is generated that outlines the specifics of the results. This report usually includes profit, number of un/successful trades, consecutive days down, number of trades, and many other things that can be helpful when trying to determine how to troubleshoot or improve the system. Finally, the software usually creates a graph showing the growth of the investment throughout the tested time period.

2. Design - The design is the concept behind your system, the way in which the parameters are used to generate a profit or loss. You implement these rules and parameters by programming them. Sometimes, this programming can be done automatically via a graphical user interface. This allows you to create rules without learning a programming language. Here is an example of a moving average cross-over system:

If SMA(20) CrossOver EMA(13) then enter;
If SMA(20) CrossUnder EMA(13) then exit;

Rules like these that are put into code allow the software to automatically generate entry and exits at the points when the rules are applicable. Here is what the design interface looks like on MetaTrader:

The system is created by simply typing the rules in the window and saving them. References for the different functions available (for example, oscillators and such) can be found by clicking on the book icon. Most software will have a similar reference available either within the program itself or on its website. After creating the desired rules and coding the system, you simply save the file. Then you can put it into use by selecting it on the main screen.

3. Decision Making - There are many decisions to be made at this point:
  • What market do I want to trade in?
  • What time period should I use?
  • What price series should I use?
  • What subset of equities should I use for testing?

Keep in mind that trading systems should consistently make a profit in many markets. By customizing the time period and price series too much, you may taint the results and produce uncharacteristic results.

4. Practice - Backtesting and paper trading are essential to the successful development of a trading system:
  • Run several backtests on different time periods and make sure that the results are consistent and satisfactory.

  • Paper trade the system (use imaginary money, but record the trades and results), and again, look for consistent profitability.

  • Carefully check for errors in the program, or unintended trades. These can be a result of faulty programming or failure to foresee certain circumstances that have undesired repercussions.

5. Repeat - Repetition is necessary. Keep working on the system until you can consistently make a profit in most markets and conditions. There are always unforeseen events that occur as soon as a system goes live. Here are some factors that often cause skewed results:
  • Transaction costs - Make sure that you are using the real commission, and some extra to account for inaccurate fills (difference between bid and ask prices). In other words, avoid slippage! (To review what this is and how it occurs, see the preceding section of this tutorial.)

  • Watchfulness - Don't ignore losing trades; keep an eye on all trades.

  • Optimization - Don't over-optimize the system. In other words, don't tailor the system to a very specific market environment; try to be profitable in as broad of an environment as possible.

  • Risk - Never ignore or forget about risk. It is very important to have ways to limit losses (otherwise known as stop-losses), and ways to lock-in profits (take profits).

6. Trade
- Try it out, but expect unintended results. Be sure to use non-automated trading until you are confident in the system's performance and consistency. It takes a long time to develop a successful trading system, and before you perfect it, you may have to endure some live trading losses to detect glitches: back testing cannot perfectly represent live market conditions, and paper trading can be inaccurate. If your system loses money, go back to the drawing board and see where it went wrong (see step 5).

These six steps give you an overview of the entire process of building a trading system. In the next section, we will build upon this knowledge and take a more in-depth look at troubleshooting and modification.
Trading Systems: Troubleshooting And Optimization

  1. Trading Systems: Introduction
  2. Trading Systems: What Is A Trading System?
  3. Trading Systems: Designing Your System - Part 1
  4. Trading Systems: Designing Your System - Part 2
  5. Trading Systems: Constructing A System
  6. Trading Systems: Troubleshooting And Optimization
  7. Trading Systems: Conclusion
  1. IRR Rule

    A measure for evaluating whether to proceed with a project or ...
  2. Rule Of 72

    A shortcut to estimate the number of years required to double ...
  3. Black Swan

    An event or occurrence that deviates beyond what is normally ...
  4. Contagion

    The spread of market changes or disturbances from one region ...
  5. Markdown

    The difference between the highest current bid price among dealers ...
  6. Catalyst

    A catalyst in equity markets is a revelation or event that propels ...
  1. What is finance?

    "Finance" is a broad term that describes two related activities: the study of how money is managed and the actual process ... Read Full Answer >>
  2. What is the 'Rule of 72'?

    The 'Rule of 72' is a simplified way to determine how long an investment will take to double, given a fixed annual rate of ... Read Full Answer >>
  3. What is a stock split? Why do stocks split?

    All publicly-traded companies have a set number of shares that are outstanding on the stock market. A stock split is a decision ... Read Full Answer >>
  4. Do plane tickets get cheaper closer to the date of departure?

    The price of flights usually increases one month prior to the date of departure. Flights are usually cheapest between three ... Read Full Answer >>
  5. Is Colombia an emerging market economy?

    Colombia meets the criteria of an emerging market economy. The South American country has a much lower gross domestic product, ... 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 >>
Hot Definitions
  1. Black Swan

    An event or occurrence that deviates beyond what is normally expected of a situation and that would be extremely difficult ...
  2. Inverted Yield Curve

    An interest rate environment in which long-term debt instruments have a lower yield than short-term debt instruments of the ...
  3. Socially Responsible Investment - SRI

    An investment that is considered socially responsible because of the nature of the business the company conducts. Common ...
  4. Presidential Election Cycle (Theory)

    A theory developed by Yale Hirsch that states that U.S. stock markets are weakest in the year following the election of a ...
  5. Super Bowl Indicator

    An indicator based on the belief that a Super Bowl win for a team from the old AFL (AFC division) foretells a decline in ...
Trading Center