mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
doc headers
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
# HAMMA: Hamming-Weighted Moving Average
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Trend (FIR MA) |
|
||||
| **Inputs** | Source (close) |
|
||||
| **Parameters** | `period` (default 10) |
|
||||
| **Outputs** | Single series (Hamma) |
|
||||
| **Output range** | Tracks input |
|
||||
| **Warmup** | `period` bars |
|
||||
|
||||
### TL;DR
|
||||
|
||||
- HAMMA is a Finite Impulse Response (FIR) filter that applies a Hamming window to price data.
|
||||
- Parameterized by `period` (default 10).
|
||||
- Output range: Tracks input.
|
||||
- Requires `period` bars of warmup before first valid output (IsHot = true).
|
||||
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
|
||||
|
||||
> "Julius von Hann picked his window function to suppress spectral leakage; we're just using it to smooth price data. Same math, different trading floor."
|
||||
|
||||
HAMMA is a Finite Impulse Response (FIR) filter that applies a Hamming window to price data. The Hamming window is a raised cosine with specific coefficients (0.54 and 0.46) chosen to minimize the amplitude of the first side lobe in the frequency domain. This makes it particularly effective at separating the signal (trend) from nearby noise frequencies.
|
||||
@@ -247,4 +264,4 @@ For a typical 14-period: ~92 + 224 ≈ **316 bytes** per instance.
|
||||
|
||||
4. **Small Periods**: With very small periods (e.g., 3), the window shape degenerates. The edge-center-edge pattern becomes less meaningful. Consider period >= 5 for meaningful Hamming characteristics.
|
||||
|
||||
5. **Side Lobe Trade-off**: The -43 dB first side lobe comes at the cost of slightly wider main lobe than Hanning. If frequency resolution matters more than side lobe suppression, consider other windows.
|
||||
5. **Side Lobe Trade-off**: The -43 dB first side lobe comes at the cost of slightly wider main lobe than Hanning. If frequency resolution matters more than side lobe suppression, consider other windows.
|
||||
|
||||
Reference in New Issue
Block a user