calc_moving_average function

Calculate Moving Average