How profitable is foreign exchange

Design and profitability of forex trading strategies based on non-linear forecast models

Table of Contents

List of figures

List of tables

1 Introduction

2. Design of real-time trading models
2.1. Structure of the trading model
2.2. The simulated trader
2.3. A model example
2.4. Trading Volatilities: The Concept of the Straddle

3. Development of non-linear forecast models
3.1. How artificial neural networks work
3.2. Model generation through genetic algorithms

4. Empirical results
4.1. Predicting exchange rates with KNN
4.2. Predicting exchange rates with genetic algorithms
4.3. Predicting exchange rate volatility

5. Summary

A. Mathematical appendix


List of figures

1. Data flow and recommendations of a real-time trading model

2. An ANN with three inputs, a hidden level and an output.

3. Example of errors in training data and test data

4. Crossover operation

5. Local and global optimum of the model

List of tables

1. Results of the trade

2. Comparison of results for the three models (average data across all exchange rates)

1 Introduction

The task of this thesis is to illustrate the procedure for the construction of trading models that can give recommendations for currency trading in order to be able to serve as a simulation for scientific purposes or as a guide for currency traders. The particular value for science is that the statistical properties of exchange rate forecasts do not necessarily go hand in hand with their profitability. Thus, a statistically superior model is not necessarily a good model for the behavior of market participants. In this thesis, the functionality of two nonparametric model families is also presented - neural networks and genetic algorithms.

The work is structured as follows: First, the design of trading models is described. This is followed by an illustration of how neural networks and genetic algorithms work. The empirical results of the texts on which the work is based are then presented and the work concludes with a summary of the results.

2. Design of real-time trading models

This section describes the design of trading models.1 The task of a trading model is to provide buy and sell recommendations, in the following on the currency market. A distinction should be made between pure price predictions and concrete trading recommendations. A trading model is more extensive than a price forecast, since the model must also include previous actions in the decision recommendation.

To be useful to a user, a real-time trading model must meet the following conditions:

- Give a signal a few minutes before the trade,
- do not change recommendations too quickly,
- Do not give recommendations outside of trading hours,
- note public holidays,
- Support stop loss limits.

The structure of a general trading model is shown in Figure 1.

Figure not included in this excerpt

Figure 1: Data flow and recommendations of a real-time trading model, source: Dacorogna et al. (2001, p. 298)

2. Design of real-time trading models

2.1. Structure of the trading model

The task of the actual trading model is to generate decision recommendations for the simulated trader. The filtered price information is used for this2 processed by the four "modules" of the model. The first module is the calculation of the current rate of return. It should be noted that forex traders usually build positions slowly. The average price pher is therefore used to calculate the return that was paid to reach the current position. If a new transaction was entered into with the index i, p is calculated as follows:

Figure not included in this excerpt

Here gi − 1 and gi stand for the previous and the current position, pi is the current price and p i − 1 is the average price before the trade. At the beginning, when the position equals zero, the average price has not yet been defined. If a neutral position (gi − 1 = 0) is assumed, or if an opposing position is taken (gigi − 1 <0), i.e. if one is no longer “short” but “long” with respect to a currency, corresponds the average price the current price. If a position is expanded, the average price is updated; if the position is reduced, the average price does not change.

With the average price formed in this way, the return ri of a business is calculated:

Figure not included in this excerpt

The position g′i is zero if an opposite position is entered, and otherwise it corresponds to gi.

The current return rc is the book profit of a trade if the position is not neutral (gi =

0) is. If pc is the price to enter a neutral position again, the current return is calculated as follows:

Figure not included in this excerpt

The actual center of the trading model is the module for calculating the position (position calculator) that the trader should take. The design of this module determines the characteristics of the trading model such as trading frequency or possible circumstances in order to enter into a position. The other modules of the model supply it with price data, monitor stop loss limits and evaluate the trading recommendations resulting from the calculation of the desired position. The position calculator evaluates the positions received each time new price data is received. The basis for the evaluation is, on the one hand, indicators that are calculated from the price data and, on the other hand, its trading rules, which result from the transactions carried out so far, the positions currently received and other measures3.

A “recommendation checker” is used to check the results of the position calculator and checks new positions for their admissibility. A trade is not permitted if a new trade is to be entered into too soon after another in order not to overload the user or if the trade is proposed outside of trading hours. In addition, the quality of the price notice is checked again so that transactions only take place at prices actually traded. If a recommendation is initially rejected, but allowed at a later point in time, it is then forwarded to the user or the simulated trader.

The task of the stop-loss calculator is to discover that the price has fallen below a specified level in order to prevent losses if the market moves in the wrong direction. In Dacorogna et al. (2001) the StopLoss mark is tracked so that profits already made are secured. The StopLoss calculator works around the clock, in contrast to normal business.

2.2. The simulated trader

In order to be able to compare the results of the trading model as realistically as possible with those of a real forex trader, the reaction of a trader to the recommendations of the model is simulated.

If the trade processing receives a recommendation from the reviewer of the trading model, it sends a signal to the user (real trader or other observer) and executes the (simulated) trade at a price that it averages on the market within a period of 23 minutes.

The accountant's job is to monitor the development of the positions entered and the success of the trading strategy pursued. This is based on the key figures total return, cumulative return, greatest decline and the profit / loss ratio.

The success indicators mentioned so far have one disadvantage: They are not risk-dependent. Thus, viewed on their own, they are not an efficient means of comparing different trading models with one another, assuming that forex traders are generally risk averse. A simple figure that uses the variance of the return as a measure of risk is the “SharpRatio”. Since the SharpRatio has some unfavorable statistical properties, Dacorogna define inter alia. (2001) two further key figures for the evaluation under risk, Xeff with symmetrical and Reff with asymmetrical treatment of the variance, whereby the symmetry relates to the evaluation of profits and losses.4

2.3. A model example

The purpose of this subsection is to provide an example of the construction of a trading model that makes recommendations. It is the model of Dacorogna et al. (2001) and its results are presented in subsection 4.2. Trading systems are usually based on technical indicators relating to the financial market data under consideration. Examples for this are:

- trend following indicators,
- Indicators of overbought / oversold market situations to discover turning points in the market
- Cyclical indicators that depict periodic fluctuations
- Timing indicators to identify favorable exit situations.

The position gt (Ix) that the model takes in relation to a particular currency is determined by:

gt (Ix) = sign (Ix (t)) f (| Ix (t) |) c (I (t)). (4)

The right side of the equation consists of the following parts:

1. Ix (t) is the distance between the logarithmized exchange rate and the 20-day moving average:

Figure not included in this excerpt

if a <| Ix (t) |


1 The description essentially follows Dacorogna et al. (2001).

2 The raw data is checked for completeness and plausibility in order to prevent wrong decisions due to incorrectly transmitted data.

3 That of Dacorogna et al. (2001) not only gives recommendations on direction, but also on the extent of the position; the possible investments here are ± 1, ± 0, 5 and 0.

4 The key figures are presented in detail in Appendix A.

End of the excerpt from 19 pages