31 private readonly
int _scale = 10000;
32 private decimal _previousHighMaximum;
33 private decimal _previousLowMinimum;
38 public override bool IsReady => _sma.IsReady;
51 : this($
"EMV({period}, {scale})", period, scale)
74 if (_previousHighMaximum == 0 && _previousLowMinimum == 0)
76 _previousHighMaximum = input.
High;
77 _previousLowMinimum = input.
Low;
82 _sma.Update(input.
Time, 0);
83 return _sma.Current.Value;
86 var midValue = ((input.
High + input.
Low) / 2) - ((_previousHighMaximum + _previousLowMinimum) / 2);
87 var midRatio = ((input.
Volume / _scale) / (input.
High - input.
Low));
89 _previousHighMaximum = input.
High;
90 _previousLowMinimum = input.
Low;
92 _sma.Update(input.
Time, midValue / midRatio);
94 return _sma.Current.Value;
103 _previousHighMaximum = 0.0m;
104 _previousLowMinimum = 0.0m;