43 public override bool IsReady => _MACD.IsReady;
59 : this($
"SchaffTrendCycle({cyclePeriod},{fastPeriod},{slowPeriod})", cyclePeriod, fastPeriod, slowPeriod, type)
76 _maximum = _MACD.MAX(cyclePeriod,
false);
77 _minimum = _MACD.MIN(cyclePeriod,
false);
81 _D = type.AsIndicator(3).Of(_K,
false);
82 _maximumD = _D.MAX(cyclePeriod,
false);
83 _minimumD = _D.MIN(cyclePeriod,
false);
87 _PFF = type.AsIndicator(3).Of(_PF,
false);
103 var MACD_K =
new IndicatorDataPoint(input.
Time, ComputeStoch(_MACD.Current.Value, _maximum.Current.Value, _minimum.Current.Value));
107 var PF =
new IndicatorDataPoint(input.
Time, ComputeStoch(_D.Current.Value, _maximumD.Current.Value, _minimumD.Current.Value));
110 return _PFF.Current.Value;
120 private decimal ComputeStoch(decimal value, decimal highest, decimal lowest)
122 var numerator = value - lowest;
123 var denominator = highest - lowest;
125 return denominator > 0 ? (numerator / denominator) * 100 : decimal.Zero;