mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 12:08:05 +00:00
doc headers
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
# HMA: Hull Moving Average
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Trend (FIR MA) |
|
||||
| **Inputs** | Source (close) |
|
||||
| **Parameters** | `period` |
|
||||
| **Outputs** | Single series (Hma) |
|
||||
| **Output range** | Tracks input |
|
||||
| **Warmup** | `period + sqrtPeriod - 1` bars |
|
||||
|
||||
### TL;DR
|
||||
|
||||
- HMA (Hull Moving Average) is a solution to the eternal struggle between smoothness and lag.
|
||||
- Parameterized by `period`.
|
||||
- Output range: Tracks input.
|
||||
- Requires `period + sqrtPeriod - 1` bars of warmup before first valid output (IsHot = true).
|
||||
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
|
||||
|
||||
> "Alan Hull looked at the lag in moving averages and said, 'I can fix that.' And he did, by making the math do gymnastics."
|
||||
|
||||
HMA (Hull Moving Average) is a solution to the eternal struggle between smoothness and lag. Most indicators force you to choose one; HMA gives you both. It achieves this by using weighted moving averages (WMAs) in a clever configuration that cancels out lag while maintaining the smoothing properties of the WMA.
|
||||
@@ -220,4 +237,4 @@ For HMA(100), total memory is approximately 1.7 KB per instance (three WMA insta
|
||||
|
||||
1. **Overshoot**: Like DEMA, HMA can overshoot price turns because of the lag correction.
|
||||
2. **Period Sensitivity**: The $\sqrt{N}$ smoothing is hardcoded into the definition. You can't easily tweak the smoothing independently of the lag correction without breaking the "Hull" definition.
|
||||
3. **Integer Math**: The periods $N/2$ and $\sqrt{N}$ are rounded to integers. This can cause slight discrepancies between implementations depending on rounding rules. Standard integer truncation is used in QuanTAlib.
|
||||
3. **Integer Math**: The periods $N/2$ and $\sqrt{N}$ are rounded to integers. This can cause slight discrepancies between implementations depending on rounding rules. Standard integer truncation is used in QuanTAlib.
|
||||
|
||||
Reference in New Issue
Block a user