Here is the Empirical Mode Decomposition by John Ehlers.

Most technical analysis is quite simple but John Ehlers takes it one step further and incorporates fractals and sine waves into his analysis. The mathematics in his technical analysis indicators is really some of the most advanced that you can find. He releases most of his findings publicly on his website here. Some of his papers are really a must-read for those who want to take their technical analysis to the next level.

I wanted to backtest some of his strategies so I've converted his EasyLanguage code into C#.

In this share, I present to you the Empirical Mode Decomposition. The Empirical Mode Decomposition follows the same logic as John Ehlers' Sine Wave Indicator. However, instead of being a strategy, the decomposition conveys whether the market is moving in cyclical patterns or whether it is in a trend. Specifically, the market is supposed to be cyclical when the Mean is between the Lower and Upper band:

So when the market is cyclical, you could use the Sine Wave Indicator. When the market is trending, you could use a moving average-based indicator. The Empirical Mode Decomposition simply helps you determining when such regimes occur. Note that you can play with the parameters to change the sensitivity of the decomposition.

I hope you like it. Happy coding.