29 private readonly
int _period;
31 private readonly
Sum _atrSum;
32 private readonly
Sum _plusVMSum;
33 private readonly
Sum _minusVMSum;
49 public override bool IsReady => Samples >= _period;
61 : this($
"VTX({period})", period)
70 public Vortex(
string name,
int period)
75 _atrSum =
new Sum(
"ATR_Sum", period).Of(_atr);
76 _plusVMSum =
new Sum(
"PlusVM_Sum", period);
77 _minusVMSum =
new Sum(
"MinusVM_Sum", period);
92 if (_previousInput !=
null)
94 var plusVMValue = Math.Abs(input.
High - _previousInput.
Low);
95 var minusVMValue = Math.Abs(input.
Low - _previousInput.
High);
97 _plusVMSum.Update(input.
Time, plusVMValue);
98 _minusVMSum.Update(input.
Time, minusVMValue);
101 _previousInput = input;
123 _previousInput =
null;