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 tickSize = entries[index].high - entries[index].low;

  final double highMinusClose =
      index == 0 ? 0 : entries[index].high - entries[index - 1].close;
  final double closeMinusLow =
      index == 0 ? 0 : entries[index - 1].close - entries[index].low;

  return createResult(
    index: index,
    quote: max(
      tickSize.abs(),
      max(
        highMinusClose.abs(),
        closeMinusLow.abs(),
      ),
    ),
  );
}