Optimizing the trading system parameters: EUR/USD revisited

User Rating: / 0
Written by Forex Automaton   
Friday, 05 June 2009 16:02

After important changes to the trading system optimization methodology, I am revisiting EUR/USD on the day scale. The USD/CAD and USD/CHF reports indicated that our range of trade entry parameter might not include the optimum, consequently the range is extended. As a result, much better performance figures are seen. But caution is needed when comparing even the "minimum-bias" results with those of earlier reports, since the parameter ranges are now different.

The basic framework remains the same: a run of the program included simulations of trading histories of 12,789 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.

What is the best stop-loss to use?

What is the best stop-loss parameter to use in forex? The answer depends on the time scale of trading, since so does the 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. For this reason, 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.

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

Fig.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. Top: comparing the trade entry parameter range from the previous reports (black) and the "extension" range (red). Bottom: no trader selection.

Effect of stop-loss on the trading return volatility. Minimum bias. EUR/USD.

Fig.2. A profile histogram showing dependence of the RMS of the logarithmic annualized return distribution for a trader on the stop-loss placement. Compare the trade entry parameter range from the previous reports (black) and the "extension" range (red).

The more conservative values of the trade-entry parameter, above 0.006, are seen to change the shape of the dependence in Fig.1, top panel. Apparently 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. In fact, this is a sign that there may be another optimum -- the one corresponding to conservative entry ("patient" trader) in combination with a tight stop loss. Not necessarily a comfortable optimum, given the proximity to the negative returns, this is nonetheless something to keep monitoring.

Previously, the algorithm was seen to generate larger values of the arithmetic mean return with tighter stop-loss -- but only up to a certain point, the dependence was not monotonic. On the basis of the low draw-down criterion, the conclusion was that more generous values of stop-loss would be preferable. With the new information on the biased nature of the arithmetic mean, when applied to returns, there is less self-contradiction in the data: the tight stop-loss is not advisable even on the basis of Fig.1 alone. Fig.2, showing dependence of the RMS of the logarithmic annualized return distribution (a newly introduced quantity) on the stop-loss placement, demonstrates that tight stop-loss placement generally leads to bumpier rides in returns.

Trade entry and exit thresholds

Dependence of the annualized return on the trade entry parameter. Quality cut progression. EUR/USD.

Fig.3. Profile histograms showing dependence of the actual annualized return on the trade entry threshold parameter. No trader selection is applied.

Dependence of the annualized return on the trade exit parameter. Quality cut progression. EUR/USD.

Fig.4. Profile histograms showing dependence of the actual annualized return on the trade exit threshold parameter. No trader selection is applied.

The entry and exit threshold parameters have been explained elsewhere. In Figures 4 and 5 I present minimum-bias (no particular selection applied to the set of traders) data for the entry and exit parameters, respectively. These can not be directly compared to the analogous figures from the previous reports, because the ranges of summation variables (parameters other than those plotted) over which the projections are taken, differ from those cases: the range of entry parameter has been extended from 0.006 to 0.009, 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 is weak and featureless. In the range considered, the data favor conservative entry (high threshold) and it looks like the optimum may still have not been reached. This is similar to conclusion of the USD/CAD analysis. The range for this parameter still needs to be extended further to the right.

Speaking of the exit parameter, the extended range still does not seems to enforce convincing limits on the parameter.

Optimizing the forecasting parameter

As before, we research the forecasting parameter, the least trivial of all, with the combined (simultaneous) cut on the parameters inspected so far. The forecasting quality parameter is euphemistically called Fred to avoid disclosing its nature. The combined effect of the best stop-loss and entry parameters, shown in Fig.5, bottom (to compare with Fig.5, top with no such selection) is seen to enhance the returns considerably, especially for the higher values of Fred. The shape resembles USD/CAD.

Optimizing the forecasting control parameter. Minimum bias. EUR/USD. Optimizing the forecasting control parameter. Best values of other parameters. EUR/USD.

Fig.5. A profile histogram showing the dependence of the annualized return on the forecasting control parameter Fred. Top: no selection on other parameters. Bottom: the best values of stop-loss, entry and exit parameters are used: stop-loss is 1.5 or 2, entry is 0.008 or 0.009, no cut on the exit parameter.


With this input, the preferred ranges of the trading system parameters are given in the Table.

Forecasting parameter, Fred between 70 and 86
Stop-loss placement parameter, s 1.6
Enter-the-trade threshold parameter, ten 0.007, 0.008, 0.009
Exit-the-trade threshold parameter, tex between 0.001 and 0.013

Annualized return with stop-loss, entry and exit selection Annualized return with Fred, stop-loss, entry and exit selection

Fig.6. Distributions of the actual annualized return in the course of the trading system parameter optimization. Top panel: the parameter ranges from Table 1 are used. Red: all parameters except for Fred are as in Table 1, no selection on Fred. Green: all parameters including Fred are as in Table 1. Bottom panel: same as green in the top panel. Normalization is to the unit histogram area. The unit of return is 100%.

Fig.6 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 12789 forex robots is reduced to 126 winners by trading system parameter cuts. The winners have an average annualized return of 0.50 (50%) and the RMS of the distribution is 0.13. While the mean of the distribution 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.

From the analysis of various foreign exchange rates so far, it's evident that Fred is the most difficult parameter 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 be forced to admit that the Fred selection adds no value to the algorithm. That's why I am showing the top panel of Fig.6. This figure represents the options on the table in the absence of any Fred selection, and with the best selection of the money management aspects of the system. Even in the absence of the Fred selection, except for the very basic one, the distribution is seen to be considerably shifted in the positive direction. Fred selection (green in the top panel, or the bottom panel) shifts in even more.

Returns in excess of 80% a year for the 3 years of trading are seen. The distribution looks fairly symmetric with the most likely outcome, the peak of the distribution, located near the mean.

Bookmark with:

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