Skip to content

HMA Crossovers

September 2, 2009

For quite some time, I had been investigating, tinkering, coding, and (chucking!), browsing, scouring for a robust trend following system, which will serve as an equal partner to my present system(also trend following).[Performance till last quarter is available online “The Curves!” ]. In my attempt, I once again, realised very often what works is  not the intellectually simulating but the most simplest. [For the reason, read this post of mine, here ].

The System is based on Hull Moving Average. An extremely fast and sensitive alternative to traditional moving average.Far faster than even EMA. At times, it might create problems, due to excess whipsaw, but many a times it can crossover at important turning points in the market. Hence this strategy, like any trend following strategy,

  • Can (but was bypassed as we’ll see) fare pretty badly in ranging markets
  • Will have huge drawdowns
  • Will have less than 50% win ratio.

Hull Moving Average is calculated like this:

Input: Array,Period
Function Needed: WMA

Method:
1. A = WMA(Array, [Period/2]); [[.] is the int function, acting as the floor]
2.B= WMA(Array,Period);
3. HMA= WMA(2*A-B,[sqrt(Period)]);

Output: HMA

You can have an idea of the sensitivity of the MA, if you run a glance over this chart:

TATATEA and HMA

TATATEA and HMA

Alright, I know you are waiting for the strategy: So here it goes, but yes, there are two parts in the strategy. a. The Real Buy-Sell decision and (b. ) A filter to find out, if markets are really trending or not. If not then it will keep the system out of the market.

—————————————————————————————-

  • LONG ENTRY if HMA(C,10) > HMA(C,50) AND FILTER=1;
  • SHORT ENTRY if HMA(C,50)< HMA(C,10) AND FILTER=1;
  • FILTER is defined as:A=(Highest of High of previous 10 highs)-EMA(C,25).
  • IF A is increasing, FILTER=1 else 0
  • LONG EXIT if C< Lowest of Low of Previous 10 closes
  • SHORT EXIT if C>Highest of High of Previous 10 closes
  1. Risk 1.5%
  2. Position Sizing: Volatility Scaling
  3. Transaction Slippage: None
  4. Markets Traded: MIDCAP basket of BSE-100 [price series running over NSE]
  5. The code contains pyramid over 3% and 6% movement in our favour, but go ahead and test your own pyramiding structures.

Results:

Crossover Statistics

Crossover Statistics

Very interestingly, we should not forget two things, we had been living in a very strong bull run for the past 10 years, with its own bit of crashes. Hence, Buy and Hold showing a CAGR of 16% is way off the top! The real test of buy and hold starts in a bear market. Hence the strategy might not look that glazy, but trust me, its impressive! Now notice the small asterisk at the top of CAGR results for 50-200Crossover. Essentially in my testing what I found is that, the performance from the short side of the market was negligible, and when I increased and tweaked the filter function for reflecting the longer time frame, it essentially showed no short trades at all :). Hence, another way of presenting that, our markets went through a structural bull run, where long side has been more consistently rewarded than the short side.

And finally, I give you the Equity Curve:

Equity Curve

Equity Curve

There is no doubt, that the strategy goes through a very testing drawdown. Volatility is wrecking. But smile! there is a way out, and that is called the equity curve switching method. The green line is the portfolio value, the blue curve is the 7 trade EMA of the portfolio value , and 15 trade EMA of the portfolio value.  I usually keep this as my default setting, until unless situation demands otherwise. So it happens that it worked here as well.

An often easy way for such trend following methods is its mean reverting nature. So what I would suggest is, execute the strategy till EMA(7) crosses and  stays above EMA(15) and run the strategy on paper or on simulation if EMA(7) crosses below EMA(15). It very well could have kept you out of the market, in its most testing period of drawdown.

Trade well,
Trade Smart,
Till Then,
Adios!

Advertisements
One Comment leave one →
  1. September 2, 2009 10:40 pm

    The HMA in the TATATEA chart hardly looks discernable!. There is a faint white line moving through the prices, if you can see. Thats HMA(10)! The Golden colored curve is HMA(50). And the up arrow is given by crossover, but the sell arrow is not given by a crossover in the opposite direction

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: