180
Intermarket Trading Strategies
Divergence values vary from system to system. To avoid the computationally intensive process of determining the optimum divergence level for each system separately,the momentum oscillator (see Chapter 9) was used to identify extreme positive andnegative divergence levels on a universal normalized scale from 0 to 100.Because of the inertia effect mentioned above, divergence can keep rising withoutinducing a trend change. The following techniques had to be employed to deal withthis very serious impediment, inherent in all countertrend systems:• Wait for gold to respond to the divergence with the related market before triggeringthe buy signal. This was specified by the 5-day stochastic crossing over its 3-daymoving average and the reverse for short sales.• The momentum oscillator should change direction. This was specified by usingthe cross function available in MetaStock. Buy signals were generated when themomentum rose above a certain high value (usually 80) and then reversed directioncrossing below this value from above.• Asynchronous signals (lag) between the momentum oscillator and stochastics weredealt with by using MetaStock’s useful alert function to extend the momentumsignal for another three days.• The most recent trend of the intermarket security (e.g. XAU) should lead gold.This was implemented by specifying that the rate of change of the intermarketsecurity should be positive before issuing a divergence buy signal and the reversefor negative correlated markets (dollar index). This last condition was added laterand seemed to improve results in cases of long-term divergence.• The universal extreme value of the momentum oscillator was optimized in arange of ±15 points above or below the default value (80 for oversold and 20for overbought), to take into account incongruities between different systems andintermarket security combinations.• To avoid the problem of whipsawing around the extreme levels, I used the 3-dayexponential moving average of the momentum oscillator instead of the actual valueof the oscillator itself.• During protracted positive or negative divergences, the momentum oscillator mightissue a false buy or short signal. To avoid taking action in such cases a minimumdivergence level (usually zero) was required to verify the signal.It is not all that important to close open trades at the exact bottom or top, so the secondcondition above wasn’t implemented when closing long or covering short positions.No stop-loss conditions or money management rules were used as the purpose of thetests was to compare the efficacy of the intermarket indicators. In practice, a stop-losscondition should always be used. Also, for comparison purposes, no other indicatorswere used except the intermarket indicators on test. This sometimes presented aproblem in closing open trades and a time exit of 50 trading days (approximately twomonths) had to be used as certain intermarket indicators did not produce exit signalsfor prolonged periods of time.
A Comparison of Fourteen Technical Systems for Trading Gold
181
Except for the general rules described above there were also some system specificrules which will be discussed next.
11.3
REGRESSION SYSTEMS
Intermarket regression was calculated according to formula (9.10) in Chapter 9 andresults using the XAU and the dollar index are depicted in Table 11.1. The linearregression equation was constructed using the latest 400 trading days (1 12 years)of data. The momentum oscillator period and rate of change were determined byoptimization and the best parameter values on a profitability basis were 200 days forthe momentum oscillator period and 10 days for the rate of change, which was in linewith the results in Chapter 7 (Table 7.6). I used a period of 200 trading days for themomentum oscillator as shorter periods increased the total net profit by producingmore trades – to the detriment, however, of profitability. As with any optimization,these values and their associated outcomes should be verified on an out-of-sampletest because they are highly data dependent.The dollar index test did not perform as well as the XAU on this particular testbut this wasn’t the case in the other tests. A disadvantage of all single regressiontests is the relative low number of trades that they generate. On the other hand,their main advantage is that the regression system doesn’t require any calculation oroptimization of the regression coefficients as these are calculated automatically bythe formula.The multiple regression test, on the other hand, required the calculation of theregression coefficients before running the test. These could be calculated using astatistics program such as SPSS, but as they varied according to the amount of dataincluded in the data set and the price yield interval, I decided to calculate a rangeof values using four different time frames and optimize them in the system test.The regression coefficient range of values is depicted in Table 11.4. After severaloptimization runs I concluded the following:
• The regression equation with the best coefficient of determination (R2 ) did notnecessarily produce the most profitable test results.• The regression coefficient of the dollar index nearly doubled recently, from −0.3to −0.6, indicating an intensification of the negative correlation between gold andthe dollar. By the time this book is published, the negative correlation betweengold and the dollar will most probably increase further, so it is a good idea tore-optimize this particular regression coefficient before using the system in realtime.• All regression coefficients in Table 11.4 produced profitable results so the finalchoice was only a matter of fine tuning.
182
Intermarket Trading Strategies
Table 11.4 Variability of regression coefficients with time and rate of change interval. Thecoefficient of determination (R2 ) for varying time frames is depicted in the last table.Regression coefficient – XAUYears
351015
Rate of change – days9
10
11
12
0.2390.2070.2160.203
0.2420.2090.2190.206
0.2470.2130.2210.208
0.2510.2170.2230.211
Regression coefficient – SLVYears
351015
Rate of change – days9
10
11
12
0.2010.210.1660.175
0.2010.210.1640.174
0.1920.2030.1610.173
0.190.2020.1630.173
Regression coefficient – dollar IndexYears
351015
Rate of change – days9
10
11
12
−0.574−0.538−0.433−0.292
−0.587−0.545−0.434−0.296
−0.604−0.545−0.434−0.298
−0.615−0.543−0.432−0.299
R2Years
351015
Rate of change – days9
10
11
12
0.7360.6790.5880.582
0.7380.680.5870.583
0.7330.6760.5880.583
0.7320.6750.5870.584
184
Intermarket Trading Strategies
moving average period. Unfortunately, test results were barely profitable and thesystem was abandoned. I then tried a more complicated system. The rules were asfollows.Buy when the RS line crosses over its linear regression line of six days ago. Thesystem was optimized for the linear regression period. From the array of time periodsused, the 200-day regression line was the most profitable for long entry and the50-day for long exit. The code for the complete system is provided in Appendix A.This system was only profitable on the long side of the market, but produced veryfew trades making it suitable only for long-term investors. A countertrend systemusing the relative strength performed better for both long and short trades, producingmore than double the trades of the previous system.Buy signals of the countertrend system were issued when the momentum oscillatorof the RS declined below 20 and then rose above 22 in the next four days. Similarly,sell short orders were triggered when the momentum oscillator of the RS rose above85 and then crossed below 76 in the next four days. Please note that overbought andoversold levels of the RS indicator are exactly the opposite of all the other divergenceindicators included in Chapter 9.
11.5
THE BOLLINGER BAND DIVERGENCE SYSTEM
The most robust set of parameters produced by optimization were 100 days for theBollinger Band moving average and 70/5 for the momentum oscillator extreme levels.This system did not produce many trades and, as a result, the total profit was lessthan other systems. Results of this test are shown in Table 11.2.This system wasn’t tested with the dollar index as it didn’t perform well withnegatively correlated markets.
11.6
THE Z-SCORE
I didn’t expect a lot from this method because of the normality assumption violationsdiscussed in Chapter 9, but decided to include it for comparison purposes.The results (Table 11.2) were certainly a surprise, especially the dollar index testwhich outperformed all other single intermarket dollar index tests on a total net profitbasis. It seems that although this method is statistically unsound, in practice normalitywas a good enough approximation to the price distribution for the system to produceprofitable results.The Z-score period was optimized for values between 100 and 600 in steps of100. All values produced profitable results on both sides of the market. The best timeincrement, based on both performance and robustness was 500 days for the dollarindex test and 100 days for the XAU.
186
Intermarket Trading Strategies
momentum oscillator. The moving average period for both gold and each intermarketsecurity was optimized from five to 50 days in 5-day steps. The moving averageperiod which produced the highest level of profit was 15 days for the gold–XAU pairand 20 days for the gold–dollar index.The disparity system performed well on a profitability basis but suffered a comparatively larger drawdown.
11.9
DISCUSSION OF TEST RESULTS
Unfortunately, there exists no single metric to evaluate and compare different tradingsystems and assess what performance to expect in the future. Taking away all thedetails of a particular system, there are four statistics that enable you to assess asystem. These are: the percentage of profitable trades; the average profit/loss ratio;the total net profit; and, last but not least; the drawdown or risk/reward ratio.The percentage of profitable trades and the average profit/loss ratio can be combined in the profitability coefficient but there is also the drawdown and total profit tobe considered.Test results are shown in Tables 11.1, 11.2 and 11.3.All tests were profitable and outperformed the buy and hold method considerablywith less risk, being less than half of the time in the market.The multiple regression test outperformed all other tests by a wide margin (Table11.3), making an unbelievable profit of more than $1.2 million on a $100 000 initialequity, compared with a measly $67 000 profit of the buy and hold method.It is, however, questionable whether the same performance can be reproduced inthe future as it required optimization of the regression coefficients for that particulartime frame. The single regression XAU system, on the other hand, required no optimization, as the regression coefficients were calculated automatically by the formula.Based on profitability coefficient and risk/reward criteria, the single LRS systemstood out. The relative strength system was untradeable in practice as it producedvery few trades.Generally more than 30 observations should be used in order to produce statisticallysignificant results. The RS, Bollinger Band divergence, disparity and Z-score testsproduced less trades during the test period. Intermarket trading systems, however, areat an infant stage and we should not just throw out these test results due to a lack ofobservations but use them as a stepping stone for further analysis in the future. Formost trade system evaluations the number of observations should be an importantfactor; nevertheless, it should be understood that in divergence systems, a significantnumber of observations might be impossible to obtain.A remedy for the low trade turnover would be a synthesis of intermarket withconventional technical analysis indicators. This was not implemented at this stage asthe purpose of the tests was to assess the efficacy of the intermarket indicators ontheir own merit only.
A Comparison of Fourteen Technical Systems for Trading Gold
185
Figure 11.2 Chart of the gold ETF. Test signals generated by the double LRS method (Table11.3) are superimposed on the chart. The double LRS indicator is depicted in the middlewindow and the 200-day momentum oscillator in the top window. Buy signals were generatedwhen the momentum oscillator crossed below 75 from above and sell signals when it crossedover 5.
11.7
THE LINEAR REGRESSION SLOPE METHOD
This was tested extensively for both single divergence using the XAU and the dollarand also for double divergence using the XAU–dollar and silver–dollar pairs. Thissystem performed very well.The best intermarket combination on a total net profit basis was the silver–dollarpair. There was no clear winner among the single divergence tests. The dollar indextest performed better on a profit factor basis but the low turnover resulted in reducedtotal net profits. The results of the single and double divergence tests are shown inTables 11.1 and 11.3 respectively and buy-sell signals of the double LRS divergencesystem with the dollar Index-Silver pair are depicted in the chart in Figure 11.2.11.8
DISPARITY
The formula derived in Chapter 9 was used to calculate the disparity between gold andthe XAU or the dollar index and extreme divergence levels were determined by the
A Comparison of Fourteen Technical Systems for Trading Gold
183
Figure 11.1 Chart of the gold ETF. Test signals generated by the multiple regression test(Table 11.3) are superimposed on the chart. The multiple regression indicator is depicted inthe middle window and the 300-day momentum oscillator in the top window.
Thus by substituting the optimized parameters, the multiple regression equation wasreduced to:PG11 = 0.16 + 0.2X11 + .21S11 − 0.5D11
(11.1)
where PG11 is the predicted 11-day gold percentage change; X11, S11 and D11are the 11-day percentage changes for the XAU, silver and the dollar indexrespectively.Some buy and sell signals are shown in Fig. 11.1
11.4
RELATIVE STRENGTH (RS)
This was the only trend-following system and the obvious indicator to use in testing was the moving average. My first choice was the simplest trading rule ever:Buy when the RS line crosses over its moving average and sell when it crossesbelow the moving average. The only variable to optimize over the data was the
A Comparison of Fourteen Technical Systems for Trading Gold
187
In case anyone wishes to use any of the above systems I have to stress that thesewere not meant to be complete trading systems but were only designed in order tocompare the efficacy of the intermarket indicators. The main problem is that theydo not include proper exit conditions but rely solely on a fixed time exit or scarcedivergence signals that might or might not materialize depending on the relatedmarket or the divergence level. This doesn’t mean that they should be thrown awayeither, but rather should be used as a stepping stone in developing a complete systemby being combined with classic technical analysis indicators or stop-loss conditionsto anticipate any possible future market vicissitudes.
12Trading the S&P 500 ETFand the e-mini
A stock market technician can apply all the technical indicators he wants to thestock market, but if he stops there, it’s not going to work because the influencesthat affect the stock market are outside the market.–John MurphyThe S&P 500 is the most unpredictable index to trade as it leads all other indices.Nevertheless, I did the best I could to select the most profitable intermarket securitiesand systems. The S&P 500 can be traded through its surrogate, the SPY ETF ore-mini futures. This chapter includes two systems. The first is a daily system fortrading the SPY ETF, which requires holding the ETF for an average of 75 days.The second is an intraday system based on 15-minute data which takes advantage ofthe time difference between European and US markets. This one requires an averageholding period of 10 hours and is most appropriate for short-term or day traders.
12.1
DAILY SYSTEM
In the past intermarket system developers relied (see Cybernetic Trading Strategiesby M. Ruggiero) on the traditionally positive correlation between stocks and bondsto design intermarket systems to predict the S&P 500 based on T-bond futures. Thisrule has, however, been suspended in the past seven years by negative stock-bondcorrelation (see Section 5.2 and Fig. 5.5 in Chapter 5), which has necessitated a retreatto a more general position: The correlation can fluctuate because not everything thatis good for bonds is also good for stocks. This rules out the use of bond or bond yieldsin predicting the S&P 500.
190
Intermarket Trading Strategies
The next obvious candidates were European indices, but these did not performso well on testing, despite high nominal correlations. I then tried various breadthindicators using the divergence systems presented in Chapter 11.One of the best performing breadth indices was the percentage of stocks tradingabove their 40-day moving average. Every stock trading in the NYSE is representedin this indicator. Daily pricing data were obtained from Telechart (symbol: T2108).You can also calculate it yourself by running an exploration on all NYSE stocks,filtering out stocks, that are below their 40-day moving average. The result is thendivided by the total number of NYSE stocks included in the exploration. Preferredshares should be excluded as they move more with interest rates than with the market.
Testing ProcedureI used the single regression divergence system (presented in Chapter 11) and optimized the trade parameters using actual data for the S&P 500 for the period from1 January 1990 to 1 January 1997. The most robust set of parameters are included atthe bottom of Table 12.1. The optimized parameters were then tested out-of-samplefrom 18 February 1997 to 26 September 2007 and the test results were comparedwith the profits earned from a buy and hold strategy covering the entire test period(Table 12.1). The simulation model was intended to replicate how traders actuallyuse trading systems and therefore profits were not compounded, as this sometimesinvolved (during the latest phase of the test) holding large positions. Instead, an equaldollar amount of $20 000 per trade was specified.All orders were executed at the opening price on the day following a system signaland execution costs were assumed to be $10. For simplicity’s sake, dividends werenot included in the calculation of both the buy and hold and system performancewhen in the market. All positions were closed on the last bar.If you wish to replicate the tests, please keep in mind that for the test to beginproducing signals, the regression indicator should first be calculated and this requiresat least 477 bars to be loaded.The divergence model did not perform very well on the short side of the market andit was abandoned in favor of a different approach, which initiated short positions whenthe intermarket security (percentage of stocks above their 40-day moving average)reached an extreme point and reversed direction. Results for the divergence long onlyand the long–short system are summarized separately on Table 12.1.The criteria used to generate buy and sell signals can be summarized as follows.Buy: A long position was initiated when the regression divergence reached an extreme value and reversed direction.The intermarket momentum oscillator was used to help detect divergence extremevalues of the regression divergence indicator and, more precisely, buy signals wereissued when the 40-day intermarket momentum crossed under 80 from above. To
Trading the S&P 500 ETF and the e-mini
191
Table 12.1 Test results of the daily SPY systems from 18 February 1997 to 17 September2007. Both tests were profitable and outperformed the buy and hold method by a wide marginand considerably less risk. Both systems used the regression divergence method for longtrades. The second system used a different method to trade on the short side as well. Themomentum oscillator was used to determine optimum divergence levels.Test
Buy & hold
Regression
Regression hybrid
DailyLongSPY
DailyLong–ShortSPYT2108$20 000$37 850189 %18 %41311076 %$24 467−$4161$789−$4161.904.115.9−$4 054−6 %−$977311 %
PeriodicityLong/shortSecurity on testIntermarket securityTransaction cost per tradeTotal net profitProfit/loss %Annual percent gain/lossTotal number of tradesWinning tradesLosing tradesPercent profitableGross profitGross lossAvg. winning tradeAvg. losing tradeRatio avg. win/avg. lossProfitability coefficientProfit factorMax. drawdownMax. % drawdownMax. trade lossMax. consecutive lossesRisk/reward
−$19 178−96 %$00119 %
DailyLongSPYT2108$20 000$32 931165 %16 %2219386 %$17 660−$586$929−$1954.766.9030.1−$4 070−7 %−$319212 %
Reference bars neededStart date/testEnd dateTest period (years)Average trade length in daysTrades/yearTime in marketStock price at start of testStock price at end of test
02/18/979/17/0710.638630.1100 %81.88148.1
4772/18/979/17/0710.6612.135 %81.88148.1
4772/18/979/17/0710.645448 %81.88148.1
20408015100
20408015100
$20 000$16 13881 %8%110100 %$16 138$0$16 138
System ParametersROC daysMomentum oscillator – barsMomentum oscillator – buyMomentum osc. (long exit)Time exit-bars
192
Intermarket Trading Strategies
exclude cases where both the base and the intermarket security were in decline, thefollowing conditions were also required: The stochastic should be above its movingaverage and the 2-day rate of change of the intermarket security should be positive.Sell: The long position was liquidated on the exact opposite to the buy conditionsabove. A sell signal was generated when the intermarket momentum oscillator reachedan extreme reading below 15 and reversed direction, subsequently crossing over 15.Sell short: A contrarian interpretation of the breadth indicator was used to initiateshort positions when the percentage of stocks above their 40-day moving averagereached an extreme value above 72 % and then reversed and crossed below its 15-dayexponential moving average. To deal with whipsaw problems, the breadth indicatorshould have also crossed below 65 % in the next nine days or earlier. During extremely bullish periods, as in 2003 or 2006, the indicator had a tendency to remainin overbought territory for extended periods. To exclude premature signals, the shortorder was not executed unless the S&P 500 crossed below its 15-day exponentialaverage as well.Buy to cover: The exact opposite of the short sale condition was not sufficient tocover all short positions in a timely fashion, as this breadth indicator did not alwaysreach extreme low values before the market reversed and the emerging rally wiped outall profits from the short sale. There was therefore a need for more complex criteriain order to include the situations when the indicator did not perform as expected.Thus the short positions were closed when the breadth indicator reached an extremereading below 25 and then rose above 30 or the S&P 500 crossed over its 5-daymoving average on oversold breadth indicator readings (below 40).A stop loss was also added to cover all other situations not included in the above.
Evaluation of ResultsThe results for both tests are summarized in Table 12.1. I have marked in the accompanying chart in Fig. 12.1 when each buy/sell signal occurred but only (because ofspace limitations) for the time sub-period from September to December 2006.In the period tested, the results were very impressive. The buy and hold strategywould have shown a profit of $16 000 compared to $33 000 for the long-only and$38 000 for the long–short model.The long-only divergence system won 86 % of the time with a profit factor of 30but, most notably, this was achieved with substantial risk reduction. The maximumdrawdown was only $4000 or 7 % of equity, an amount most traders would becomfortable with. Not so comfortable was a drawdown of $19 000 or nearly 96 %of their initial equity, which the buy and hold investors lost during the 2001–2002traumatic bear market.
Trading the S&P 500 ETF and the e-mini
193
Figure 12.1 Chart of the SPY ETF. Test signals generated by the regression method aresuperimposed on the chart. The system equity line is plotted in the top window and belowthe 40-day momentum oscillator and the corresponding intermarket regression divergenceindicator. The intermarket security used by the regression indicator is the NYSE % of stocksabove their 40-day MA and is depicted, together with its 15-day moving average, in the thirdwindow. Buy signals are generated by the momentum oscillator crossing under 75 from aboveand sell signals when it crosses over 15. Short signals are triggered when the intermarketbreadth indicator rises above 72 and then falls under 60.
One of the major benefits from transaction timing is obtained by avoiding the pricedeclines that occur during bear markets and this was true for the current systems tested.Both systems initiated only two trades during the 2001–2002 bear market. Thefirst one was marginally profitable. The second, in March 2000, was initiated after
194
Intermarket Trading Strategies
a premature divergence signal, but managed to show a modest profit at close eventhough it resulted in the test’s maximum open drawdown.The major problem with intermarket divergence systems is that they do not producea lot of trades. This is because these systems take advantage of temporary marketinefficiencies to generate signals. These inefficiencies do not occur very often and,as a result, all divergence systems produce very few signals. The current systemwas no exception. The long-only divergence model produced only 22 trades duringthe 10-year test duration. The short–long system improved on the trade turnover byadding another 19 trades on the short side of the market. Short trades did not performas well, but this was no surprise as the S&P advanced 8 % per year on average duringthe test period.Considering the fact that 87 % of professional money managers haven’t beaten thestock market average l0-year performance, I feel that a mechanical trading systemthat for the past 10 years has at least doubled the market’s annualized returns is veryworth considering.
12.2
E-MINI INTRADAY SYSTEM
This system took advantage of the time difference between US and European exchanges to trade the S&P 500 e-mini before the US market opened, and it is basedon the divergence between the e-mini and the Dow Jones EuroStoxx 50 futures.I used the following method for creating continuous contracts: The most dominantor current contract was used until the next one became dominant. A problem arisingfrom the use of dominant contracts is that the price difference between the olddominant contract and new dominant contract at the time of roll-over may be largeenough to create a discontinuous break in the price series, thus a false signal. Thiscan be taken care of by adding the price difference at roll-over to the older contract.The current trading simulation involved joining the March and June contracts of thee-mini and EuroStoxx contracts.Several other assumptions underlie the trading model.The default trade size was five contracts per trade (or approximately $20 000 atthe time of the first trade). The initial and maintenance margins were assumed to be5.5 % and 4.4 % of contract value respectively and 50 % of total funds were allocatedto the initial trading capital and the other 50 % was held back for potential margincalls. Returns were calculated as a percent of initial trading capital and compared tothe buy and hold method which involved buying and holding five contracts for theduration of the test. No interest was credited to the account when out of the marketas this was assumed to cancel out additional slippage and skid costs.I used for this test the LRS single divergence system (presented in Chapter 11) andoptimized the trade parameters using 15-minute intraday data of the December 2007e-mini futures contract (ESZ7). The optimal parameters are included at the bottomof Table 12.2.
Trading the S&P 500 ETF and the e-mini
195
Table 12.2 Test results of the intraday S&P e-mini intermarket LRS system from16 January 2007 to 14 June 2007. The intermarket security used for the LRS divergencecomparison was EuroStoxx 50 Futures (FESX). The test outperformed the buy and holdmethod by a wide margin and considerably less risk. The 250-bar momentum oscillator wasused to determine extreme divergence levels.Test
Buy & hold
LRS
PeriodicitySecurity on testIntermarket securityNumber of shares/contractsTransaction cost per tradeTotal net profitProfit/loss %Annual percent gain/lossTotal number of tradesWinning tradesLosing tradesPercent profitableGross profitGross lossAvg. winning tradeAvg. losing tradeRatio avg. win/avg. lossProfitability coefficientProfit factorMax. drawdownMax. % drawdownMax. trade lossMax. consecutive lossesRisk/reward
15 minuteES
−$47 625−238 %$00252 %
15 minuteESFESX5$20 000$59 147296 %724 %72502269 %$75 300−$16 153$1506−$7342.053.674.7−$5024−10 %−$314938%
1/16/076/14/070.411491100 %14411516.75
5101/16/076/14/070.410.4417621 %14411516.75
Reference bars neededStart date/testEnd dateTest period (years)Average trade length – daysTrades/yearTime in marketPrice at start of testPrice at end of test
5$20 000$18 89094 %231 %110100 %$18 890$0$18 890
System ParametersLRS – barsMomentum oscillator – barsMomentum oscillator – buyMomentum osc. (long exit)Time exit – bars
9250701550
196
Intermarket Trading Strategies
I then tested the system out-of-sample on e-min