calculate method

  1. @override
T calculate(
  1. int index
)
override

Calculates the value of this indicator for the given index without caching it.

Returns the result as a T.

Implementation

@override
T calculate(int index) {
  final double highestHighQuote = _highestValueIndicator
      .getValue(index)
      .quote;
  final double lowestLowQuote = _lowestValueIndicator.getValue(index).quote;

  final double kPercent =
      ((_indicator.getValue(index).quote - lowestLowQuote) /
          (highestHighQuote - lowestLowQuote)) *
      100;

  return createResult(index: index, quote: kPercent);
}