mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 18:18:04 +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 @@
|
||||
# MAENV: Moving Average Envelope
|
||||
|
||||
> *A fixed percentage above and below a moving average — the simplest envelope assumes symmetry in price behavior.*
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Channel |
|
||||
@@ -71,25 +73,6 @@ $O(1)$ for SMA and EMA modes. $O(n)$ for WMA mode due to the weighted sum.
|
||||
| `ma_type` | Moving average type: 0=SMA, 1=EMA, 2=WMA | 1 (EMA) | $\{0, 1, 2\}$ |
|
||||
| `source` | Input price series | close | |
|
||||
|
||||
### Pseudo-code
|
||||
|
||||
```
|
||||
function MAENV(source, period, percentage, ma_type):
|
||||
validate: period > 0, percentage > 0
|
||||
|
||||
// Compute center line based on MA type
|
||||
if ma_type == 0: middle = SMA(source, period)
|
||||
if ma_type == 1: middle = EMA(source, period) // with warmup
|
||||
if ma_type == 2: middle = WMA(source, period)
|
||||
|
||||
// Fixed percentage offset
|
||||
dist = middle * percentage / 100
|
||||
upper = middle + dist
|
||||
lower = middle - dist
|
||||
|
||||
return [middle, upper, lower]
|
||||
```
|
||||
|
||||
### Output Interpretation
|
||||
|
||||
| Output | Description |
|
||||
|
||||
Reference in New Issue
Block a user