I thought I'd start this thread to discuss John Ehlers' new book, "Cycle Analytics for Traders". I just received my copy today and am already a fair way through (though it will likely take me several read throughs to comprehend). Shortly I will attempt to convert some of the EasyLanguage indicators accompanying the book into Ninjascript. Unfortunately I have only recently begun learning Ninjascript and C# and will likely need some help which leads me to some questions for Big Mike or any of the mods:
1. Can I post EasyLanguage files from the book in an effort to convert to Ninjascript or is that against the forum rules?
2. Are there any rules against discussing/sharing information from this or any book?
Once I get further along with things I will post my thoughts etc, but if any one else has read the book and would like to share their thoughts etc please feel free to do so here (assuming it is ok to do so).
Exported using NT Version 7.0.1000.3
This is a collection of various filters by John Ehlers outlined in his books "Rocket Science for Traders" and "Cybernet Analysis for Stocks and Futures".
The following indicators are included:
- Adaptive …
yes you can post EL but in four year on here I didn't any translation from EL --> Ninja,maybe there was a few but nothing I can recall.
I have already done quite a few of these conversions. It's generally pretty easy not only to convert them, but to optimize the code for efficient operation.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
@cory, thanks for the link but I'm talking about his newest indicators that were introduced in his book that was released in November 2013, Cycle Analytics for Traders. I have only seen the RoofingFilter indicator which John Ehlers provided during his webinar over the summer but haven't seen any other attachments on futures.io (formerly BMT) or anywhere else. Included with the book is the easy language code for the following:
@Zondor, have you converted any of the above or were you making a general statement about converting .ELD to .CS? I am most interested in only a few of them mainly the Autocorrelation Periodogram, Adaptive Bandpass, Even Better Sinewave, DeCycler, and the Hilbert Transform.
The following user says Thank You to Taggart for this post:
The Hilbert Transform has been done already. I found a version floating around somewhere and modified it, changing the name to Hilbert Transform 2. Somebody should check the code. I just fixed a bug, and there could be others. The plot looks plausible.
I don't have the EzL code for any of the other new indicators from the recent book except for the Roofing Filter, which should be available on futures.io (formerly BMT).
Hilbert Transform 2 is plotted in the bottom panel of the chart shown below. Note that the EMA in the price panel is for a time series (300T) other than that of the chart (100T). People call this a multi time frame mtf EMA (more accurately it is an ANY time frame, atf EMA). The time frames of the atf indicators can be based on minutes, seconds, or volume bars, not just on tick bars. I don't see any reason that this can't be done for Ehlers indicators.
Note that the two oscillator plots in Panel 2 are also based on a number of different time frames, none of which are those of the price series.
On this next chart, the time series is plotted using one of RJay's excellent, proprietary bar types, but the EMA is still based on the 300 Tick time series. The bottom panel has an Hilbert Sine Wave plot. This version of the Sine Wave is "powered by" the Hilbert Transform indicator and looks like it might actually be useful, unlike other versions I have seen.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
The following 2 users say Thank You to Zondor for this post:
This is my first attempt at programming a Ninjascript indicator, so be forewarned that there are likely some issues with it. Additionally, the code is sloppy and I welcome any suggestions on improvement. That being said, Ehlers introduces a tweak to his bandpass filter by incorporating Automatic Gain Control and Spectral Dilation Removal techniques. The indicator on its own isn't very useful, but when used with appropriate cycle length measuring tools can provide early reversal signals. Shortly I will attempt to port over the Autocorrelation Periodogram, which Ehlers believes offers the best way to measure cycle length. It is much more complicated, so I thought I would start off with the bandpass indicator to get my feet wet.
The attached .txt file is a copy of the EasyLanguage code for this indicator.
P.S. There are other, older versions of the Bandpass indicator floating around. I'm not sure of proper naming conventions so I went basic with it.
The following 4 users say Thank You to Taggart for this post:
I corrected two bugaboos that degrade performance with no benefit whatsoever:
Calculating on every tick values that only need to be calculated once per lifetime of indicator.
Calculating on every tick values that only need to calculated once per bar.
This drastically reduces the loading time and CPU load.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
The following 6 users say Thank You to Zondor for this post:
@Zondor thanks for the optimized version of the bandpass. I have a lot to learn. Attached is my stab at the AutoCorrelation Periodogram. I was able to get it to plot (without the fancy colors) but am not too sure about its accuracy. My code is of course sloppy and not optimized. There is one block of code involving what looks to be a 2 dimensional array (array "r" in Ehlers code) that I could not get to work, so I broke it down into 2 separate 1 dimensional arrays. I am not sure the logic mimics what Ehlers had intended. Anyway, if anyone smarter than me could have a look I would much appreciate it. I have also included Ehlers EasyLanguage code for reference.
The following 3 users say Thank You to Taggart for this post:
I was finally able to sort out the two dimension array issue which more closely follows Ehlers code and have attached an update. It produces significantly different values from the one posted earlier. So, one or both may be incorrect. Don't rely on either indicator until further verification. I have no way of comparing to Ehlers' work. There is only 1 screenshot in the book and it is for a stock which I don't have a data feed for. I also have not made any effort to optimize as I plan on only using this indicator on COBC=True (plus I don't really know how anyway, haha).
The following 3 users say Thank You to Taggart for this post:
It's not necessary to calculate on every tick values that never change during the execution of a program, or that only change once per bar. (Unless your CPU is lazy and needs some extra work to do).
Nor is it necessary to do anything when an intrabar price tick has the same value as the one just before it, since the output will be the same as the previous one.
When an instance of the EBSinewave is being called by another indicator, set the ShowPlot parameter to false. It is not necessary to generate an output plot (Values[0]) if an instance of the EB Sinewave is being called by another indicator, since the output of the EB SInewave is exposed by a public data series that is not dependent on the plot.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
The following 5 users say Thank You to Zondor for this post:
I have been unable to find any information on the net regarding how to read Elhers Dominant Cycle. Below it appears that it is a leading indicator saying that the next dominant cycle will be up. This seems to good to be true, is it?
I bought his Mesa 8/9 tools for Tradestation quite a few years ago. It was useless buggy shit that didn't work properly. I tried to get support from him but it was for nothing as he didn't seem to have a clue as to what the problem was. Extremely disappointed.
I spoke with John Ehlers over the phone several times, here is what I learned:
1) He seems to be very open and honest
2) He said he is primarily a researcher and trades live only to prove his research
3) He does NOT trade as a source of income
4) He said his new correlation indicator may NOT be fast enough to give profitable trend trades. I didn't ask about cycle mode trades.
His live autotrade strategy with Worldcupadvisor had a 24% MAX DD I believe.
The hypothetical results look great as with most systems (I completely discount these)
Anyone know why the "Even Better Sinewave" won't work in TS 10 copied straight out of the book? For some reason it gives an "unknown identifier" error for the "alpha1" variable even though it's declared under variables and initialized with 0 as in alpha1(0).