Optimizing the forex trading system: USD/CHF revisited

User Rating: / 1
Written by Forex Automaton   
Wednesday, 24 June 2009 14:03

This study covers an extended range of the trade-entry threshold parameter, the one that controls the "patience" of a trading system or the amount of "excitement" about a trade idea needed to enter the trade. With the trade-entry parameter extended into the more conservative area, the USD/CHF optimization results begin to look more like those of other currency pairs.

1. The basics

The basic framework remains the same: a run of the program included simulations of trading histories of 27608 independent "virtual traders" (forex robots), each of them being an incarnation of the same algorithm, differing by the setting of the adjustable knobs. This report uses the USD/CHF day scale data covering the time interval from August 20, 2002 to March 23, 2009, with the actual trading starting in March 2006 (when the initial "training" of the system was completed). The key concepts of conditional projection distributions and profile histograms have been explained before. The trading system control parameters remain as previously defined.

The current mode of the market analysis, when the various exchange rates are being treated by the algorithm in isolation from one another, is not the way the production trading system will operate. However, understanding the markets in isolation and optimizing the system in this simpler problem setting is seen as the first step towards optimization of the more complex algorithm where the amount of information at every point in time will be radically increased by combining multiple exchange rates and the cross-market, as well as intra-market patterns will be taken advantage of.

In addition, repetition of the optimization analysis on the independent markets is a great validity test for the entire idea: ideally, if the problem is treated correctly, the algorithmic optimization must deal with bare essentials of the market predictability, with all the transient and non-essential specifics and particulars of the individual exchange rates being left behind and "abstracted" away. Are we indeed dealing with such essentials? If the "best" solutions for the different markets and the very landscape of the optimization problem look different market to market, then the answer is no. The good news is that we see a lot of similarity between such landscapes, and the best way to verify that is to compare our "Optimizing the forex trading system..." reports for the different exchange rate markets. The more justifiable cut-and-paste content you see between such reports, the better. The Forex Automaton genre is different from journalism: re-used  content is a signature of failure there and a signature of success here!

2. Stop-loss optimization

What is the best stop-loss parameter to use in USD/CHF? The answer depends on the time scale of trading, since so does the distribution of returns. The distribution of returns gets broader with time scale; in the random walk problem, your expected root-mean-square departure from the origin grows with time as a square root of time. My stop-loss parameter is not expressed in pips or dollars. Instead, it is a fraction of the root-mean-square of the series of linear returns (price differences) in the nearest subset of the price series. By keeping it in the units of the market volatility, I hopefully can have apple-to-apple comparisons between different markets, different time frames and different time periods.

Effect of stop-loss on the trading returns. Comparing trade entry ranges. USD/CHF.

Fig.2.1. A profile histogram showing dependence of the annualized return (measured directly by comparing equity at the beginning and end points of trading) on the stop-loss placement. Different symbols represent different trade entry parameter ranges. The unit of return is 100% (100%=1).

The more conservative values of the trade-entry parameter are seen to increase the magnitude of the average return for such a marginal distribution, in particular, for the lower stop-loss settings. Contrary to what was seen for EUR/USD, the shape of the curve remains similar for the various symbol types as the entry threshold is varied. The local maximum of the return in the vicinity of 1.167 on the STOPLOSS axis initially grows as the entry requirement becomes more conservative, indicating, as was noted in the EUR/USD report just mentioned, that those more conservative values increase the relative weight of the situations where tighter stop-loss makes sense -- a welcome development, consistent with presence of intelligence in the forecast signal to which the entry threshold is applied. Same growth has been seen in USD/CAD and AUD/USD optimizations -- the only other two so far looked at in enough detail to discuss the point.

Fig.2.1 shows that the importance of the trade entry parameter grows as the stop-loss gets tighter (up to a certain point, until everything seems to become a losing strategy with a very tight stop loss). Somewhat counter-intuitively, it is the traders using tight stop-loss who need to be particularly conservative about when to enter a trade. The tight stop-loss is not a replacement for being critical and selective!

3. Trade entry and exit thresholds

Dependence of the annualized return on the trade entry parameter. USD/CHF

Fig.3.1. A profile histogram showing dependence of the actual annualized return on the trade entry threshold parameter. Traders are grouped according to the trade entry threshold parameter, as in the previous figures. The unit of return is 100% (100%=1).

The entry and exit threshold parameters have been explained elsewhere. In Figures 3.1 and 3.2 I present data for the trade entry and trade exit parameters, respectively, grouped and color-coded according to the value of the trade entry parameter. Compared to the previous USD/CHF optimization study, the range of entry parameter has been extended from 0.006 to 0.016, and the range of the exit parameter was extended up to 0.013. In this latter case, the step of the optimization grid has also been changed since it was concluded that the dependence was weak and featureless. The dynamics of the annualized return in Fig.3.1 is understandable: lack of selectiveness in the trade ideas leads to decreased returns. The extreme conservatism, on the other hand, leads to the situation when trades are made so seldom that it is hard to expect returns. Thus, a maximum is to be expected; it seems like we reach it with the ENTRY values in the 0.010-0.013 range, and begin to see the right-side tail of falling returns with more conservative ENTRY values.

Dependence of the annualized return on the trade exit parameter. USD/CHF

Fig.3.2. Profile histograms showing dependence of the actual annualized return on the trade exit threshold parameter. The unit of return is 100% (100%=1).

Speaking of the exit parameter, the shape of the annualized return dependence on it for USD/CHF is quite unique: for successful conservative-entry traders like to have very low tolerance and exit the trade easily (low values of the exit threshold parameters). Those who, on the contrary, enter the trade easily (black points in Figure 3.2), seem to do best with a not-too-low and not-too-high exit threshold values.

4. Optimizing the forecasting parameter

We optimize the forecasting quality parameter, the least trivial of all, by playing with the combined (simultaneous) cut on the parameters inspected so far. The parameter is euphemistically called Fred to avoid disclosing its nature.

Optimizing the forecasting control parameter. All entry ranges. USD/CHF. Optimizing the forecasting control parameter. Old maximum. USD/CHF. Optimizing the forecasting control parameter. New maximum. USD/CHF.

Fig.4.1 Profile histograms showing the dependence of the annualized return on the forecasting control parameter Fred. The unit of return is 100% (100%=1). Top: data are selected and color-coded according to the entry parameter range. Middle: the "old" optimum, the one from the previous USD/CHF report. Bottom: the "new" optimum. 

The three panels of Fig.4.1 correspond to the different parameter selection conditions, explained in the legends and the caption. The middle panel is a sub-set of the red set of the top panel, with an additional criterion of exit and stop-loss parameters. This reproduces the best selection of the previous USD/CHF optimization report and will be referred to as the "old" optimum.

Another well visible peak in Fred can be singled out by taking ENTRY values above 0.0039, which makes it advisable to take EXIT above 0.0019 and below 0.0013, STOPLOSS probably above 2.

The bottom panel shows this "new" optimum, with the entry parameter shifted into the newly-explored "conservative" area and the tighter stop-loss resulting from a more detailed study as per Fig.2.1. The overall shape in that panel, with the broad maximum in the right half of the panel, looks familiar from the USD/JPY, USD/CAD, EUR/USD and AUD/USD. Since part of the rationale for these studies is to see how consistent the performance-driven selection results for the different currency combinations are, existence of shared optima among such different currency pairs is a good news.

Based on this, I like Fred in the range 50-62 for the new sweet spot.

5. The winners

With this input, two spots in the parameter space can be identified as the new maxima of return. With this input, the preferred ranges of the trading system parameters are given in the Tables. Still to be discussed is the risk associated with making a wrong choice of a robot, and how much value is added to the system by the selection of the forecasting parameter, the most problematic of all.

Table 5.1. Preferred values for the USD/CHF forex trading system parameters -- the "old" optimum (Red).

Forecasting parameter, Fred 17, 20, 23
Stop-loss placement parameter, s 1.13333, 1.6
Enter-the-trade threshold parameter, ten 0.006
Exit-the-trade threshold parameter, tex 0.002, 0.003, 0.004, 0.005

Table 5.2. Preferred values for the USD/CHF forex trading system parameters -- the "new" optimum (Yellow).

Forecasting parameter, Fred 50, 53, 56, 59, 62
Stop-loss placement parameter, s 2.06667, 2.53333, 3.
Enter-the-trade threshold parameter, ten 0.010, 0.011, 0.012, 0.013
Exit-the-trade threshold parameter, tex 0.001 to 0.013

Annualized return distribution, Red forecasting parameter selection on and off Annualized return distribution, Red forecasting parameter selection only Annualized return distribution, Yellow forecasting parameter selection on and off Annualized return distribution, Yellow forecasting parameter selection only

Fig.5.1. Distributions of the annualized return in the course of the trading system parameter optimization. Figures containing red histograms correspond to Table 5.1, yellow -- to Table 5.2. Black histograms: all parameters except for Fred are as in the respective Table, no selection on Fred. Red and yellow: same, with an extra condition on Fred. Normalization is arbitrary. The unit of return is 100%.

Fig.5.1 presents the summary of progress accomplished so far, using the annualized return statistic. Entries in the histogram are the forex robots (algorithmic traders) and the statistic refers to their trading performance. In the course of the optimization, the initial sample of 27608 forex robots is reduced to two distinct groups of 36 and 110 winners by trading system parameter cuts.

From the analysis of various foreign exchange rates so far, it's evident that forecasting is the most tricky aspect of the trading system to optimize. We may end up with a single, compromise approach for all exchange rate or be forced to class exchange rates according to the similarity of the Fred optimization solutions. In either case, we must be prepared to face the worst-case scenario when we will have to admit that the Fred selection adds no value to the algorithm. That's why I am showing the black histograms in Fig.5.1. The black-color data represent the options on the table in the absence of any Fred selection, and show the effect of the money management style selection alone. Fred selection shifts the return distribution in the positive direction considerably.

Speaking of risk (within the risk vs return framework), there are two kinds of risk to discuss here: the risk of ending up with a "bad" robot which only seemed to be part of the "good" distribution, and the inherent risk of a given robot's strategy. The latter risk is the risk commonly talked about, and it is not evident from the figures. Currently I characterize it by the RMS of the monthly series of annualized logarithmic returns. This RMS for the sample of robots has its own distribution with a mean and an RMS, those being 0.16, 0.040 for the yellow and and 0.11, 0.018 for the red.

While the mean of the distributions in Fig.5.1 is the measure of return, its RMS is the measure of risk associated with choosing a particular robot, or a particular version of the trading system, and its importance is hard to overestimate. One has to minimize the probability of ending up with a "lemon", a robot which belongs to the parent distribution and lands in the negative area of returns. For Gaussian distributions, a good measure of the probability that this happens is the ratio of mean to the RMS (or Sigma). The higher it is, the lower is the chance of a bad choice. This is, essentially, the rationale behind the Sharpe ratio (when different trading strategies, rather than different periods, are used to obtain the return estimate).

Nevertheless, looking at the Mean/RMS ratios for the colored distribution, we obtain 0.418/0.120=3.48 for the red and 0.533/0.282=1.89 for the yellow.

Both red and yellow distributions look non-Gaussian, but the yellow one is skewed in the welcome direction of larger returns, while the red may very well be the other way round. In addition, there are just 36 events (robots) in the red distribution, and consequently, the information available about this distribution is much less precise than in the yellow case. An additional argument in favor of the yellow "sweet spot" is the proximity of its Fred range (50-62) to the Fred ranges found to be good for USD/JPY, USD/CAD, EUR/USD and AUD/USD.

Bookmark with:

Deli.cio.us    Digg    reddit    Facebook    StumbleUpon    Newsvine
Last Updated ( Monday, 04 January 2010 12:32 )