The moving average (MOV) is calculated using a moving window. The mean is calculated for each window of data according to the equation:
MOV - Moving Average
S - Window Length (Points)
f(s) - Data within the Window
The In the script, this calculation is performed by iterating through the data with windows and using the built in function .mean() on each window.
More: