Hi gang,
I want to share with you this implementation of the Hull Moving Average. This MA is a LWMA of a LWMA difference.
$$HMA(n) = LWMA( 2 LWMA(\frac{n^{2}}{2}) - LWMA(n^{2}))$$
I ended up making an indicator because I couldn’t make the composite indicators works. I tried something like:
LinearWeightedMovingAverage slowLWMA; slowLWMA = LWMA(symbol, slowLWMAPeriod, resolution); LinearWeightedMovingAverage fastLWMA; fastLWMA = LWMA(symbol, fastLWMAPeriod, resolution); LinearWeightedMovingAverage HMA = new LinearWeightedMovingAverage(HMAPeriod); var hma = HMA.Of(fastLWMA.Times(2).Minus(slowLWMA));
Plus tons of variants until I decided to try it making it as an indicator. And, in the indicator file, I ended up making a method for the LWMA (Yeah, seems silly I know. Now @MichelH will teach us how to make the whole thing in two lines of code).
Finally with this basic strategy, I couldn’t apply a Donchian channel for a composite indicator.
But, at least, works :)
Cheers, JJ