So, it is possible to create a trading system that can correctly isolate severe and protracted downturns, without taking (too many) false signals.
Here are the rules:
126 day FRAMA, FC=4, SC=300 (we’re still modifying the original ETFHQ strategy).
A running median (somewhere between 150 days and 252 days–seemingly, all these configurations work).
Both the FRAMA and the confirmatory median must be moving in the same direction (up for a long trade, down for a short trade–the median rising is the new rule here), and the price must cross the FRAMA in that direction to enter into a trade, while exiting when the price crosses below the FRAMA. Presented as a set of quantstrat rules, it gets rather lengthy, since a rule needs to specify the three setup conditions, a rule to bind them together, and an exit rule (5 rules each side).
The strategy works on both long and short ends, though the short version seems more of an insurance strategy than anything else. Here’s the equity curve for a 150 day median:
Basically, it makes money in terrible periods, but gives some of it back during just about any other time. It’s there just to put it out there as something that can finally try and isolate the truly despicable conditions and give you a pop in those times. Other than that?tap_a=5644-dce66f&tap_s=10907-287229"brush: r; title: ; notranslate"> > (aggPF <- sum(tStats$Gross.Profits)/-sum(tStats$Gross.Losses))  1.169916 > (aggCorrect <- mean(tStats$Percent.Positive))  33.475 > (numTrades <- sum(tStats$Num.Trades))  667 > (meanAvgWLR <- mean(tStats$Avg.WinLoss.Ratio[tStats$Avg.WinLoss.Ratio < Inf], na.rm=TRUE))  2.631724 [,1] Annualized Sharpe Ratio (Rf=0%) 0.07606299 > Return.annualized(portfRets) [,1] Annualized Return 0.004247807 > maxDrawdown(portfRets)  0.09845553
In other words, it’s absolutely not a standalone strategy, but more of a little something to give a long-only strategy a boost during bad times. It’s certainly not as spectacular as it gets. For instance, here’s the equity curve for XLK in late 2008-2009. Mainly, the problem with the ETFHQ strategy (I’m still on that, yes) is that it does not at all take into account the magnitude of the direction of the indicator. This means that in a reverting market, this strategy has a potential to lose a great deal of money unnecessarily.
Basically, this strategy is highly conservative, meaning that it has a tendency to miss good trades, take unnecessary ones, and is generally flawed because it has no way of really estimating the slope of the FRAMA.
As the possible solution to this involves a strategy by John Ehlers, I think I’ll leave this strategy here for now.
So, to send off this original ETFHQ price cross strategy off, I’ll test it out of sample using a 200-day median, using both long and short sides (from 2010-03-01 to get the 200 day median burned in, to the current date as of the time of this writing, 2014-06-20).
Here are the trade stats and portfolio stats:
> (aggPF <- sum(tStats$Gross.Profits)/-sum(tStats$Gross.Losses))  1.195693 > (aggCorrect <- mean(tStats$Percent.Positive))  36.20733 > (numTrades <- sum(tStats$Num.Trades))  1407 > (meanAvgWLR <- mean(tStats$Avg.WinLoss.Ratio[tStats$Avg.WinLoss.Ratio < Inf], na.rm=TRUE))  2.263333 > SharpeRatio.annualized(portfRets) [,1] Annualized Sharpe Ratio (Rf=0%) 0.3290298 > Return.annualized(portfRets) [,1] Annualized Return 0.02467234 > maxDrawdown(portfRets)  0.1354166
With the corresponding equity curve:
In short, definitely not good. Why?tap_a=5644-dce66f&tap_s=10907-287229"http://s21.postimg.org/cr0msw9af/SHY_FRAMA_OOS.png" alt="" />
This is the out-of-sample equity curve of SHY–that is, the ETF of short term bonds. The trend had ended, but the trading system didn’t pick up on that.
In this case, you can see that the magnitude of the trend makes no difference to the strategy–which is a major problem. Although the counter-trend trading was eliminated, forcing action was not, and trying to remain loyal to the price crossing the indicator strategy while sticking to more conventional methods (a confirming indicator) turns out to be flawed. Here is another side symptom of a flawed system:
In this instance, using such a conservative confirmatory indicator for the short trade and simply using that same indicator for the long side indicates that there may very well have been overfitting on the system. On a more general note, however, this picture makes one wonder whether a confirmatory indicator was even necessary. For instance, there were certainly protracted periods during which there was a long trend that were cut off due to the running median being slightly negative. There were both long and short opportunities missed.
In my opinion, I think this puts the kibosh on something as ham-handed as a long-running confirmatory indicator. Why?tap_a=5644-dce66f&tap_s=10907-287229"nofollow" href="https://feeds.wordpress.com/1.0/gocomments/quantstrattrader.wordpress.com/98/">