I programmed in different languages all Ehlers tools in the past and was in contact with him as they are many mistakes in his last book, I encourage you to check the code in the following chapters of this book and compare as he will use it again and sometimes with the mistakes corrected or with new ones...Ehlers did an amazing work and brought many new tools for traders however to my mind the one you have to focus on are the super smoother and other decyclers and oscillators as the band pass filter and improvements brought to classical tools as RSI. Moreover computing the dominant cycle is relevant only in the case of stocks as currencies are more trending than mean reverting, even if Ehlers showed in the previous books some example on forex strategies his work has been more concentrated on stocks. Finally this code will not all the time give back a value because of the final test on the power which has to be bigger than 0.5, you can see the same on his graph, sometimes the dominant cycle remains constant equal to the last value where power was bigger than 0.5
If you are a beginner in programming I encourage you to start by simple things and espacially things containing no mistake otherwise you will be quickly fed up !
good luck to you

Last edited by byakuren81; 11/20/14 16:24.