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 -36
View File
@@ -1,5 +1,7 @@
# TTM_SQUEEZE: TTM Squeeze
> *Volatility compression is the market holding its breath before screaming.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Dynamic |
@@ -15,8 +17,6 @@
- Requires `Math.Max(Math.Max(bbPeriod, kcPeriod), momPeriod)` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Volatility compression is the market holding its breath before screaming."
John Carter's TTM Squeeze detects low-volatility compression by comparing Bollinger Band width against Keltner Channel width: when BB fits inside KC, a "squeeze" is on, signaling imminent breakout. The momentum component uses linear regression of price deviation from the Donchian midline to indicate direction. The indicator outputs a boolean squeeze state plus a continuous momentum histogram, requiring BB(20,2.0) and KC(20,1.5) as default parameters with a combined warmup of 20 bars.
## Historical Context
@@ -85,40 +85,6 @@ The linear regression extracts the trend component of the deviation, filtering n
| kcLength | int | 20 | > 1 | Keltner Channel period |
| kcMult | double | 1.5 | > 0 | KC ATR multiplier |
### Pseudo-code
```
TTM_SQUEEZE(bar, bbLen=20, bbMult=2.0, kcLen=20, kcMult=1.5):
// Bollinger Bands
sma_val = SMA(close, bbLen)
stddev = StdDev(close, bbLen)
bb_upper = sma_val + bbMult * stddev
bb_lower = sma_val - bbMult * stddev
// Keltner Channel
ema_val = EMA(close, kcLen)
atr_val = ATR(bar, kcLen)
kc_upper = ema_val + kcMult * atr_val
kc_lower = ema_val - kcMult * atr_val
// Squeeze state
squeeze_on = (bb_lower > kc_lower) AND (bb_upper < kc_upper)
// Momentum via linear regression of deviation
highest_high = Highest(high, bbLen)
lowest_low = Lowest(low, bbLen)
midline = (highest_high + lowest_low) / 2
delta = close - (midline + sma_val) / 2
momentum = LinReg(delta, bbLen)
// Momentum direction
momentum_rising = momentum > prev_momentum
momentum_positive = momentum > 0
return (momentum, squeeze_on, momentum_rising, momentum_positive)
```
### Squeeze-Fire Signal
The critical trading signal occurs on the transition bar: