A Simple Moving Average calculator: Creating a Simple Moving Average calculator in C# - Part 1

added by DotNetKicks
5/4/2021 10:39:19 AM


In this post I describe the Simple Moving Average, show a common optimisation for calculating it, and show a C# implementation. Finally I use Spectre.Console to allow calling the calculator, passing in the values and the window size k. In subsequent posts I'll expand on this implementation to add extra features and make it thread-safe.