Looking at the code:
% compute general moving average (ie simple, linear, etc) % build weighting vectors i = 1:lag; wa(i) = (lag - i + 1).^alpha./sum([1:lag].^alpha); i = 1:lead; wb(i) = (lead - i + 1) .^alpha/sum([1:lead].^alpha); % build moving average vectors by filtering asset through weights a = filter(wa,1,asset); b = filter(wb,1,asset);
If you call:
[Short,Long]= movavg(A,20,20,1);
You get exaclty the same averages, I guess they tried to give emphasis to the fact that one is long run and the other is short run.
Anyway, the movavg implements the weighted moving average (linear and exponential):
Linear weights
Exponential weights
Oleg