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

Trading Systems: Troubleshooting And Optimization

Even after successfully designing and constructing a working trading system, a trader may find that his or her system is imperfect. There may be some problems, such as an event that keeps generating losses; or maybe the rules are too broad and need to be optimized. What's the easiest way to fix the problem? How effective is optimization? This section will show you how to troubleshoot and optimize your trading system to maximize profits and minimize losses.

Troubleshooting is a very important aspect of system development. A decent trading system will be profitable in most market conditions, but if it occasionally renders large losses, you can work to identify and solve the problem. Here are four easy steps:

1. Identify the problem - Find all instances in which the problem occurred during your backtesting, and/or start recording when the problem occurs during live trading. During each instance, take note of any tendencies of the following four factors:

  1. Chart pattern or price series - Spike in the prices.
  2. Volume - Large volume initially and low volume thereafter.
  3. Bid/Ask spread - Spike in price on low volume often indicates a large spread.
  4. Margin (if used).
These are some of the areas in which problems can occur, which we can see by analyzing the chart below. Note the price spikes on low volume by the green arrow. Also note the large volume (near the blue arrow) followed by low volume thereafter. If none of these turns out to be the culprit, there are other factors that can be analyzed, such as block-sizes and advanced chart patterns.

2. Evaluate the problem - Use the information you gathered to determine what exactly caused the system to malfunction or to generate a loss. This is often done by using common sense, or by analyzing transaction logs (provided by your broker). Here are examples of how some conditions of the four factors listed above may be the reason for an identified problem:
  1. Chart pattern or price series - The system is unable to sell during sharp declines or buy during steep climbs. Perhaps the system did not have ample time to buy or sell.

  2. Volume - The system is unable to sell during declines or buy during increases. Perhaps the equity has such a low trading volume that the system is unable to buy or sell at one price. During these instances, the price can be misleading without a consideration of volume and bid/ask.

  3. Bid/Ask spread - The system makes a purchase but doesn't profit as much as it should when selling. This could be due to the fact that the trader forgot to consider bid/ask spreads. If a system is programmed to buy and sell at the "current price" it actually pays the ask, and when sold, it doesn't sell at current price but at the bid price. Sometimes the differences between the bid and ask can be large, leading to undesired losses.

  4. Margin - The system suddenly sells for no apparent reason. If this occurs, you may have forgotten to consider margin calls.

3. Consider the alternatives - Simply try some solutions to the problems you have identified. Consider the following alternatives corresponding to the above problems.
  1. Chart pattern or price series - One alternative is simply to tell the system to wait until the price stabilizes before buying. This can be done by using the differences between the previous prices and the current price to create a rule.

  2. Volume - To solve this problem, you could create a rule that requires the equity to have a certain amount of volume before executing a trade.

  3. Bid/Ask spread - Here you might want to buy and sell based on the bid and ask prices instead of the current price.

  4. Margin - Using margin can be profitable if risk is managed effectively. Limiting downside should keep you from receiving margin calls. This can be done with trailing stop loss points or other similar tactics to limit downside.

4. Implement a solution - Finally, we need to apply the solution and see how it works. Paper trading or back testing again before live trading is often a good idea after applying a solution because sometimes solutions have unintended consequences. For example, additional rules may limit these down days, but also decrease overall profits (due to missed opportunities).

Optimization simply means finding the best sets of parameters for a given market. This process can marginally improve results. However, it also carries many risks because its underlying assumption is that past performance is indicative of future price movements. Optimization can be accomplished by changing the values of the parameter you would like to optimize and then back testing these changes. Keep in mind the other parameters must remain constant for the effects of the changes to be determined. Once you find the value that yields the highest performance in the back testing, implement it into the trading system.

Let's consider an example. Say a trader analyzed the S&P 500 and found that he or she could optimize the system by using a daily chart. This same process can also be taken to a higher degree. For example, if a simple moving average of 6 works better than 8 for an MA-crossover strategy in a given market, then 6 would be used. The problem here is not only in the assumption, but also in the fact that the system may perform worse in many other markets, thereby making it less universal.

Many system developers forgo the optimization stage for these two reasons:

  • Optimization often overstates results. This is because the parameters are so specific and non-universal that any change in the market (that is, the future) can cause instability.

  • In many cases, optimization will not improve performance by a meaningful degree. Slight improvements may be apparent; however, the forfeiture of universality is a high price to pay.

As a general rule, optimization should only define broad settings for parameters rather than set up specific rules - even if it was successful in backtesting and paper trading.

Troubleshooting is crucial to making your system work the way you want it to. It is important to identify any problems by observing the instances in which they occurred and then evaluating how certain conditions of several factors - such as price pattern, volume, bid/ask spread, and margin - may have caused the problem.

Optimization can improve your results, but it is important to remember that it has its limitations. Not only is it based on the assumption that past performance indicates the future, but it is not the stage at which the trader creates specific rules - optimization is only about defining broad settings. In the next and final installment, we will provide an overview of everything we've covered along with some advice and resources to help you gain a working knowledge of trading system design and development.
Trading Systems: Conclusion

  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. Optimization

    In the context of technical analysis, it is the process of adjusting ...
  2. Alternative Trading System - ATS

    A trading system that is not regulated as an exchange, but is ...
  3. Bid-Ask Spread

    The amount by which the ask price exceeds the bid. This is essentially ...
  4. Financial System

    A financial system can be defined at the global, regional or ...
  5. Forex System Trading

    A method of trading forex that is based on a series of analyses ...
  6. Up Volume

    A stock volume that closes at a price higher than the previous ...
  1. What are the determinants of a stock's bid-ask spread?

    Stock exchanges are set up to assist brokers and other specialists in coordinating bid and ask prices. The bid price is the ... Read Answer >>
  2. What's the difference between bid-ask spread and bid-ask bounce?

    Understand the difference between the bid-ask spread that determines the buy or sell price for a stock and a bid-ask bounce, ... Read Answer >>
  3. How do I use the bid-ask spread to evaluate whether I should buy a particular stock?

    Understand the significance of the bid-ask spread for investors in making a decision on whether or not to purchase a particular ... Read Answer >>
  4. What number of shares determines adequate liquidity for a stock?

    Liquidity refers to how easy it is to buy and sell shares without seeing a change in price. If, for example, you bought stock ... Read Answer >>
  5. What types of stocks have a small difference between bid and ask prices?

    Learn more about bid-ask spreads and why stocks with high levels of liquidity and low levels of volatility usually have narrow ... Read Answer >>
  6. How do I use a limit order in conjunction with a bid-ask spread?

    Understand the concept of the bid-ask spread as it applies to trading and how it impacts the pricing of limit orders used ... Read Answer >>
Hot Definitions
  1. Quarter - Q1, Q2, Q3, Q4

    A three-month period on a financial calendar that acts as a basis for the reporting of earnings and the paying of dividends.
  2. Weighted Average Cost Of Capital - WACC

    Weighted average cost of capital (WACC) is a calculation of a firm's cost of capital in which each category of capital is ...
  3. Basis Point (BPS)

    A unit that is equal to 1/100th of 1%, and is used to denote the change in a financial instrument. The basis point is commonly ...
  4. Sharing Economy

    An economic model in which individuals are able to borrow or rent assets owned by someone else.
  5. Unlevered Beta

    A type of metric that compares the risk of an unlevered company to the risk of the market. The unlevered beta is the beta ...
  6. Treasury Inflation Protected Securities - TIPS

    A treasury security that is indexed to inflation in order to protect investors from the negative effects of inflation. TIPS ...
Trading Center