TASC's March 2008 edition Traders' Tips includes an article by John Ehlers titled "Measuring Cycle Periods," and describes the use of bandpass filters to estimate the length, in bars, of the currently dominant price cycle.
What are Dominant Cycles and Why should we use them?
Even the most casual chart reader will be able to spot times when the market is cycling and other times when longer-term trends are in play. Cycling markets are ideal for swing trading however attempting to “trade the swing” in a trending market can be a recipe for disaster. Similarly, applying trend trading techniques during a cycling market can equally wreak havoc in your account. Cycle or trend modes can readily be identified in hindsight. But it would be useful to have an objective scientific approach to guide you as to the current market mode.
There are a number of tools already available to differentiate between cycle and trend modes. For example, measuring the trend slope over the cycle period to the amplitude of the cyclic swing is one possibility.
We begin by thinking of cycle mode in terms of frequency or its inverse, periodicity. Since the markets are fractal; daily, weekly, and intraday charts are pretty much indistinguishable when time scales are removed. Thus it is useful to think of the cycle period in terms of its bar count. For example, a 20 bar cycle using daily data corresponds to a cycle period of approximately one month.
When viewed as a waveform, slow-varying price trends constitute the waveform's low frequency components and day-to-day fluctuations (noise) constitute the high frequency components. The objective in cycle mode is to filter out the unwanted components--both low frequency trends and the high frequency noise--and retain only the range of frequencies over the desired swing period. A filter for doing this is called a bandpass filter and the range of frequencies passed is the filter's bandwidth.
Indicator Features -Zero lag or Regular MACD/signal calculation - Fixed or Band-pass Dominant Cycle for MACD and Signal MA period inputs -10 different moving average options for both MACD and Signal MA calculations -Separate Band-pass Dominant Cycle calculations for both MACD and Signal MA calculations - Slow-to-Fast Band-pass Dominant Cycle input to tweak the ratio of MACD MA input periods as they relate to each other
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.