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
View File
@@ -1,7 +1,5 @@
# Reversals
> "The market speaks in reversals. The art is hearing it above the noise."
Reversal indicators identify potential turning points where price may change direction. Pivot points calculate support/resistance from prior period data. Pattern-based tools detect structural shifts in price action.
| Indicator | Full Name | Description |
+2 -2
View File
@@ -1,5 +1,7 @@
# CHANDELIER: Chandelier Exit
> *The exit is more important than the entry. Everyone knows where to get in; getting out alive is the real trick.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The exit is more important than the entry. Everyone knows where to get in; getting out alive is the real trick."
The Chandelier Exit computes ATR-based trailing stop levels that hang from the highest high (for longs) or rise from the lowest low (for shorts) over a lookback period. It produces two overlay lines: ExitLong (trailing stop for long positions) and ExitShort (trailing stop for short positions). Developed by Charles Le Beau and popularized by Alexander Elder. Default parameters: period 22, multiplier 3.0.
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# CKSTOP: Chande Kroll Stop
> *The best stop-loss is the one that knows where volatility ends and trend begins.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `atrPeriod + stopPeriod` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The best stop-loss is the one that knows where volatility ends and trend begins."
The Chande Kroll Stop computes adaptive trailing stop levels using ATR-smoothed volatility envelopes around rolling extremes. It produces two lines: StopLong (support) and StopShort (resistance). When price trades above both stops, the trend is bullish. When below both, bearish. Crossovers between the two stops signal potential reversals.
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# FRACTALS: Williams Fractals
> *Markets leave fingerprints at their turning points. Five bars is all it takes to read them.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Markets leave fingerprints at their turning points. Five bars is all it takes to read them."
Williams Fractals detect local price extremes using a strict five-bar pattern: an Up Fractal marks a bar whose high exceeds the highs of the two bars before and after it; a Down Fractal marks a bar whose low undercuts the lows of the two bars before and after it. No parameters, no smoothing, no lag compensation. The pattern either exists or it does not. Developed by Bill Williams and published in *Trading Chaos* (1995).
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# PIVOT: Classic Pivot Points (Floor Trader Pivots)
> *The floor traders had it figured out before the quants arrived. Three numbers from yesterday's bar, seven levels for today. No optimization, no curve fitting, no excuses.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The floor traders had it figured out before the quants arrived. Three numbers from yesterday's bar, seven levels for today. No optimization, no curve fitting, no excuses."
Classic Pivot Points calculate seven horizontal support and resistance levels from the previous bar's high, low, and close. The central pivot point (PP) is the arithmetic mean of HLC; three resistance levels (R1-R3) and three support levels (S1-S3) are derived from PP and the prior bar's range. The formula has been in continuous use since the 1930s among floor traders at commodity exchanges. Zero parameters, zero lag, zero ambiguity.
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# PIVOTCAM: Camarilla Pivot Points
> *The Camarilla trader does not care where the market opens. The trader cares how far price strays from yesterday's close, and whether it returns.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The Camarilla trader does not care where the market opens. The trader cares how far price strays from yesterday's close, and whether it returns."
Camarilla Pivot Points calculate nine horizontal support and resistance levels from the previous bar's high, low, and close. Unlike classic floor trader pivots that radiate from the PP midpoint, Camarilla levels radiate symmetrically from the previous close using fixed fractions of the prior range. The R3/S3 levels serve as the primary mean-reversion zone; breakouts beyond R4/S4 signal trend continuation. Developed by Nick Scott in 1989 using bond market data, the equation was originally distributed as a shareware Excel plugin.
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# PIVOTDEM: DeMark Pivot Points
> *Most pivot formulas treat every bar the same. DeMark looked at the open-close relationship and asked: why would a bearish bar predict the same levels as a bullish one?*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Most pivot formulas treat every bar the same. DeMark looked at the open-close relationship and asked: why would a bearish bar predict the same levels as a bullish one?"
DeMark Pivot Points calculate three horizontal support and resistance levels from the previous bar's open, high, low, and close. The defining characteristic is a conditional intermediate value X that changes its weighting depending on whether the prior bar closed below, above, or equal to its open. Bearish bars weight the low; bullish bars weight the high; doji bars weight the close. Three levels (PP, R1, S1) emerge from this single conditional calculation. The only pivot variant that uses the open price.
## Historical Context
+2 -2
View File
@@ -1,5 +1,7 @@
# PIVOTEXT: Extended Traditional Pivot Points
> *Classic pivots tell you where the crowd expects the market to pause. Extended pivots tell you where the crowd starts to panic.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "Classic pivots tell you where the crowd expects the market to pause. Extended pivots tell you where the crowd starts to panic."
Extended Traditional Pivot Points calculate eleven horizontal support and resistance levels from the previous bar's high, low, and close. The core levels (PP, R1-R3, S1-S3) are identical to classic floor trader pivots. The extension adds R4/R5 and S4/S5 levels that project further beyond the prior bar's range, covering extreme move scenarios such as gap opens, news-driven spikes, and trend continuation through multiple prior-range increments. The formula is pure arithmetic with zero parameters.
## Historical Context
+2
View File
@@ -1,5 +1,7 @@
# PIVOTFIB: Fibonacci Pivot Points
> *Fibonacci pivots project support and resistance from the golden ratio, blending numerology with price structure.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
+2
View File
@@ -1,5 +1,7 @@
# PIVOTWOOD: Woodie's Pivot Points
> *Woodie's pivots weight the close twice, tilting the pivot toward where the session actually settled.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
+2 -2
View File
@@ -1,5 +1,7 @@
# PSAR: Parabolic Stop And Reverse
> *The trend is your friend until the end when it bends.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The trend is your friend until the end when it bends." — Ed Seykota
## Introduction
The Parabolic Stop And Reverse (PSAR) is a trend-following overlay indicator created by J. Welles Wilder Jr. in 1978. It produces a trailing stop level that accelerates toward price as the trend extends, then flips to the opposite side when price crosses the stop. The acceleration mechanism is the key differentiator: SAR starts slow and tightens progressively, creating the characteristic parabolic curve that gives the indicator its name. Default parameters (0.02 start, 0.02 increment, 0.20 maximum) produce approximately 1030 reversals per 500 bars on typical equity data.
+2 -2
View File
@@ -1,5 +1,7 @@
# SAREXT: Parabolic SAR Extended
> *The trend is your friend — but which way it accelerates depends on whether you're long or short.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -17,8 +19,6 @@
- Requires `2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib reference implementation.
> "The trend is your friend — but which way it accelerates depends on whether you're long or short." — QuanTAlib
## Introduction
The Parabolic SAR Extended (SAREXT) is an enhanced version of Wilder's Parabolic Stop And Reverse that allows **separate acceleration factor configurations for long and short positions**. While standard PSAR uses the same AF start, increment, and maximum for both trend directions, SAREXT provides six independent AF parameters (three for long, three for short), plus a `startValue` to force initial direction and `offsetOnReverse` to add a gap buffer when the indicator reverses.
+2 -2
View File
@@ -1,5 +1,7 @@
# SWINGS: Swing High/Low Detection
> *The market tells you where it turned. You just have to listen long enough to be sure it actually meant it.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |
@@ -16,8 +18,6 @@
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The market tells you where it turned. You just have to listen long enough to be sure it actually meant it."
Swing High/Low detection identifies local price extremes using a configurable lookback window. A Swing High marks a bar whose high strictly exceeds the highs of all bars within the lookback window on each side. A Swing Low marks a bar whose low is strictly less than all corresponding lows. The lookback parameter controls sensitivity: larger lookback windows require more confirmation and produce fewer, more significant signals. This generalizes Williams' fixed five-bar Fractals into a flexible structural analysis tool.
## Historical Context
+2
View File
@@ -1,5 +1,7 @@
# TTM_SCALPER: TTM Scalper Alert
> *TTM Scalper spots pivot reversals in real time, marking the bars where short-term direction flips.*
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Reversal |