OPEN-SOURCE SCRIPT
Cycle Spectrogram [LuxAlgo]

The Cycle Spectrogram indicator is a spectral analysis tool that visualizes the power of various price cycles to identify dominant periodicities and market rhythms.
🔶 USAGE
The indicator provides a technical visualization of spectral density over time by decomposing price action into multiple cycle bands. This allows traders to identify whether the market is currently influenced by short-term noise or long-term structural cycles.
🔹 Spectrogram Interpretation
The spectrogram consists of 30 rows, each representing a specific cycle period. The vertical axis is logarithmically scaled between the "Minimum Period" and "Maximum Period" settings.
🔹 Dominant Period Tracking
To help identify the most significant cycle at any given time, the script includes a Dominant Period Marker (red cross). This marker tracks the row with the highest energy, providing a real-time estimate of the current market cycle length in bars.
🔹 Dashboard Metrics
A real-time dashboard provides key analytical data:
🔶 DETAILS
A spectrogram is a visual representation of the spectrum of a signal as it varies with time. This script utilizes a series of Bandpass filters to isolate specific cycle lengths. Each filter is tuned to a period calculated using a logarithmic distribution, ensuring that the analysis covers a wide range of market periodicities without bias toward specific scales.
The "Power" of each cycle is calculated by squaring the output of the bandpass filter and applying a smoothing factor. This process helps filter out transient spikes and provides a cleaner "heat" signature for more reliable cycle identification.
🔶 SETTINGS
🔹 Aesthetics
🔹 Settings
🔹 Dashboard
🔶 USAGE
The indicator provides a technical visualization of spectral density over time by decomposing price action into multiple cycle bands. This allows traders to identify whether the market is currently influenced by short-term noise or long-term structural cycles.
🔹 Spectrogram Interpretation
The spectrogram consists of 30 rows, each representing a specific cycle period. The vertical axis is logarithmically scaled between the "Minimum Period" and "Maximum Period" settings.
- Color Intensity: Brighter or more saturated colors (depending on the selected theme) indicate higher spectral power or "energy" at that specific cycle length.
- Vertical Position: Higher rows represent longer cycle periods (slower cycles), while lower rows represent shorter periods (faster cycles).
🔹 Dominant Period Tracking
To help identify the most significant cycle at any given time, the script includes a Dominant Period Marker (red cross). This marker tracks the row with the highest energy, providing a real-time estimate of the current market cycle length in bars.
🔹 Dashboard Metrics
A real-time dashboard provides key analytical data:
- Current DP: The period (in bars) of the most powerful cycle found in the current bar.
- Average DP: A 20-period moving average of the dominant period, useful for identifying stable, persistent cycles versus erratic shifts.
- Lowest Period: A reference for the minimum boundary of the spectral analysis.
🔶 DETAILS
A spectrogram is a visual representation of the spectrum of a signal as it varies with time. This script utilizes a series of Bandpass filters to isolate specific cycle lengths. Each filter is tuned to a period calculated using a logarithmic distribution, ensuring that the analysis covers a wide range of market periodicities without bias toward specific scales.
The "Power" of each cycle is calculated by squaring the output of the bandpass filter and applying a smoothing factor. This process helps filter out transient spikes and provides a cleaner "heat" signature for more reliable cycle identification.
🔶 SETTINGS
🔹 Aesthetics
- Theme: Select from several high-contrast color maps, including Viridis, Inferno, Magma, Plasma, Cividis, and Turbo.
🔹 Settings
- Minimum Period: The shortest cycle length (in bars) to include in the analysis.
- Maximum Period: The longest cycle length (in bars) to include in the analysis.
- Bandwidth: Controls the "focus" or resonance of each cycle band. Lower values result in narrower, more precise detection, while higher values allow for more overlap.
- Power Smoothing: Determines the amount of smoothing applied to the amplitude. Higher values reduce visual noise but may increase lag in detecting cycle shifts.
🔹 Dashboard
- Dashboard: Toggles the visibility of the data table.
- Position: Moves the dashboard to different corners of the pane.
- Size: Adjusts the text and cell size of the dashboard.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Build your own edge with AI: luxalgo.com
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Build your own edge with AI: luxalgo.com
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.