This command line application finds the moving average up to a targeted window of an inputted array of double variables.
The sample data that you provided is what I used to test with.
Input: 0, 1, -2, 3, -4, 5, -6, 7, -8, Output: 0, 0.5, -0.333333333333333, 0.5, -0.4, 0.6, -0.8, 1, 1.2, 1.4
Note: Anything with a comment to a url is the link that I referenced to complete the code that is next to it.