mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 10:08: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 @@
|
||||
# ADXR: Average Directional Movement Rating
|
||||
|
||||
> *ADXR smooths ADX over time, filtering out momentary strength spikes to reveal the underlying trend conviction.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Dynamic |
|
||||
@@ -56,34 +58,6 @@ The $N-1$ lag (rather than $N$) matches TA-Lib's reference implementation exactl
|
||||
|
||||
The period controls both the internal ADX calculation and the historical lookback depth.
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
Initialize:
|
||||
adx = new Adx(period)
|
||||
adxBuffer = RingBuffer(period)
|
||||
bar_count = 0
|
||||
|
||||
On each bar (high, low, close, isNew):
|
||||
if !isNew: restore previous state
|
||||
|
||||
// Full ADX pipeline
|
||||
adxValue = adx.Update(high, low, close, isNew)
|
||||
|
||||
// Store in history
|
||||
adxBuffer.Add(adxValue)
|
||||
bar_count++
|
||||
|
||||
// ADXR = average of current and (N-1)-lagged ADX
|
||||
if bar_count >= period:
|
||||
historicalAdx = adxBuffer[0] // oldest value in buffer
|
||||
ADXR = (adxValue + historicalAdx) / 2.0
|
||||
else:
|
||||
ADXR = adxValue // insufficient history
|
||||
|
||||
output = ADXR
|
||||
```
|
||||
|
||||
### Lag Analysis
|
||||
|
||||
| Component | Lag Source |
|
||||
|
||||
Reference in New Issue
Block a user