A library for the calculation of moving averages.

Usage

A simple usage example:

import 'package:moving_average/moving_average.dart';

main() {
  final values = [1, 2, 3, 4, 5];
  print("Values = $values");
  // Values = [1, 2, 3, 4, 5]

  final movingAverage3 = movingAverage(values, 3, includePartial: true);
  print("Moving Average, size 3, partial = $movingAverage3");
  // Moving Average, size 3, partial = [1.0, 1.5, 2.0, 3.0, 4.0]

  final weightedAverage3 = weightedMovingAverage(values, 3);
  print("Weighted Moving Average, size 3 = $weightedAverage3");
  // Weighted Moving Average, size 3 = [2.3333333333333335, 3.3333333333333335, 4.333333333333333]
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Libraries

moving_average
Support for doing something awesome. [...]