mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 09:38: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 @@
|
||||
# AROON: Aroon Indicator
|
||||
|
||||
> *Aroon measures how recently the highest high and lowest low occurred — recency as a proxy for trend vitality.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Dynamic |
|
||||
@@ -62,51 +64,6 @@ Range: $[-100, +100]$.
|
||||
|--------|-----------|---------|------------|
|
||||
| $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++
|
||||
|
||||
// Find index of highest high in buffer
|
||||
maxIdx = 0
|
||||
maxVal = -∞
|
||||
for i = 0 to min(bar_count, period):
|
||||
if highBuf[i] >= maxVal:
|
||||
maxVal = highBuf[i]
|
||||
maxIdx = i
|
||||
|
||||
// Find index of lowest low in buffer
|
||||
minIdx = 0
|
||||
minVal = +∞
|
||||
for i = 0 to min(bar_count, period):
|
||||
if lowBuf[i] <= minVal:
|
||||
minVal = lowBuf[i]
|
||||
minIdx = i
|
||||
|
||||
len = min(bar_count, period)
|
||||
barsSinceHigh = len - maxIdx
|
||||
barsSinceLow = len - minIdx
|
||||
|
||||
AroonUp = (len - barsSinceHigh) / len × 100
|
||||
AroonDown = (len - barsSinceLow) / len × 100
|
||||
AroonOsc = AroonUp - AroonDown
|
||||
|
||||
output:
|
||||
Up = AroonUp
|
||||
Down = AroonDown
|
||||
Oscillator = AroonOsc
|
||||
```
|
||||
|
||||
### Interpretation
|
||||
|
||||
| Condition | Signal |
|
||||
|
||||
Reference in New Issue
Block a user