|
Hi Fred, It's good to be able to get back on this subject again, especially as it looks like there's a few of us who are 'into' cycles. Your work-in progress looks very interesting I must say. I particularly like the idea in step 5 to reduce the data before finding a fit...brilliant in its simplicity. I also think your equation in step 6 will help me out...but without getting into that, here's the general logic of my approach for comparison (and I take the sarcastic(?) comment about explaining in English...I didn't do a good job of notating the script properly!) 1. Calculate *two* CMAs using triangular-smoothed MAs. CMA1 is n-periods length and CMA2 is n/2-periods. Both periods are rounded up to the nearest odd number. 2. CMA1 allows wavelengths > n-periods to pass and filters out < n-period waves. CMA2 allows through all cycle wavelengths > n/2-periods and filters out those < n/2. Therefore, subtracting CMA2 from CMA1 will give us the cycle (or combination of cycles if we're unlucky enough, or have our value of n wrong) that lies between n/2 and n. Steps 1 and 2 are as per Millard's "Cycle Highlighter" (CH), except he states that the best results are obtained with CMA1 being an SMA and CMA2 being a Weighted MA. He also says CMA1 periods should be *equal* to the wavelength to be isolated. This does work but, through experimenting, I have found that Triangular-MAs are best for both as they offer the superior smoothing-to-lag trade off. Furthermore, the periodicity of CMA1 should be x1.5 the cycle you want (making CMA2 therefore x0.75). The logic still holds up and the results are better IMO, with a more sine-like output. 3. Based on user-inputs (see below) I then generate an artificial sine wave. This is *anchored to the CH at its most recent (i.e. confirmed) peak or trough*. 4. Correlation coefficients are calculated between (a) the sine wave and the CH (or price - depending on user input) over the 'lookback' period (see below) and (b) the sine wave and the price in the 'end zone' (i.e. the no-data zone for the CH at the right-hand edge). Inputs: "SINE WAVELENGTH" - this determines if the wavelength of the sine is (a) "as per the base cycle (CH)" (i.e. there is no attempt to 'fit' the two curves beyond the anchor point) or (b) a "best fit". In the second case, the sine wavelength will depend on: "BEST FIT # RECENT CYCLES" - this is the number of full, completed cycles of the CH where the correlation is measured. The start point of X-cycles back is shown by a blue and red tick on the indicator. If option (b) is chosen above the average wavelength of the CH is measured in the zone from the blue tick to the end of its plot. This value is assigned to the sine plot. If option (a) above then we just get X-cycles back of both plots at the same periodicity. All the above is as per the first indicator I posted. The following loops are done in the auto-fit version: 5. A loop from "Wavelength Min" to "Wavelength Max" is performed to find the highest total correlation coefficient (a weighted average of the 'CH/sine' and the 'sine/end-zone price' values). 6. The series of loops is repeated for "#Cycles Min" lookback up to 5 cycles lookback. I chose 5 as an arbitrary number...it's slow enough as is and very rarely do you get a decent correlation going that far back. Obviously though when you do, you take notice. That's as much as I can tell you right now about the logic. Does it work? Well, with the usual caveats blah-blah-blah, I would say that it has been a very useful tool for me for a while now *in conjunction with other confirming and entry methods* Bear in mind that the purpose of the indicator is to find the *clearest* cycle amongst those present, i.e. the one that conforms most closely to a sine wave, and is therefore tradeable *on that time frame*. I will manually switch between time-frames to get the various major cycles (e.g. 1-hour, 4-hour, daily and weekly charts). Work on 'auto-ing' all that would be very processor intensive and requires further thinking. The plot you sent seems to bear out a further truth about trading with cycles, one that I've experienced with this indicator more than once: i.e. short-term cycles (measured in hours and a few days) are less tradeable than longer-term ones (measured in a few days upwards to weeks & months). Certainly, in the plot you sent, most of the smoothed price behaviour can be explained by the interaction of the two longest measured cycles (dark blue and cyan). Anyway, I look forward to ploughing through all the good stuff you've already posted and hope you can help keep this thread going. There's lots of really cool stuff going on here. Cheers for now, Andy Fred Tonetti wrote: __._,_.___ Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: http://www.amibroker.com/devlog/ For other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- Re: [amibroker] Re: Hurst Channels Andy Davidson
- [amibroker] Re: Hurst Channels Fred
- Re: [amibroker] Re: Hurst Channels Andy Davidson
- [amibroker] Re: Hurst Channels tomy_frenchy
- [amibroker] Re: Hurst Channels Fred
- [amibroker] Re: Hurst Channels tomy_frenchy
- [amibroker] Re: Hurst Channels Fred
- [amibroker] Re: Hurst Channels Fred
- Re: [amibroker] Re: Hurst Channels Andy Davidson
