calculateVolumeMA method

void calculateVolumeMA()

Implementation

void calculateVolumeMA() {
  for (int len = values.length; _i < len; _i++) {
    AceEntity item = values[_i];

    _volma5 += item.volume;
    _volma10 += item.volume;

    if (_i == 4) {
      item.ma5Volume = (_volma5 / 5);
    } else if (_i > 4) {
      _volma5 -= values[_i - 5].volume;
      item.ma5Volume = _volma5 / 5;
    } else {
      item.ma5Volume = 0;
    }

    if (_i == 9) {
      item.ma10Volume = _volma10 / 10;
    } else if (_i > 9) {
      _volma10 -= values[_i - 10].volume;
      item.ma10Volume = _volma10 / 10;
    } else {
      item.ma10Volume = 0;
    }
  }
}