# Maximum-entropy Spectrum

Maximum-entropy Spectrum is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Estimates the dominant market cycle with Burg's maximum-entropy method: a 12th-order autoregressive model is fitted to 64 conditioned samples each bar and its spectrum scanned over 8-48 bar periods. The smoothed dominant period plots as a line, the live spectrum draws as a heat profile beside the last bar, and alerts flag sharp or flat spectrum transitions and cycle shifts.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 14, 2026.
- Access: free.
- Concepts: [Maximum-entropy Spectrum](https://www.luxalgo.com/library/concept/maximum-entropy-spectrum/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=aoc0zen5f3gby2xrew518kym
- Page: https://www.luxalgo.com/library/indicator/maximum-entropy-spectrum/

**Maximum-entropy Spectrum** measures which cycle currently dominates a market, and whether the reading deserves trust. Each bar the build high-passes the source, fits an autoregressive model with Burg's recursion, and evaluates its power spectrum across a period grid: the [maximum-entropy spectrum](https://www.luxalgo.com/library/concept/maximum-entropy-spectrum/), prized for sharp peaks on short windows. The smoothed dominant period plots as a line in bars, the spectrum as a heat profile beside the last bar.

## How to Trade the Maximum-entropy Spectrum?

- **Sharp rhythm**: peak power at or above the Sharpness Threshold times the spectral average means one rhythm dominates; below it the dashboard reads flat or drifting and the line deserves less weight.
- **Cycle shifts**: a jump in the smoothed dominant period beyond the shift threshold fires its own alert.
- **Half cycle**: the optional half-period plot is the traditional choice when setting oscillator lengths from a measured cycle.

## Maximum-entropy Spectrum Settings

- **Source** (default close) with **Conditioning** (default First Difference) and **Detrend Length** (default 48): high-pass preparation so trend cannot pose as a very long cycle.
- **Sample Window** (default 64): shorter tracks drifting cycles faster, longer stabilizes the spectrum.
- **AR Order** (default 12): too low blurs neighboring peaks, too high can split a real cycle; capped below half the window.
- **Minimum Period** (default 8) and **Maximum Period** (default 48): the evaluated grid.
- **Cycle Smoothing** (default 3): median-smooths the readouts.
- **Sharpness Threshold** (default 4.0) and **Cycle Shift Threshold** (default 5.0): the alert levels.
- **Calculation Bars** (default 2000), **Show Spectrum Profile** (on) with **Profile Width** (default 30), **Show Half Cycle** (off), plus dashboard toggles.

## Frequently Asked Questions

### How does this compare to the Hilbert Transform for cycle work?

The [Hilbert Transform](https://www.luxalgo.com/library/indicator/hilbert-transform/) derives one instantaneous period from the analytic signal's phase: responsive, but a single estimate. The maximum-entropy spectrum lays out the whole period landscape, including the dashboard's second peak, so competing rhythms stay visible.

### Why fit a model instead of transforming the data directly?

A direct transform needs long samples to separate nearby periods and treats its window as if it looped forever. The autoregressive route extrapolates the measured structure instead, producing sharp peaks from a few dozen bars.

### What does the profile beside the last bar show?

The current spectrum as horizontal heat bars on the shared period axis, the strongest peak claiming the full width. It is a snapshot of the latest fit and redraws as new bars update the model.

## Related indicators

- [Spline Quantile Regression Channel](https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel.md
- [Bitcoin Power Law](https://www.luxalgo.com/library/indicator/bitcoin-power-law/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-power-law.md
- [Recursive Least Squares Forecast](https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast.md
- [Adaptive Harmonic Forecast](https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast/) (FFT/spectral Analysis): markdown at https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast.md
- [Kalman Filter](https://www.luxalgo.com/library/indicator/kalman-filter/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/kalman-filter.md
- [Bitcoin Expectile Model](https://www.luxalgo.com/library/indicator/bitcoin-expectile-model/) (Quantile Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-expectile-model.md
- [Rolling Segment](https://www.luxalgo.com/library/indicator/rolling-segment/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/rolling-segment.md
- [Daily Polynomial Regressions](https://www.luxalgo.com/library/indicator/daily-polynomial-regressions/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/daily-polynomial-regressions.md

---

Source: https://www.luxalgo.com/library/indicator/maximum-entropy-spectrum/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
