From the February 01, 2010 issue of Futures Magazine • Subscribe!

Using DOE method in trading

To define the parameter space, we choose minimums and maximums for the first four factors:

1. [50 – 250]

2. [80 – 100]

3. [15 – 45]

4. [35 – 65]

The fifth factor is a discrete integer that will be defined to take on the values of 2, 3, 4, 5 and 6. The first factor is also a discrete integer, but its large interval allows us to treat it as continuous. Any value we find will be truncated to an integer without serious effect to the investigation.

Using the Gosset computer program described by Hardin and Sloane (see “Further reading”), we generate parameter settings for 56 trial runs. Daily data for the SPY and the Vix from Jan. 29, 1993, through Oct. 17, 2003, were selected for the trial runs. A computer program written in the GAUSS programming language ( was developed for the simulation of the trading system given the parameters.

To produce a more realistic result, each simulation started with an account of $500,000, paid a $20 transaction cost per trade, and a bid/ask spread was also included to simulate slippage.

For hill-climbing, the Sqpsolvemt program in the GAUSS Run-Time Module was used. Sqpsolvemt uses a nonlinear sequential quadratic programming method allowing us to constrain the search to the parameter space defined by the minima and maxima. It doesn’t handle integers, however, and thus a separate hill-climb will be conducted within each value of Factor 5, and the sweet spot will be the best result among those separate runs.

The 56 trials for the cubic polynomial model provide no degrees of freedom, and an initial run found sweet spots with large error deviations. To gain degrees of freedom and a better fit to the observations, a center point was added, and the sweet spots from the initial run were also added for a total of 62 trials. The results for each value of Factor 5 are shown in “By a factor of 5."

Rather than rely on the backtesting for our choice of sweet spot, we will forward test each of them in another data set, the SPY and Vix from Oct. 17, 2003, through Oct. 12, 2009. The results for these runs are shown in “Forward thinker”.

Opinions might reasonably differ here. One the one hand, the RSI period of four clearly wins the profit contest. On the other, the greater theoretical prediction for a period of three might suggest that it would be superior in the long run. None of these sweet spots generates much of an annualized rate of return, but to be fair the forward test includes the 2008 market meltdown.

The forward test for the original settings in Connors and Alvarez (see “Further reading”) are:

Annualized Sharpe Maximum
Profit/Loss Return Ratio Drawdown
28329.22 0.93 0.5819 -20434.68

The DOE method has succeeded in finding settings that produce from 3.5-1 to 4.5-1 greater profit, and more than three times the annualized return, compared to the original input values recommended by the trading system authors.


There aren’t enough degrees of freedom in the cubic polynomial regression model for very much statistical reliability. However, some tentative findings are possible from the t-statistics of the coefficients. First, the results don’t seem to be very sensitive to the period of the SPY moving average. In fact, a period of 200 for the sweet spot for the RSI period of three produces results in the forward test that are comparable:

Annualized Sharpe Maximum
Factor 5 Profit Return Ratio Drawdown
3 131987.39 4% 1.6738 -25140.78
4 130783.56 3.96% 1.2546 -24001.11

While the DOE results suggest the longer the period the better, a 250-day moving average is a full year’s worth of data and longer periods may be impractical in some situations. It does appear that the traditional period of 200, while still long, should do quite well in practice.

Connors and Alvarez strongly hold to an RSI period of two in contrast to the traditional period of 14. The DOE results first support their contention that a period of 14 is too long. On the other hand, the results also suggest that a modification to a period of three or four could produce significantly greater profits.

The regression analysis also suggests that the RSI period (Factor 5) and the Vix RSI setting (Factor 2) are interrelated. A future study might produce better results that incorporated separate RSI periods for the Vix vs. the SPY.

Further reading:

• Connors, L. and C. Alvarez, “Short Term Trading Strategies That Work,” TradingMarkets Publishing Group, 2009

• R. H. Hardin and N. J. A. Sloane, “A New Approach to the Construction of Optimal Designs,” Journal of Statistical Planning and Inference

Ronald Schoenberg is a partner and research manager at Trading Desk Strategies LLC. E-mail him at or see

<< Page 2 of 2
comments powered by Disqus
Check out Futures Magazine - Polls on LockerDome on LockerDome