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:
Miha Kralj
2026-03-11 20:21:52 -07:00
parent 56b86bebfb
commit 33d20f2a18
437 changed files with 4589 additions and 2792 deletions
+2 -27
View File
@@ -1,5 +1,7 @@
# ATRBANDS: Average True Range Bands
> *True range bands let volatility itself draw the envelope — wider when uncertain, tighter when resolved.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Channel |
@@ -72,33 +74,6 @@ The SMA uses a circular buffer for $O(1)$ running sums. The ATR uses recursive I
| Gap-up | $\|H_t - C_{t-1}\|$ | Upward gap distance |
| Gap-down | $\|L_t - C_{t-1}\|$ | Downward gap distance |
### Pseudo-code
```
function ATRBANDS(source, high, low, close, period, multiplier):
validate: period > 0, multiplier > 0
// True Range
tr = max(high - low, |high - prev_close|, |low - prev_close|)
prev_close = close
// ATR via Wilder's smoothing (RMA)
alpha = 1 / period
raw_rma = (raw_rma * (period - 1) + tr) / period
e *= (1 - alpha)
atr = e > ε ? raw_rma / (1 - e) : raw_rma
// Center line (SMA via circular buffer)
middle = SMA(source, period)
// Bands
width = atr * multiplier
upper = middle + width
lower = middle - width
return [middle, upper, lower]
```
### Output Interpretation
| Output | Description |