mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 13:08:04 +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:
@@ -6,7 +6,7 @@ JMA (Jurik Moving Average) is widely considered the gold standard for adaptive s
|
||||
|
||||
## Historical Context
|
||||
|
||||
Mark Jurik kept the JMA algorithm a trade secret for years. It was sold as a "black box" library. Eventually, reverse-engineered versions appeared, revealing a sophisticated mix of volatility-adjusted smoothing and Kalman-like filtering. Our implementation is based on these high-fidelity reconstructions.
|
||||
Mark Jurik kept the JMA algorithm a trade secret for years. It was sold as a "black box" library. Eventually, reverse-engineered versions appeared, revealing a sophisticated mix of volatility-adjusted smoothing and Kalman-like filtering. The QuanTAlib implementation is based on these high-fidelity reconstructions.
|
||||
|
||||
## Architecture & Physics
|
||||
|
||||
@@ -16,14 +16,6 @@ JMA is not a simple FIR or IIR filter. It's a dynamic system.
|
||||
2. **Fractal Efficiency**: It computes a dynamic exponent based on the ratio of current change to historical volatility.
|
||||
3. **Adaptive Smoothing**: It uses this exponent to drive a 2-pole IIR filter that speeds up when the market moves and slows down when it chops.
|
||||
|
||||
### Zero-Allocation Design
|
||||
|
||||
We've ported the complex logic to a zero-allocation C# implementation.
|
||||
|
||||
- **RingBuffers**: Used for the volatility history (128 bars) and deviation (10 bars).
|
||||
- **Trimmed Mean**: We use a pre-allocated sort buffer to calculate the trimmed mean without heap allocations.
|
||||
- **State Management**: All internal state (bands, IIR coefficients) is preserved in a `struct`.
|
||||
|
||||
## Mathematical Foundation
|
||||
|
||||
The core update logic involves a dynamic alpha $\alpha$:
|
||||
|
||||
Reference in New Issue
Block a user