mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 17:48:05 +00:00
feat(dynamics): add PlusDI, MinusDI, PlusDM, MinusDM indicators
Complete thin Dx-composition wrapper indicators with full test coverage: - PlusDi/MinusDi: Directional Indicator wrappers (DiPlus/DiMinus from Dx) - PlusDm/MinusDm: Directional Movement wrappers (DmPlus/DmMinus from Dx) - Individual validation tests per indicator directory (TALib, Skender, bounds) - Combined unit tests (DiDm.Tests.cs) and validation tests (DiDm.Validation.Tests.cs) - Quantower wrappers + tests for all 4 indicators - PineScript v6 implementations with compensated RMA - Normalized .md documentation for all indicators and categories - 182 tests passing, 0 failures
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# AROONOSC: Aroon Oscillator
|
||||
|
||||
> *The Aroon oscillator subtracts Aroon Down from Aroon Up, collapsing two timing signals into a single directional gauge.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Dynamic |
|
||||
@@ -56,36 +58,6 @@ $$\text{AroonOsc} = \text{AroonUp} - \text{AroonDown}$$
|
||||
|--------|-----------|---------|------------|
|
||||
| $N$ | period | 25 | $N \geq 1$ |
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
Initialize:
|
||||
highBuf = RingBuffer(period + 1)
|
||||
lowBuf = RingBuffer(period + 1)
|
||||
bar_count = 0
|
||||
|
||||
On each bar (high, low, isNew):
|
||||
if !isNew: restore previous state
|
||||
|
||||
highBuf.Add(high)
|
||||
lowBuf.Add(low)
|
||||
bar_count++
|
||||
|
||||
len = min(bar_count, period)
|
||||
|
||||
// Scan for extremes
|
||||
maxIdx = index of maximum in highBuf over last (len + 1) entries
|
||||
minIdx = index of minimum in lowBuf over last (len + 1) entries
|
||||
|
||||
barsSinceHigh = len - maxIdx
|
||||
barsSinceLow = len - minIdx
|
||||
|
||||
AroonUp = (len - barsSinceHigh) / len × 100
|
||||
AroonDown = (len - barsSinceLow) / len × 100
|
||||
|
||||
output = AroonUp - AroonDown
|
||||
```
|
||||
|
||||
### Drift Immunity
|
||||
|
||||
Unlike EMA-based oscillators that accumulate rounding errors across thousands of bars, the Aroon Oscillator is computed fresh each bar from a finite window. There is no recursive state that can diverge. This makes it architecturally robust for long-running production systems where indicator drift is a concern.
|
||||
|
||||
Reference in New Issue
Block a user