Merge branch 'dev'

This commit is contained in:
Miha Kralj
2026-03-13 13:47:10 -07:00
404 changed files with 2754 additions and 1763 deletions
+2 -4
View File
@@ -15,9 +15,7 @@
- The Hodrick-Prescott (HP) filter is a widely used tool in macroeconomics for separating the cyclical component of a time series from raw data.
- Parameterized by `lambda` (default 1600.0).
- Output range: Tracks input.
- Requires `⌈2√λ⌉` bars of warmup before first valid output (IsHot = true). Default: **~80 bars** (λ=1600).
- **Similar:** [HPF](../hpf/Hpf.md), [Roofing](../roofing/Roofing.md) | **Complementary:** Low-pass filter for trend | **Trading note:** Hodrick-Prescott filter; separates trend from cycle component. Lambda controls smoothness.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Hodrick-Prescott (HP) filter is a widely used tool in macroeconomics for separating the cyclical component of a time series from raw data. While the standard HP filter is non-causal (requiring future data), this implementation uses a causal approximation suitable for real-time streaming analysis.
@@ -112,4 +110,4 @@ TValue trend = hp.Update(new TValue(time, price));
// Static batch calculation
double[] prices = ...;
double[] trend = new double[prices.Length];
Hp.Calculate(prices, trend, 1600);
Hp.Calculate(prices, trend, 1600);