mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-25 05:48:06 +00:00
Refactor documentation to remove "Zero-Allocation Design" sections across various trend indicators and implement a PowerShell script for automated cleanup
- Updated mathematical foundations and performance profiles where necessary to maintain clarity and coherence.
This commit is contained in:
@@ -18,13 +18,6 @@ KAMA uses an **Efficiency Ratio (ER)** to drive the smoothing constant of an EMA
|
||||
- ER approaches 0.0 in pure noise.
|
||||
2. **Smoothing Constant (SC)**: Scales between a "Fast" EMA (e.g., 2-period) and a "Slow" EMA (e.g., 30-period) based on ER.
|
||||
|
||||
### Zero-Allocation Design
|
||||
|
||||
Our implementation is efficient and allocation-free.
|
||||
|
||||
- **RingBuffer**: Stores the price history needed for the ER calculation (Period + 1).
|
||||
- **Incremental Volatility**: We update the volatility sum incrementally (subtracting the exiting difference, adding the entering difference) to keep complexity O(1).
|
||||
|
||||
## Mathematical Foundation
|
||||
|
||||
$$ ER = \frac{|P_t - P_{t-n}|}{\sum_{i=0}^{n-1} |P_{t-i} - P_{t-i-1}|} $$
|
||||
|
||||
Reference in New Issue
Block a user