50 : this($
"APS({period})", period)
63 throw new ArgumentException(
"AugenPriceSpike Indicator must have a period of at least 3", nameof(period));
73 public override bool IsReady => _rollingData.IsReady && _standardDeviation.IsReady;
87 _rollingData.Add(input.
Value);
88 if (_rollingData.Count < 3) {
return 0m; }
90 var previousPoint = _rollingData[1];
91 var previousPoint2 = _rollingData[2];
94 if (previousPoint2 != 0)
96 logPoint = Math.Log((
double)(previousPoint / previousPoint2));
99 _standardDeviation.Update(input.
Time, (decimal)logPoint);
101 if (!_rollingData.IsReady) {
return 0m; }
102 if (!_standardDeviation.IsReady) {
return 0m; }
104 var m = _standardDeviation.Current.Value * previousPoint;
105 if (m == 0) {
return 0; }
107 var spikeValue = (input.
Value - previousPoint) / m;
116 _standardDeviation.Reset();
117 _rollingData.Reset();