Two key features of moving averages are smoothness and responsiveness. Unfortunately those are conflicting requirements. EMA is more responsive than SMA, but less smooth. HMA (Hull MA) is even faster, but even less smooth and also has the problem of overshooting.
Below you can find the implementation of the Arnaud Legoux Moving Average aka ALMA. It is inspired by the Gaussian Filters, and has even better characteristics than HMA, because it has no overshoot and reacts faster at the most important moments, when trend is about to change. You can see this characteristics easily on the attached chart that compares these 4 popular MA's. If MA's are part of your trading strategies, I hope you'll be pleasanty surprised with ALMA.
jcl, it would be nice to see ALMA included in the next Zorro version. You have my permission to include it, and remove copyright notices so as not to clutter the includes (if it ends there). Just a few remarks:
- values 6 & 0.85 for sigma and offset parameters respectively, are recommended by the original ALMA inventor and work well, IMHO. It would be nice if those parameters could be optional and then if not provided by the scripts writer, that those defaults are used. If you know how to program it, I'm not yet at that stage.

- weight factors are recalculated on every bar, although they're the same for every function call (if parameters stay the same). I guess if more performant ALMA is desired in the future, that could be done, but the source wouldn't be so clean and short. And Zorro is plenty fast, anyway, right?

- put somewhere in the documentation that the Period should be an odd number for the best results
- I wouldn't mind code inspection and commentary, 'cause I'm still learning programming in Lite-C & Zorro

#define CYAN 0x00FFFF
// ALMA, Arnaud Legoux Moving Average for Zorro Trader
// © 2013 acidburn @ Zorro Trader Forum
// v1.0 - 2013-06-24 - initial release
var ALMA(var *Data, int Period, int sigma, var offset)
{
var m = floor(offset * (Period - 1));
var s = Period / sigma;
var alma, wSum;
int i;
for (i = 0; i < Period; i++) {
var w = exp(-((i - m) * (i - m)) / (2 * s * s));
alma += Data[Period - 1 - i] * w;
wSum += w;
}
return alma / wSum;
}
// compare various moving averages
function run()
{
set(PLOTNOW|PLOTPRICE);
StartDate = 20130101;
EndDate = 20130615;
BarPeriod = 1440;
LookBack = 100;
vars Close = series(priceClose());
vars MA0 = series(SMA(Close, 21));
vars MA1 = series(EMA(Close, 21));
vars MA2 = series(HMA(Close, 21));
vars MA3 = series(ALMA(Close, 21, 6, 0.85));
plot("SMA21", MA0[0], 0, RED);
plot("EMA21", MA1[0], 0, GREEN);
plot("HMA21", MA2[0], 0, BLUE);
plot("ALMA21", MA3[0], 0, CYAN);
}
Original documentation:
http://www.perltrader.com/zorro/ALMA-Arnaud-Legoux-Moving-Average.pdf