´window 20;´ gives you a moving average over the last 20 seconds, is that what you want ?
However I am not sure with the syntax whether its active when it is not defined withing the brackets for e.g. the U-field ( so together with prime2Mean etc)
Otherwise I think this should be good if you want to include every time step in the averaging.