mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 03: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 @@
|
||||
# AVGPRICE: Average Price
|
||||
|
||||
> *The four-point average distills an entire bar into a single representative price — open, high, low, and close in equal measure.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Core |
|
||||
@@ -62,22 +64,6 @@ $O(1)$ per bar. Two additions, one FMA. No memory allocation. Always hot after t
|
||||
| Typical Price | $(H+L+C) \times \frac{1}{3}$ | `HLC3` | `Typprice` |
|
||||
| Weighted Close | $(H+L+2C) \times 0.25$ | `HLCC4` | `Wclprice` |
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
function AVGPRICE(bar):
|
||||
o, h, l, c ← bar.Open, bar.High, bar.Low, bar.Close
|
||||
|
||||
// Substitute last-valid for non-finite inputs
|
||||
if !finite(o): o ← lastValidOpen
|
||||
if !finite(h): h ← lastValidHigh
|
||||
if !finite(l): l ← lastValidLow
|
||||
if !finite(c): c ← lastValidClose
|
||||
|
||||
result ← FMA(o + h, 0.25, (l + c) × 0.25)
|
||||
return result
|
||||
```
|
||||
|
||||
### Output Interpretation
|
||||
|
||||
| Context | Meaning |
|
||||
|
||||
Reference in New Issue
Block a user