Hi everyone

The purpose of this thread is to start a discussion and hopefully some collaboration around the work of John Ehlers. I have been reading a lot of his work the last couple of months, and I am very interested in pursuing it further. It appeals because it has a solid theoretical foundation.

I'll kick things off with his "Even Better Sine Wave" (EBSW) as described in "Cycle Analytics for Traders". The EBSW is a variant of his Roofing Filter, but uses a single-pole high pass filter connected to the super smoother. After the data is filtered, the 3-bar average wave amplitude and power are calculated and the output is then computed by normalizing the averaged amplitude to the square root of the average power. The result is an oscillator-style indicator that swings between +1 and -1.

Here is my code (comments and suggestions much appreciated):

Code:
// =====EHLERS' EVEN BETTER SINEWAVE=====

function run()
{

//High pass filter cyclic components whose periods are shorter than duration input
vars Price = series(price());
var Duration = 40; //optimize(40, 10, 100); //max length of trend trade
vars HP = series(HighPass1(Price, Duration));

//Smooth with super smoother
vars Filter = series(Smooth(HP, 10));

//3-bar average of wave amplitude and power
vars Wave = series((Filter[0] + Filter[1] + Filter[2])/3);
vars Pwr = series((Filter[0]*Filter[0] + Filter[1]*Filter[1] + Filter[2]*Filter[2])/3);

//Normalize average wave amplitude to square root of the average power
vars ebsw = series(Wave[0]/sqrt(Pwr[0]));
plot("ebsw", ebsw, NEW, RED);

}



Attached is a chart showing what it looks like (EUR/USD daily bars from 2012).

The only input parameter is the cutoff period of the single-pole highpass filter (Ehlers' default is 40). Longer periods cause the oscillator to swing less frequently. Ehlers interprets the cutoff period as being something like the maximum expected trend duration - but I don't see how you can "expect" the duration of a trend! Seems more sensible to optimize this parameter over a robust range of values in a trading system.

Ehlers says "hold a long position when the indicator value is near +1 and hold a short position when it is near -1." Obviously this is not enough to create a trading system, and the indicator is much more useful when the market is trending, as opposed to cycling.

I think this filter could have an application in a system that follows trends, but it needs additional filters to really make it useful.

I'd love to hear what others think of this!

Attached Files EBSW.png