i continuous data from 16 January2007 to 14 June 2007. An extra 500 bars (10 days) had to be loaded for the systemto start producing trades. The data were downloaded from interactive brokers usingMetaserver RT (www.traderssoft.com).The S&P leads all other markets and therefore it is the most difficult market topredict, at least using intermarket indicators. The only time that the S&P doesn’t leadother international markets is when the US equity markets are closed. Thus tradeswere taken only from 1:00 am EST (9:00 am CET), when European futures starttrading, until 9:30 am EST (15:30 CET), when US markets open for trading.Because of the reduced trading hours and also the reasons mentioned in Section12.1 above, the divergence model produced only about 20 trades for the wholefive month duration of the simulation. These were too few for a statistically validconclusion. To increase the number of trades (and profits) I added conventionaltechnical analysis indicators to the model. The problem with conventional indicatorsis that some indicators, like moving averages, only work in trending market conditionsand others only in oscillating markets. To determine the appropriate market phase Iused the Congestion Index (CI) presented in Chapter 9.To refresh your memory here is a brief review. This function compares the percentage that the market wandered to the actual percentage the market rose during thelast 15-bar period.The less the absolute value of the indicator, the more congested the market.This strategy was more complicated to program, as it included three differentcriteria for initiating positions. The final system was able to switch gears and tradein three modes: divergence, trending and congestion.More precisely the criteria for initiating positions were as follows.
Long EntryDivergence conditions: No divergence signals were allowed after 10:00 US EST forthe reasons mentioned above. For the divergence signal to initiate a long entry thefollowing four conditions were employed:• The divergence between the 9 bar (135 minute) linear regression slope of the ESe-mini and ESTX futures should be positive.• The intermarket momentum indicator was used to help detect divergence extremevalues of the divergence indicator. Long trades were initiated when the 250 bar(5-day) intermarket momentum oscillator rose over 70 and reversed direction.• It’s not unusual for high divergence readings to register for a long time beforethe tradeable starts responding. Therefore it was desirable that the e-mini shouldalso confirm the reversal. This was ensured by specifying that the 5-bar stochasticshould be above its 4 bar moving average and the CI rose above the previous barreading.
Trading the S&P 500 ETF and the e-mini
197
• An additional condition requiring that the rate of change of the 5-bar intermarketsecurity (ESTX) should be positive was added to eliminate divergence signalswhen both the intermarket security and the base security were declining.Congestion conditions: The 15-bar CI was used to diagnose the market character.This condition generated signals if the absolute value of the CI was less than 20 andthe following conditions were true.• The lowest value of the 15 bar stochastic was below 30 and the stochastic crossedabove its 4 bar moving average.• The price rate of change for both the e-mini and the intermarket security was 0.1 %or higher.Trending conditions: The CI was again used to identify the market phase. Signalswere generated only if the CI rose above 20. To ensure that no trades were initiated inextremely overbought situations when the trending phase was about to end, no signalswere allowed if the CI was above 85. The most popular technical trending indicators,the Moving Average Convergence Divergence (MACD) and the moving average,were used to initiate conditions and, more precisely, a buy signal was issued when:• the MACD was above its 9-bar exponential moving average and at the sametime the price was also above the 40-bar moving average;• the 9-bar rate of change of the intermarket security was above 0.4 % (double thatof the e-mini). Also the divergence momentum was above 50 (the mid point of itsrange).
Long ExitAlways remember that it is the exit technique that determines the success of theentry signal. Timely sell conditions are more difficult to implement using divergenceconditions alone as they tend to initiate sell signals prematurely. The divergenceconditions described above were used in the opposite fashion and the CongestionIndex was again used to identify the market phase and liquidate the position using theappropriate trending or non-trending indicator. An extra condition was introduced toavoid trend reversals. This condition liquidated the position if the CI rose above 85and then fell, during the next three 15-minute bars, below 60.All trading methods will occasionally fail, especially intraday systems, as breakingadverse economic news can have unexpected results and price shocks. Thereforesome form of protection should be put in place to cut losses short and let profits run.Traders use a number of different methods to calculate stop-loss conditions: standarddeviation, average true range, percentages, support violation, etc. The stop-loss thatI chose to use here liquidated long positions if the closing price fell below 1.6 times
198
Intermarket Trading Strategies
the average true range of the last eight bars. This last condition reduced losses anddrawdown but at the expense of decreasing the percentage of profitable trades.
ShortThe exact opposite of the long entry conditions described above were used to initiate short positions. The congestion condition exploited declines from overboughtsituations and the trend condition initiated short positions during a decline when theMACD crossed under its exponential moving average, and at the same time the pricewas under its 40-day moving average and the CI below −20.
Buy to CoverA strategy similar, but opposite, to the long exit strategy was used to cover shortpositions. A volatility stop-loss was also used to cut losses in cases of unexpectedreversals when the price crossed over the lowest value of the last four bars plus 1.6times the average true range of the last eight bars.
Evaluation of ResultsThe results of the intraday trading simulation using a 5-month test period are shownin Table 12.2 and test signals from 17 May 2007 to 1 June 2007 are superimposed inthe chart in Fig. 12.2. The returns using this approach as compared to buy and holdare impressive. The model made over $59 000, three times the amount made by thebuy and hold investor and it was profitable on both the long and short side of themarket.The stop-loss condition reduced the drawdown dramatically to only $5000 or10 % of equity compared to a $47 000 or 240 % of equity suffered by the buy andhold method. This also helped keep the reserve capital required for margin calls verylow.The amalgamation of the three different conditions enhanced returns over the singledivergence method. It was difficult, however, to determine which specific conditioncontributed more to the overall profitability because the MetaStock system tester doesnot provide this information.In this case, the application of the stop-loss condition improved total profits from$50 700 (no stop-loss) to $59 200 by reducing the size of some individual losses.However, it had the adverse effect of decreasing the frequency of winning tradesslightly from 71 % to 69.4 %. Although massaging the results with a stop-loss condition does not necessarily add validity to the system, it does contribute to a trader’speace of mind.
Trading the S&P 500 ETF and the e-mini
199
Figure 12.2 Intraday 15-minute chart of the S&P 500 e-mini (ES) from 17 May 2007 to1 June 2007. Test signals generated by the intraday system are superimposed on the chart.The equity line is plotted in the top window (the right-hand scale should be multipliedby 10), the single intermarket LRS divergence indicator is depicted in the second windowand the corresponding 250-bar momentum oscillator in the third window. The intermarketsecurity used for the LRS indicator was EuroStoxx 50 Futures (FESX).
One of the major benefits of short-term intraday trading is the ability to exit or evenreverse the trade in the event of an unexpected and inevitable price reversal, a situationthat occurs very often because of breaking economic news. On the other hand,intraday trading requires the trader’s constant attention and can only be implementedby professional or full-time traders unless an automated trading platform is beingemployed.If you want to use the system in real time trading you should keep in mind therecan be sharp differences between hypothetical performance and real trading results astrading systems are prepared and optimized with the benefit of hindsight. Regardlessof the hours spent in back-testing and optimizing systems on historical data, the futurecannot be optimized.
13Trading DAX Futures
There are two times in a man’s life when he should not speculate: when hecan’t afford it and when he can.–Mark TwainIn Chapter 6 we discussed the relationship between the DAX and major internationalindices and commodities. I will now use a related index with the highest correlationwith the DAX in order to develop an intermarket divergence system to trade DAXfutures.A close inspection of Tables 6.1 and 6.2 reveal that either the CAC 40 or theEuroStoxx 50 would be a good choice. The correlation between the DAX and theCAC was slightly better on absolute price basis but the EuroStoxx, on the otherhand, was a little better when taking daily and weekly yields. This was also the casebetween the corresponding index futures.The dilemma was resolved by testing. Both the profit factor and total profitssuggested that the CAC 40 was more effective in predicting the DAX. It seems thatthe traditional historical antipathy between the German and the French people doesnot extend into their markets as, whether they like it or not, their economies are linkedtogether in the European Union.Another factor that influenced my decision to select the CAC is the fact that theEuroStoxx shared no less than 13 common component stocks with the DAX, whichcan reduce its predictive correlation.The same problem inherent in all divergence models (discussed in the previouschapter) was also encountered here, as the system generated only 22 signals during the4-year testing period. A classic moving average crossover system was also includedfor the benefit of active traders. The system was profitable but was not able tooutperform the buy and hold method. By using intermarket conditions, however, Iwas able to improve on the system’s performance, filtering out a large number ofunprofitable trades.
202
Intermarket Trading Strategies
Finally, for the benefit of investors who prefer not to trade futures, I also includean intermarket system to trade the 10 stocks that weight the most, on a percentagebasis, on the DAX index.13.1
INTERMARKET DIVERGENCE SYSTEM
The disparity indicator, explained in Chapter 9, was used to generate buy and sellsignals. To refresh your memory, this indicator compares the disparity (which isdefined as the distance of the current price from its moving average) between asecurity (in this case DAX futures) and the corresponding intermarket (CAC 40futures).Divergence indicators are usually premature in generating sell short signals, especially in up-trending markets which was the case for the DAX during the test period.This condition was therefore only used to trade on the long side of the market. Instead,classic technical analysis conditions were used to generate short sales.Setting up the TestsYou cannot, of course, trade the DAX directly so I had to use DAX futures (FDAX)for my trading simulation model. A major problem that I encountered during thetesting procedure was that Reuters Datalink provided only three years of historicaldata for DAX futures, which were not enough for both in-sample and out-of-sampletesting. To deal with this issue I used the index itself for the design and optimizationof the trade parameters, keeping the meager futures data for testing. To minimize thecurve-fitting effect, I divided the data into three segments. The first dataset was usedto develop the rules and optimize system parameters. The second segment was usedto test the optimized parameters during the development process, and the third out-ofsample segment was used to evaluate the results. Although the out-of-sample segmentwas from 13 March 2003 to 11 November 2007, the system started producing tradeson 19 January 2004 as it required 210 bars in order to calculate all the indicatorsinvolved. Several assumptions underlie the trading model. The default trade sizewas one contract per trade and, to avoid margin calls and the associated problemsmentioned in the previous chapter, the test was conducted in points and converted toEuro at €25 per DAX point. Long and short signals were executed next day at theopen and no interest was credited to the account when out of the market as this wasassumed to cancel out additional slippage and skid costs. The commission of 0.08points (€2), which is the commission charged by discount brokers, was deducted fromeach trade. Returns were calculated as a percent of the account required to trade eachsystem and compared to the buy and hold method which involved buying and holdingone DAX contract for the duration of the test. The compound formula was used toannualize percentage returns and for simplicity’s sake rollover costs were ignored.The amount of the account required was the greater of the initial margin of €18 253required to trade DAX futures (at the time of writing) or the maintenance margin
Trading DAX Futures
203
(€14 603) plus the initial drawdown. The percent standard deviation of change inequity was calculated by dividing the monthly change in equity in points by the priceof the DAX futures contract also in points, and the risk adjusted return was calculatedby dividing the annualized return by the percent standard deviation of the change inequity.Tradesim version 4.22 was used to simulate trading a portfolio of the following10 stocks that had more than 70 % weight on the DAX: E.ON, Siemens, Allianz,Deutsche Bank, Daimler Chrysler, Deutsche Telekom, BASF, SAP, RWE, and Bayer.The same conditions used in the DAX futures system were also used to trade thesestocks but only on the long side of the market. The initial trading capital was €28 000(which is the same as the account size required to buy and hold one DAX futurescontract), and the margin was specified at 50 %. The trade amount was €20 000 perstock and the profits were compounded (only for the stock test). Commission of€10 per stock was deducted from each trade. The time exit was 50 trading days forthe stock test and 80 trading days for the futures test.Long and short conditions were optimized separately. Although trading only oneside of the market can bias the results; had I optimized both sides concurrently, a fairpercentage of the positions wouldn’t have been realized because of an active positionin the opposite direction. To construct the buy and sell conditions I tested a numberof criteria individually and then I began to combine them, identifying parametercombinations and conditions that persisted in producing profits, even though theywere not necessarily the optimum. The disparity indicator wasn’t used to generateshort trades as it did not perform well on testing. To trade on the short side of themarket traditional indicators were used instead, and included the stochastic or theMACD which switched according to the appropriate market condition (congestionor trending).The system was defined as follows:Buy condition 1: Buy next day at the open if the 10-day disparity divergence risesabove 2 and the 200-day divergence momentum oscillator crosses above 65 andreverses direction while at the same time the CAC 40 is trending up during thepreceding 6-day period, the DAX closes higher than yesterday and the stochasticis higher than its 4-day moving average. The third criterion was added in order toexclude high divergence signals when both indices were declining and the fourthcondition ensured that the DAX started responding. This condition was optimizedfor the moving average period used in the disparity indicator.Buy condition 2: I added a second condition in an effort to increase the turnover,as the divergence criteria described above produced only about 10 long trades duringthe 4-year test duration. This condition incorporated three indicators: the first twowere used as market phase filters and the third as the trigger. Buy signals were onlygenerated when the DAX was in trading range and the stochastic indicator rose above30 and above its 4-day moving average. I used the 35-day congestion index (CI) andthe 20-day linear regression slope (LRS) to identify the market phase and the trend
204
Intermarket Trading Strategies
strength. The filter’s logic is straightforward: If the more recent slope is less than 0.2 %per day and the price is in the lower 35 % of its 35-day trading range, then the marketis in a trading range. Again this condition was tested and optimized individually withsatisfactory results. The linear regression slope period was optimized from 15 to 35in steps of five days. The value that produced the most profits in both in-samplesegments was 20 days and this was used for the out-of-sample test.I spent a lot of time searching for the best exit conditions as timely exit criteriaare essential to a profitable system. I found that no single condition produced the“Holy Grail”, but a combination of the following five criteria resulted in the best exitstrategy.Sell condition 1: This was the exact opposite of the first buy condition. The valueof the divergence momentum oscillator was optimized from 5 to 25 in steps of five.The first three values (5 and 10) were the best and the lowest value was chosen forthe out-of-sample test.Sell condition 2: All bullish trends eventually end. The CI indicator was utilized toidentify the trend’s conclusion. Long positions were liquidated when the CI declinedmore than 40 points and the price rate of change declined during the last three days,while the disparity with the CAC 40 was negative.Sell condition 3: The condition was added in order to close long positions in adowntrend. A moving average crossover condition was used to identify the downtrendand a sell signal was triggered when the MACD crossed below its 7-day movingaverage and the disparity with the CAC 40 was negative. Both moving averages wereoptimized and the most robust set of parameters were found to be 10 and 150 for theshort and long period respectively.This condition did not do any good to the out-of-sample results as the DAX was inan uptrend during most of the test duration, but it helped terminate trades in adversemarket conditions for both in-sample tests.Sell condition 4: An additional intermarket condition was added to close long positions in short term downtrends when the negative divergence between the DAX andthe CAC 40 fell below −1 but only when both declined more than 0.5 % during thelast two days. This condition was more effective when the DAX declined more thanthe CAC 40.I spent a lot of time trying to find effective short-sale conditions as the DAX was in asteep uptrend during 90 % of the first in-sample test duration. Finally I came up withthe following conditions. No less than four conditions were needed in order to closeshort positions in time before the uptrend resumed.
Trading DAX Futures
205
Short condition 1: The logic behind this condition was very similar to the secondcondition used to close long positions described above. In this case the MACD wasalso used to confirm the trend reversal. More specifically, a short sale was triggeredwhen the CI dropped by more than 50 points, the MACD was below its trigger (its7-day exponential moving average) and the DAX was in a downtrend during the last20 days (specified by a negative linear regression slope).Short condition 2: This was the exact opposite of the second buy condition andincorporated a filter to identify a trading range and a trigger to issue the signal. Shortsales were initiated only in a trading range and were triggered when the 25-daystochastic rose above 85 and than fell below 70 while the 5-day stochastic was belowits 4-day moving average. The CI and the linear regression slope were again used toidentify the market phase.Cover condition 1: This was similar to the positive divergence condition used toproduce long signals above except that the rate of change was not included in thiscase.Cover condition 2: The idea of including this condition was to close short positionson the conclusion or reversal of the downtrend. A buy to cover signal was triggeredwhen the CI rose by more than 40 points.Cover condition 3: This was the opposite of the third sell condition above andclosed short positions when the MACD crossed above its trigger but only when the10-day moving average was below the 150-day moving average (i.e. the DAX was ina downtrend). This did not improve the out-of-sample test results, as the DAX wasalmost always in an uptrend during the test duration (from 2004 to 2007) but it didmake a difference during the in-sample testing.Cover condition 4: The second buy condition was also repeated here to close shortconditions when the stochastic was oversold in a range bound market.
Evaluation of ResultsThe test results of the intermarket disparity divergence system are summarized inTable 13.1. For comparison purposes, the buy and hold method returns for bothtime segments are also included in the first and third columns. The test resultsof the out-of-sample test on DAX futures for the period from 18 March 2003 to2 November 2007 are depicted in the second column and the test results on the DAXindex for the period from 5 January 1999 to 2 November 2007 were also includedin the fourth column in order to evaluate the system performance in both bullish andbearish market conditions.
206
Intermarket Trading Strategies
Table 13.1 The test results of DAX futures and the DAX Index disparity tests are depictedin Columns 2 and 4 respectively. All tests were profitable and outperformed the buy and holdmethod by a wide margin despite the DAX’s steep uptrend during the first test period. TheDAX futures test was performed on a shorter duration sample (from 19 January 2004 to2 November 2007) as not enough historical data were available.TestSecurity on testIntermarket securityAccount size required
Buy & Hold
Disparity
Buy & Hold
Disparity
FDAX
FDAXFCE€18 611
DAX Index
DAX IndexCAC 40€18 255
€27 893
€91 104
Total net profitProfit/loss %Annualized % gain/lossAnnual % profit/lossTotal number of tradesWinning tradesLosing tradesPercent profitableGross profitGross lossAvg. winning tradeAvg. losing tradeRatio avg. win/avg. lossProfitability coefficientProfit factor
€93 096334 %47 %88 %110100 %€93 096€0€93 096
€122 350657 %71 %174 %2217577.3 %€130 757−€8408€7692−€16824.575.9315.55
€65 41172 %6%110100 %€65 411€0€65 411€0€65 411
€163 907898 %30 %102 %49331667.3 %€254 893−€90 986€7724−€56871.362.492.80
Max. drawdownMax. % drawdownMax. initial drawdownMax. consecutive lossesRisk/reward% standard deviation of equityRisk adj. annualized returnSharpe ratioStart date/testEnd dateTest period (years)Test period (days)Total trade length (days)Out of market (days)Average trade length – daysAverage trade length – barsTrades/yearTime in the market
−€24 913−89.3 %−€13 288026.8 %3.86 %12 %11.11/19/0411/2/073.813831383013839480.3100.0 %
−$12 708−15.8 %−€4006210.4 %2.85 %25 %23.21/19/0411/2/073.8138399838545325.872.2 %
−€148 685−74.0 %−€76 5010227.3 %6.7 %0.9 %0.31/5/9911/2/078.8322332230322322100.1100.0 %
−$29 486−42.2 %€0318.0 %4.1 %7.2 %6.11/5/9911/2/078.832231707151635255.553.0 %(Continued)
Trading DAX Futures
207
Table 13.1 (Continued)System ParametersDisparity barsMomentum oscillator – barsMomentum oscillator – buyMomentum oscillator – exitTime exit-barsDivergence buyDivergence sellROC bars
948
1020065580006
2210
1020065580006
As usual, the divergence system generated only few signals. Because the periodof the first test was on the whole bullish, selectivity worked to our advantage. Fewerand longer trades produced a higher annualized rate of return and profit factor. Inthe mixed market conditions of the second test (from 1999–2007), the elaborate sellconditions were triggered sooner, reducing the average holding period of each tradefrom 32 to 25 trading days.During the period from January 2004 until October 2007 covered in the first test,except for a brief time in the beginning and at the end, the DAX was in an almost45 degree uptrend. Even though it is very difficult to beat the buy and hold methodunder such a bullish market, the system managed to outperform it by riding the betterpart of the trend and selling short to capture small profits during the inevitable minorcorrections or the initial sideways market.During the course of the four-year simulation, the system made €122 000 withonly 22 trades, which were roughly 77 % accurate. The profit factor was 15.5and the maximum drawdown was €12 700 or 16 % of equity, which occurred on14 March 2007, mainly due to a premature long signal. This particular trade, however, produced a modest profit at close, even though it resulted in the test’s maximumopen drawdown. The buy and hold investor, on the other hand, suffered a traumatic€25 000 drawdown during the June 2006 correction, which wiped out almost all(90 %) of his equity.The risk-adjusted annualized return was 25 %, more than double that of the buyand hold method. The initial drawdown was only €4000, requiring a much smalleraccount to trade this system, compared with the €13 300 required by the buy andhold method. All metrics indicated that the system outperformed the buy and holdmethod by a ratio of more than 2:1.You should always keep in mind, however, that “a rising tide floats all boats” andinvestigate whether outstanding profits are due to sheer genius on your part or tooverriding market conditions that make it difficult to lose. A robust trading modelshould be able to take advantage of rich periods, and at least survive lean periods witha minimum of loss. To investigate whether the system performed well under diverse
Figure 13.1 Chart of the continuous DAX futures contract (FDAX) from February 2006 until November 2007. Buy and sell signals aresuperimposed on the chart. The disparity test equity line is plotted in the top window and the intermarket disparity indicator below. Theintermarket security used was CAC 40 futures (FCE).
Trading DAX Futures
209
market conditions, I tested the same system for the January 1999 to October 2007period, which included the 2003–2007 bull market and the devastating 2000–2003bear market.The test results are presented in the last column of Table 13.1 and the correspondingbuy and hold results in the fourth column. The system couldn’t repeat the outstandingresults of the first test but managed to produce 2.5 times the buy and hold profits with13 % of the risk. It initiated 13 long trades during the bear market, of which five wereprofitable, and managed to get out with modest losses from all the rest except one.The maximum drawdown happened on 3 April 2001, because of three consecutivelosses.The buy and hold investor, on the other hand, suffered a catastrophic loss of€150 000 during the 2002–2003 bear market which wiped out his initial equityand all his profits. As a consequence, the account size required to buy and holdone DAX contract for the entire test duration increased dramatically to €91 000,or five times the amount required to trade the system. The risk-adjusted return ofbuying and holding the DAX was only 0.9 % or one-eighth the return of the disparitysystem.The same system was then tested on 10 DAX component stocks that betweenthem account for 70 % of the index. Test results are summarized in the last columnof Table 13.2. The system generated 116 trades which were 65 % accurate on average. It made a total of €108 000 during the four-year duration and the maximumdrawdown occurred in August 2007 during a generous correction of the DAX. Ascan be seen in Figure 13.2, this event coincided with the system’s worst monthlyprofit.The system did beat the buy and hold method but lagged significantly behind thetest on DAX futures. This was mainly because it traded only the long side of the marketon a system optimized to trade both long and short. This is confirmed by looking atthe equity line of the futures system which actually made money during the summerof the 2007 correction by selling short immediately after the start of the decline.The spectacular returns of the first test, however, are not likely to be repeated in thefuture, as (at the time of writing) it looks like the current bull market is about to end.For any given system, different price histories will bring forth a different range ofpossible outcomes. This is clear by the completely different results produced by thesame system but on different time frames (Columns 3 and 5 in Table 13.1). It wouldbe reasonable, however, to expect the system to produce similar results to the secondtest, as the test sample incorporated both bullish and bearish market conditions. Evenso, both results are compelling enough to merit attention.
13.2
MOVING AVERAGE CROSSOVER SYSTEM
I include this system in order to demonstrate how you can enhance the accuracy andprofitability of the results using intermarket criteria as a filter. I used the moving
210
Intermarket Trading Strategies
Table 13.2 The test results of moving average crossover and the intermarketenhanced test on DAX futures are depicted in Columns 3 and 4 respectively. Theintermarket filter helped in outperforming the buy and hold method by a widemargin despite the DAX’s steep uptrend during the test period. In the last column,test results of the disparity system on 10 DAX components stocks are depicted. Inthis case only long signals were considered.
TestSecurity on testIntermarket securityAccount required
MA CrossBuy & hold MA Cross intermarket DisparityFDAX€27 893
FDAXNone€26 444
FDAXFESX€22 697
10 StocksFCE€28 000
Total