mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 01:28: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 @@
|
||||
# HT_DCPHASE: Ehlers Hilbert Transform Dominant Cycle Phase
|
||||
|
||||
> *Dominant cycle phase tracks where price sits within its current cycle — the angular position of the market's heartbeat.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Cycle |
|
||||
@@ -64,38 +66,6 @@ $O(P)$ per bar where $P$ is the smoothed period (typically 6-50), due to the DFT
|
||||
|
||||
All internal constants are fixed by the TA-Lib specification.
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
function HT_DCPHASE(source):
|
||||
// Same Hilbert cascade as HT_DCPERIOD
|
||||
// ... (WMA smooth, Hilbert FIR, phasor, homodyne)
|
||||
// Produces: smoothPeriod, smoothPriceBuf
|
||||
|
||||
for each bar (after warmup):
|
||||
P ← round(smoothPeriod)
|
||||
|
||||
// DFT accumulation over dominant period
|
||||
realPart ← 0; imagPart ← 0
|
||||
for i = 0 to P-1:
|
||||
realPart += sin(2π·i / P) · smoothPriceBuf[t - i]
|
||||
imagPart += cos(2π·i / P) · smoothPriceBuf[t - i]
|
||||
|
||||
// Phase extraction
|
||||
if |imagPart| > 0:
|
||||
dcPhase ← atan(realPart / imagPart) · (180/π)
|
||||
else:
|
||||
dcPhase ← 90 · sign(realPart)
|
||||
|
||||
if imagPart > 0: dcPhase -= 180
|
||||
dcPhase += 90
|
||||
|
||||
// Wrap to [-45, 315]
|
||||
if dcPhase < -45: dcPhase += 360
|
||||
|
||||
emit dcPhase
|
||||
```
|
||||
|
||||
### Phase Quadrant Interpretation
|
||||
|
||||
| Phase Range | Cycle Position |
|
||||
|
||||
Reference in New Issue
Block a user