INVITE-ONLY SCRIPT
Cycle Spectrum Analyzer

Cycle Spectrum Indicator — Short Description
This indicator computes a visual Fourier cycle spectrum from the input price data to reveal the market’s dominant cyclical behaviour. The price series is first detrended using a Hodrick–Prescott filter, after which a specialized Fourier analysis variant extracts the cycle components.
The resulting spectrum displays peaks that represent the dominant cycles present in the data, where each peak’s cycle length and amplitude indicate the strength and duration of the underlying rhythm. The most significant peaks are ranked, highlighting the top cycles currently driving market movement. Each detected cycle also includes a phase value, describing the cycle’s position at the most recent bar (e.g., topping, bottoming, rising, falling).
The indicator can be used to:
Additional Explanation of the included visual example image
Left Area – The Theoretical “Perfect Cycle”
The left part of the illustration presents a theoretical, perfectly smooth sine-wave cycle. This serves as a reference model to explain the core cycle parameters:
Right Area – The Price Series Used for Analysis
On the right, the actual price chart (e.g., Dow Jones Industrial Average) is displayed. This is the dataset from which the Fourier cycle spectrum is computed.
At the bottom of this chart section, a purple bar indicates the amount of historical data included in the cycle analysis. Because Fourier-based methods depend strongly on sample size, this visual cue shows how far back the indicator collected and processed data before generating the spectrum.
Bottom Area – The Cycle Spectrum Output Pane
The lower pane contains the Cycle Spectrum Analyzer output:
Calculation Only at the Last Bar
The indicator performs its full Fourier-based cycle decomposition exclusively on the most recent bar. This ensures that the spectrum always reflects the current market state without repeatedly recalculating historical spectra. The result is an efficient, real-time snapshot of the dominant cycles influencing the price at the latest point in time.
Works on Any Symbol and Any Timeframe
Because the analysis operates directly on the provided price series, the indicator is compatible with all markets and all timeframes—stocks, indices, forex, crypto, futures, and intraday charts alike.
The detected cycle lengths always refer to the selected chart’s bar interval (e.g., 240-bar cycle on a 1h chart ≈ 240 hours; same cycle on a daily chart ≈ 240 days).
Adjustable Historical Lookback (Default: 1100 Bars)
The accuracy of cycle detection depends on the amount of historical data used. The indicator provides a parameter allowing you to specify how many past bars should be included in the Fourier calculation.
This indicator computes a visual Fourier cycle spectrum from the input price data to reveal the market’s dominant cyclical behaviour. The price series is first detrended using a Hodrick–Prescott filter, after which a specialized Fourier analysis variant extracts the cycle components.
The resulting spectrum displays peaks that represent the dominant cycles present in the data, where each peak’s cycle length and amplitude indicate the strength and duration of the underlying rhythm. The most significant peaks are ranked, highlighting the top cycles currently driving market movement. Each detected cycle also includes a phase value, describing the cycle’s position at the most recent bar (e.g., topping, bottoming, rising, falling).
The indicator can be used to:
- Identify the top 3 dominant cycles with their length and phase.
- Analyze the current market state by interpreting these phases.
- Feed the dominant cycle lengths—often half the primary cycle—into other technical indicators for improved parameter tuning.
- Project cycles forward to estimate upcoming turning points and anticipate potential trend shifts.
Additional Explanation of the included visual example image
Left Area – The Theoretical “Perfect Cycle”
The left part of the illustration presents a theoretical, perfectly smooth sine-wave cycle. This serves as a reference model to explain the core cycle parameters:
- Cycle Length – The full wavelength of one complete oscillation (from trough to trough or peak to peak).
- Phase – The current position within that cycle, expressed both numerically and as an easy-to-read text label such as Bottom_Departure, Uptrend_Neutral, Approaching Top, or Top_Departure.
Right Area – The Price Series Used for Analysis
On the right, the actual price chart (e.g., Dow Jones Industrial Average) is displayed. This is the dataset from which the Fourier cycle spectrum is computed.
At the bottom of this chart section, a purple bar indicates the amount of historical data included in the cycle analysis. Because Fourier-based methods depend strongly on sample size, this visual cue shows how far back the indicator collected and processed data before generating the spectrum.
Bottom Area – The Cycle Spectrum Output Pane
The lower pane contains the Cycle Spectrum Analyzer output:
- It displays the cycle spectrum at the most recent bar, where each green peak corresponds to a detected cycle.
- Peak height = amplitude (strength) of the cycle
- Peak position (horizontal) = dominant cycle length
- The largest peaks represent the strongest cycles currently present in the detrended price series.
- Rank (1 = strongest)
- Cycle Length (in bars)
- Phase Description (interpreting where that cycle is right now)
- Which cycles are strongest,
- How long they are,
- And whether they are currently bottoming, topping, rising, or falling.
Calculation Only at the Last Bar
The indicator performs its full Fourier-based cycle decomposition exclusively on the most recent bar. This ensures that the spectrum always reflects the current market state without repeatedly recalculating historical spectra. The result is an efficient, real-time snapshot of the dominant cycles influencing the price at the latest point in time.
Works on Any Symbol and Any Timeframe
Because the analysis operates directly on the provided price series, the indicator is compatible with all markets and all timeframes—stocks, indices, forex, crypto, futures, and intraday charts alike.
The detected cycle lengths always refer to the selected chart’s bar interval (e.g., 240-bar cycle on a 1h chart ≈ 240 hours; same cycle on a daily chart ≈ 240 days).
Adjustable Historical Lookback (Default: 1100 Bars)
The accuracy of cycle detection depends on the amount of historical data used. The indicator provides a parameter allowing you to specify how many past bars should be included in the Fourier calculation.
- Standard value: 1100 bars
- Increasing the lookback allows detection of longer cycles, but may dilute short-term characteristics.
- Decreasing it focuses on shorter and medium-term cycles, increasing responsiveness but reducing visibility of long-duration rhythms.
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청 후 승인을 받아야 하며, 일반적으로 결제 후에 허가가 부여됩니다. 자세한 내용은 아래 작성자의 안내를 따르거나 StockMarketCycles에게 직접 문의하세요.
트레이딩뷰는 스크립트의 작동 방식을 충분히 이해하고 작성자를 완전히 신뢰하지 않는 이상, 해당 스크립트에 비용을 지불하거나 사용하는 것을 권장하지 않습니다. 커뮤니티 스크립트에서 무료 오픈소스 대안을 찾아보실 수도 있습니다.
작성자 지시 사항
Access to this indicator is available to readers who are, or who choose to become, professional subscribers to my private blog:
https://stockmarketcycles.substack.com/subscribe
Lars von Thienen
Join my blog and never miss an update:
stockmarketcycles.substack.com/subscribe
Join my blog and never miss an update:
stockmarketcycles.substack.com/subscribe
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청 후 승인을 받아야 하며, 일반적으로 결제 후에 허가가 부여됩니다. 자세한 내용은 아래 작성자의 안내를 따르거나 StockMarketCycles에게 직접 문의하세요.
트레이딩뷰는 스크립트의 작동 방식을 충분히 이해하고 작성자를 완전히 신뢰하지 않는 이상, 해당 스크립트에 비용을 지불하거나 사용하는 것을 권장하지 않습니다. 커뮤니티 스크립트에서 무료 오픈소스 대안을 찾아보실 수도 있습니다.
작성자 지시 사항
Access to this indicator is available to readers who are, or who choose to become, professional subscribers to my private blog:
https://stockmarketcycles.substack.com/subscribe
Lars von Thienen
Join my blog and never miss an update:
stockmarketcycles.substack.com/subscribe
Join my blog and never miss an update:
stockmarketcycles.substack.com/subscribe
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.