mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 02: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:
+2
-25
@@ -1,5 +1,7 @@
|
||||
# CG: Ehlers Center of Gravity
|
||||
|
||||
> *Center of Gravity locates the balance point of price over a window, anticipating turns before they arrive.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Cycle |
|
||||
@@ -54,31 +56,6 @@ Streaming uses running sums for both numerator and denominator: $O(1)$ per bar w
|
||||
|-----------|-------------|---------|------------|
|
||||
| `period` | Lookback window length | 10 | $> 0$ |
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
function CG(source, period):
|
||||
buffer ← RingBuffer(period)
|
||||
runNum ← 0 // weighted sum
|
||||
runDen ← 0 // simple sum
|
||||
|
||||
for each price in source:
|
||||
buffer.Add(price)
|
||||
if buffer.Count < period: continue
|
||||
|
||||
// Compute from buffer (or maintain running sums)
|
||||
num = 0
|
||||
den = 0
|
||||
for i = 0 to period-1:
|
||||
w = i + 1
|
||||
num += w * buffer[i]
|
||||
den += buffer[i]
|
||||
|
||||
cg = (den ≠ 0) ? (num / den) - (period + 1) / 2.0 : 0
|
||||
|
||||
emit cg
|
||||
```
|
||||
|
||||
### Output Interpretation
|
||||
|
||||
| Condition | Meaning |
|
||||
|
||||
Reference in New Issue
Block a user