Categories
Forex Education Forex System Design

Designing a Trading Strategy – Part 1

Introduction

In a previous article, we introduced the basic concepts that should include a trading strategy. In this context, a trading strategy tends to be confused with a trading system. In this educational article, we start to present a series focused on developing a trading strategy that could end as a trading system.

The Trading Strategy Concept

Before advancing in designing a trading strategy, it is necessary to explain the difference between a trading strategy and a trading system.

trading strategy is a set of objective and formalized rules, such as parameters from a mathematical formula; these values can vary in different types of markets. Additionally, this set of rules are characterized by being independent of the emotional trader’s behavior. 

trading system is a systematic application of a trading strategy designed to achieve a profitable return by positioning in long or short financial markets. The main advantage of using a tested and validated trading system is significant confidence in producing profits.

Trading strategies can vary from the simplest to the complex rules criteria. Some classical trading strategies are moving average crosses, channel breakouts, bar patterns, candlestick patterns, and strategies based on oscillators such as MACD or RSI.

According to the complexity level of the trading strategy, as complexity increases, the construction, testing, optimization, and evaluation process will become more difficult. In this context, if the system developer does not control the trading strategy complexity, the optimization process results can become challenging, even could lead to the over-fit of the trading strategy.

The Basic Components

Each trading strategy must contain three essential components identified as follows:

Entry and Exit: Both entry and exit are the core of a trading strategy. The entry and exit criterion can vary in its complexity level. Similarly, the strategy could consider an entry in a specific price as a pending order (limit or stop), a market entry, open, or the closing price. On the other hand, the exit criteria could use a broad kind of methods such as percentage of price advancement or key support/resistance levels. As the reader may realize, the possibilities on entries and exits are unlimited.

Risk Management: It is a fact that any trading strategy will generate losing trades. In this regard, all trading strategies must contain a set of objective rules to reduce the risk. Risk management’s main objective is to limit losses in the trading account while allowing the trader to continue trading despite losing streaks.

Position Sizing: The third element a trading strategy must include is the amount to be traded. The position size may correspond to a fixed number of units, such as contracts, lots, shares, etc. The problem of position sizing becomes critical, especially when the trading strategy is profitable. In this context, Pardo suggests that it is more effective to allocate resources to improve the strategy’s entries and exits.

Conclusions

In this educational article, we have introduced the difference between a trading strategy and a trading system. In this regard, we can understand a trading strategy as the basis of a trading system.

A trading strategy can be based on the simplest or the most sophisticated criteria. However, as the complexity level of the strategy increases, the level of complexity in the trading system’s development will also increase.

On the other hand, a trading strategy must contain three elements, which are as follows:

  1. Entry and Exit.
  2. Risk Management.
  3. Position Sizing.

Finally, in the next educational article, we will expand the concepts of inputs and outputs in a trading strategy.

Suggested Readings

  • Pardo, R.; The Evaluation and Optimization of Trading Strategies; John Wiley & Sons; 2nd Edition (2008).
  • Jaekle, U., Tomasini, E.; Trading Systems: A New Approach to System Development and Portfolio Optimisation; Harriman House Ltd.; 1st Edition (2009).
Categories
Forex System Design

Introduction to Optimization of a Trading System

Introduction

Once the system developer tested and validated the trading system, the next stage corresponds to the optimization process. The developer will estimate different values for the key model parameters.
This educational article will introduce the basic concepts in the optimization process of a trading system.

The Optimization Process

Before getting started into the optimization process, the developer must weigh and adjust the investor’s interests with the purpose of the optimization and limitations both the strategy and reality. In this regard, the optimization must align with realistic objectives. For example, the drawdown should not exceed 10% of the trading account, or to obtain a yearly net profit of 15% from the invested capital.

The optimization of a trading system is the stage that seeks the best or most effective use, which allows investors to obtain the highest performance of the trading system. In this context, the optimization could be the search of what inputs could maximize the profits or accomplish the investor’s requirements to minimize the drawdown. To achieve this, the developer must evaluate the variables that conform to the rules and formulas that define and models the system’s structure.

The system developer must consider that an incorrect optimization can drive to obtain serious errors. For this reason, the optimization process is a critical stage in trading system development.

What is the Optimization of Trading Systems?

In general terms, the optimization process is a mathematical method oriented to improve or find an “optimal” solution to a specific problem. In the trading system development, the optimization corresponds to the best parameter selection that allows the strategy to obtain the peak performance in the real market.

Getting Started

Once the system developer tested the trading strategy’s capability to catch market movements, the steps to start the optimization are as follows:

  1. Selection of the model parameters that have the most significant impact on the system’s performance; if a model’s variable is not relevant, it could be fixed.
  2. Selection of a significant range of data needed to test the parameter to be optimized. This range must generate a significative sample to study the model. For example, the amount of data required to evaluate a 20-day moving average is lower than the one needed to assess a 200-day moving average.
  3. Selecting the data sample size. It must be representative enough to ensure the statistical validity to make estimations. The size also must be representative of the market as a whole.
  4. Selection of the model evaluation type, this stage will depend on the evaluation type, objective, or test criteria; this selection will change depending on the kind of trading model.
  5. Selection of the test result evaluation type, this stage must evaluate the results of the optimization process with a statistical significance, meaning the results are not due to chanve. For example, a P-value below 5% would be statistically “significant,” and below 1% would be “highly significant.” Additionally, the average and the standard deviation of the results must be evaluated. As a final note, profit spikes should be considered as abnormal and be discarded.

The figure summarizes the five selections that the system developer must take before to start the optimization process.

Conclusions

The optimization process is a critical stage that comes after the testing process. In this stage, the system developer seeks to determine the appropriate value for the most robust trading strategy implementation. 

Nevertheless, before starting with the optimization, the developer must take a set of decisions, such as which the objective of the optimization? Is it realistic?

Once defined the target of the optimization, the developer must select which parameters to optimize, the range of data to be used in the analysis, how much data will require the sample, which will be the evaluation type of the model, and the evaluation criteria of the test results.

Finally, when all these five steps have been completed, the system developer is ready to start to perform the optimization.

Suggested Readings

  • Jaekle, U., Tomasini, E.; Trading Systems: A New Approach to System Development and Portfolio Optimisation; Harriman House Ltd.; 1st Edition (2009).
  • Pardo, R.; Design, Testing, and Optimization of Trading Systems; John Wiley & Sons; 1st Edition (1992).