Moving averages, summation
|SYNTAX||ama2( ARRAY, SMOOTHINGFACTOR, FEEDBACKFACTOR )|
calculates adaptive moving average - simliar to EMA() but smoothing factor
could be time-variant (array).
AMA2 has a separate control of feedbackfactor which is normally (1-SMOOTHINGGFACTOR). Internally this function works like this: today_ama = SMOOTHINGFACTOR * array + FEEDBACKFACTOR * yesterday_ama
The example of volatility-weighted adaptive moving average formula:
graph0 = ema( close, 15 );
fast = 2/(2+1);
slow = 2/(30+1);
sc =( ER*(fast-slow)+slow)^2; graph0 = ama2( close, sc, 1-sc);
The AMA2 function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.