Real-time chart analysis needs deterministic updates per bar and explicit handling of warm-up periods. CCYC addresses this by implementing Computes Ehlers Cyber Cycle — a 2-pole high-pass IIR filter applied to a 4-element with parameterized inputs and direct state progression.
This implementation favors streaming execution over batch recomputation. The trade-off is more attention to state initialization, but latency stays predictable when charts scale.
Computes Ehlers Cyber Cycle — a 2-pole high-pass IIR filter applied to a 4-element
| Parameter | Purpose |
|---|---|
source |
Series to analyze |
alpha |
Damping factor controlling the high-pass cutoff (lower = smoother, typical 0.07) |
- [cycle, trigger] — cycle oscillator and one-bar-delayed trigger line
| Input variable | Type | Configuration |
|---|---|---|
i_alpha |
input.float |
default: 0.07, label: "Alpha (damping)" |
i_source |
input.source |
default: hl2, label: "Source" |
- Declared optimization: O(1) per bar; 2 IIR state variables + 4-tap FIR smoother
- Streaming model: single-pass update on each new bar.
- Warm-up behavior: outputs can be unstable until enough samples satisfy
lookback parameter. - Memory model: state is kept in Pine series context rather than external buffers.
Streaming logic keeps incremental cost stable, but initialization and edge-case handling become first-class concerns. That is a deliberate choice: predictable execution beats opaque recalculation spikes in live charts.
- Open the script in TradingView and confirm it compiles under Pine Script v6.
- Validate warm-up behavior on sparse data and short histories.
- Compare output against a trusted reference implementation for the same parameters.
- Confirm parameter bounds reject invalid values without silent fallback.
- Source code:
indicators/cycles/ccyc.pine - Documentation file:
indicators/cycles/ccyc.md - GitHub source view: https://github.com/mihakralj/QuanTAlib/blob/main/indicators/cycles/ccyc.pine
- GitHub documentation view: https://github.com/mihakralj/QuanTAlib/blob/main/indicators/cycles/ccyc.md