Given a list of timestamps and stock prices, write a function to calculate the moving average over a sliding window.