mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user