mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
validation and profiles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# AROON: Aroon Indicator
|
||||
# AROON: Aroon Indicator
|
||||
|
||||
The Aroon indicator measures the temporal freshness of price extremes, answering not "how much did price move?" but "how long ago did it make a new high or low?" Aroon Up tracks the recency of the highest high within the lookback window; Aroon Down tracks the recency of the lowest low. Both are normalized to 0-100 where 100 means the extreme occurred on the current bar and 0 means it occurred at the far edge of the window. A companion Aroon Oscillator (Up minus Down) provides a single zero-centered metric for trend bias. Unlike recursive indicators that accumulate floating-point drift, Aroon is purely windowed — its value depends only on data within the lookback period, making it immune to initialization artifacts.
|
||||
|
||||
@@ -106,6 +106,43 @@ On each bar (high, low, isNew):
|
||||
|
||||
Aroon produces discrete jumps rather than smooth curves. When a new extreme occurs, the corresponding line snaps to 100. Between new extremes, the line decays linearly by $100/N$ per bar. This staircase pattern is a natural consequence of the temporal measurement and should not be smoothed away — it carries information about the periodicity of extremes.
|
||||
|
||||
## Performance Profile
|
||||
|
||||
### Operation Count (Streaming Mode)
|
||||
|
||||
Aroon tracks the bar-ago position of the highest high and lowest low using deques (monotone queues) or linear window scans.
|
||||
|
||||
**Post-warmup steady state (per bar, deque-based O(1) amortized):**
|
||||
|
||||
| Operation | Count | Cost (cycles) | Subtotal |
|
||||
| :--- | :---: | :---: | :---: |
|
||||
| Deque update (high deque, amortized) | 2 | 1 | 2 |
|
||||
| Deque update (low deque, amortized) | 2 | 1 | 2 |
|
||||
| Index arithmetic (bars since high/low) | 2 | 1 | 2 |
|
||||
| MUL × 2 + DIV × 2 (scale to 0–100) | 4 | 5 | 20 |
|
||||
| **Total** | **10** | — | **~26 cycles** |
|
||||
|
||||
~26 cycles per bar at steady state. With naive linear scan: O(N) per bar = 2N comparisons.
|
||||
|
||||
### Batch Mode (SIMD Analysis)
|
||||
|
||||
| Operation | Vectorizable? | Notes |
|
||||
| :--- | :---: | :--- |
|
||||
| Sliding max index (ArgMax) | Partial | SIMD can scan windows in parallel; ArgMax requires horizontal reduction |
|
||||
| Sliding min index (ArgMin) | Partial | Same as ArgMax |
|
||||
| Position → percentage scaling | Yes | VMULPD + VDIVPD |
|
||||
|
||||
Batch mode with SIMD prefix-max/min and horizontal ArgMax achieves ~4× throughput on vector-length chunks for the scan phase.
|
||||
|
||||
### Quality Metrics
|
||||
|
||||
| Metric | Score | Notes |
|
||||
| :--- | :---: | :--- |
|
||||
| **Accuracy** | 10/10 | Exact integer arithmetic for positions; no floating-point drift |
|
||||
| **Timeliness** | 8/10 | N-bar lookback; immediate response when new high/low is set |
|
||||
| **Smoothness** | 4/10 | Output jumps when extreme prices enter or exit the window |
|
||||
| **Noise Rejection** | 5/10 | Sensitive to outlier bars that reset the extreme-price position |
|
||||
|
||||
## Resources
|
||||
|
||||
- Chande, T.S. — *Beyond Technical Analysis* (John Wiley & Sons, 1995)
|
||||
|
||||
Reference in New Issue
Block a user