Cycle Analytics for Traders + Downloadable Software: Advanced Technical Trading Concepts (Wiley Trading) by Ehlers John F
Author:Ehlers, John F. [Ehlers, John F.]
Language: eng
Format: mobi, epub
ISBN: 9781118728604
Publisher: Wiley
Published: 2013-12-10T00:00:00+00:00
■ Discrete Fourier Transform (DFT)
The DFT is accomplished by correlating the data with the cosine and sine of each period of interest over the selected window period. The sum of the squares of each of these correlated values represents the relative power at each period from the familiar trigonometric equation:
The code to compute the DFT is shown in Code Listing 9-1. The only user input is whether to select Spectral Dilation compensation. The default selection is to use the compensation. The default window length is 48 bars, selected to be one full cycle period of the longest cycle period to be computed. The arrays are sized for the longest cycle period's being 48 bars. After declaring the variables, the data are prefiltered in a high-pass filter having a 48-bar cutoff period to be consistent with our longest computed cycle period and then smoothed in the SuperSmoother, described in Equation 3-3, and having a 10-bar cutoff period to be consistent with the shortest cycle period of interest.
EasyLanguage executes the entire code from top to bottom for each new bar of data from oldest to newest. Computation of the DFT for each new data bar starts by multiplying the data with a sine wave and a cosine wave, respectively, divided by the period being calculated and summing the products over the window length. In this case, the window length was made to be equal to the period of the longest cycle period to be computed. The sine part and cosine part of the wave at each period are squared and summed to compute the power at each period. The wave amplitude of each period computation was divided by the value fractal dilation compensation. If the spectral dilation compensation input is set to false, the wave amplitudes are simply divided by 1, with the effect that there is no compensation.
In the next block of code, a fast attack−slow decay automatic gain control (AGC) is used to normalize the spectral components and to minimize the variance of the spectral power over time. The AGC concept was introduced in Chapter 5 of this book; however, in this case, we are scaling on the basis of power rather than on wave amplitude. Therefore, the correct decay factor is the square root of 0.991, or 0.995. If the current power is greater than the variable MaxPwr, then the variable MaxPwr is immediately set to the value of the current power. However, if the current power is less than MaxPwr, then the MaxPwr is allowed to decay to 0.995 of its previous value.
The dominant cycle is extracted from the spectral estimate in the next block of code using a center-of-gravity (CG) algorithm. The CG algorithm measures the average center of two-dimensional objects. It is computed by summing the Y values and independently summing the X * Y values. Dividing the latter by the former yields the average position along the X axis where all the Y values reside. In the case of computing the dominant cycle, the Y values are power and the X values are the periods.
Download
Cycle Analytics for Traders + Downloadable Software: Advanced Technical Trading Concepts (Wiley Trading) by Ehlers John F.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Rich Dad Poor Dad by Robert T. Kiyosaki(6196)
Pioneering Portfolio Management by David F. Swensen(6092)
How To Win Friends and Influence People by Dale Carnegie(4342)
The Money Culture by Michael Lewis(3860)
The Dhandho Investor by Mohnish Pabrai(3574)
The Wisdom of Finance by Mihir Desai(3539)
Liar's Poker by Michael Lewis(3232)
The Intelligent Investor by Benjamin Graham Jason Zweig(2940)
The ONE Thing by Gary Keller(2925)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2902)
Fooled by Randomness: The Hidden Role of Chance in Life and in the Markets by Nassim Nicholas Taleb(2872)
Rich Dad Poor Dad: What The Rich Teach Their Kids About Money - That The Poor And Middle Class Do Not! by Robert T. Kiyosaki(2842)
Investing For Dummies by Eric Tyson(2805)
How to Win Friends and Influence People by Dale Carnegie(2801)
How to Day Trade for a Living: Tools, Tactics, Money Management, Discipline and Trading Psychology by Andrew Aziz(2792)
Market Wizards by Jack D. Schwager(2550)
Zero Hour by Harry S. Dent Jr. & Andrew Pancholi(2541)
How to Pay Zero Taxes, 2018 by Jeff A. Schnepper(2508)
Rich Dad's Guide to Investing by Robert T. Kiyosaki(2418)
