40 private decimal _lastHigh;
41 private decimal _lastLow;
49 : this($
"DEM({period},{type})", period, type)
65 _maxMA = type.AsIndicator(period);
66 _minMA = type.AsIndicator(period);
72 public override bool IsReady => _maxMA.IsReady && _minMA.IsReady;
104 deMax = Math.Max(input.
High - _lastHigh, 0);
105 deMin = Math.Max(_lastLow - input.
Low, 0);
108 _maxMA.Update(input.
Time, deMax);
109 _minMA.Update(input.
Time, deMin);
110 _lastHigh = input.
High;
111 _lastLow = input.
Low;
118 var currentValue = _maxMA + _minMA;
119 return currentValue > 0m ? _maxMA / currentValue : 0m;