Avoid Peaking Ahead on Trade Filters

In this article I want to show how misleading a peak-ahead failure can be on a trading system.

I was working on a countertrend system and the backtesting results showed that it picked up some nice trades, but when the trend was getting too strong, it started losing money. The simple idea was to use the directional movement index differential (DDIF) by J. Welles Wilder to suspend trading if the trend gets too strong.

After adding that filter, the performance suddenly exploded beyond my expectations.

The system was making 116.000€ with two DAX futures within a bit over three months. The maximum draw amount was only 6000€ and the profit to max drawdown ratio was almost 1:20. Either I found something really good or there must be a big mistake.

This is usually a very good warning sign that something must be wrong.

I found the error very quickly.

The initial countertrend trading system was taking trades whenever extreme price points were reached. The trade was done immediately inside the bar when the price level was reached and NOT waiting until the bar closed. This is absolutely fine to do if you are aware of it and you can expect some slippage in these situations.

The simple filter, however, was based on DMI (DDIF) but the DMI is updated with the bar's close.

So in the real world, I might have a peak in the first few seconds of the bar, which I would take (or the CQG AutoTrader would execute), but after the bar settles, the DMI tells us not to use this trade because the trend is too strong. Not a big deal you might think, but in this case it was really big.

The proper textbook solution is to use the DMI information from one bar previous to avoid this issue.

Here's a comparison of some of the results between the realistic backtesting results and the one with the peak-ahead error in it:


Learn more from CQG HTML Help