mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 03:58:04 +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 @@
|
||||
# KCHANNEL: Keltner Channel
|
||||
|
||||
> *Keltner wraps an EMA in ATR-scaled bands — a volatility envelope that responds to both trend and range.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Channel |
|
||||
@@ -81,33 +83,6 @@ $O(1)$ per bar: one EMA update, one True Range computation, one RMA update, and
|
||||
| Gap sensitivity | Yes (via TR) | Yes (via TR) | No |
|
||||
| Distribution assumption | None | None | Gaussian |
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
function KCHANNEL(source, high, low, close, period, multiplier):
|
||||
validate: period > 0, multiplier > 0
|
||||
|
||||
// EMA center line (with warmup compensation)
|
||||
alpha = 2 / (period + 1)
|
||||
raw_ema = alpha * source + (1-alpha) * raw_ema
|
||||
weight = alpha + (1-alpha) * weight
|
||||
ema = raw_ema / weight
|
||||
|
||||
// ATR (Wilder's RMA with warmup)
|
||||
tr = max(high - low, |high - prev_close|, |low - prev_close|)
|
||||
prev_close = close
|
||||
raw_rma = (raw_rma * (period-1) + tr) / period
|
||||
e *= (1 - 1/period)
|
||||
atr = e > ε ? raw_rma / (1-e) : raw_rma
|
||||
|
||||
// Bands
|
||||
width = multiplier * atr
|
||||
upper = ema + width
|
||||
lower = ema - width
|
||||
|
||||
return [ema, upper, lower]
|
||||
```
|
||||
|
||||
### Output Interpretation
|
||||
|
||||
| Output | Description |
|
||||
|
||||
Reference in New Issue
Block a user