Hello,
im trying to calculate the AMA but iam not quite sure if i understand the calculation correctly yet. Till now i have calculated SMA, WMA and EMA and wanted to have the AMA too because i think its nice to find out if the market is doing a rallye, crash or is simply movind sidewards..
I tried to understand the calculation from here: http://user42.tuxfamily.org/chart/manual/Kaufman-Adaptive-Moving-Average.html#Kaufman-Adaptive-Moving-Average
Besides... the JMA was praised here in the forum as the best AMA... while on another site i found that its only calculated over a shorter period of time and therefore its more near at the actual price. Is that correct? So is the JMA only a AMA with less previous prices taken into account so that a smaller AMA will show the same results than the JMA?
Anyway... i understand it so that when calculating an EMA for 10 days closing price i would create a AMA for these 10 days too.
abs (close[today] - close[N days ago])
ER = --------------------------------------
Sum abs (close - close[prev])
past N days
So first you have to create the Efficiency ratio. Its the closing price of today minus the closing price before N days, in this case 10. Then take abs from the result which means cutting a possibly negative minus.
Then divide this through the sum of all past 10 days closing prices including the actual one. Multiplied(?) with the abs of actual closeprice minus closeprice of day before.
Then you have the ER.
Then calculate alpha with the calculated ER:
alpha = (ER * 0.6015 + 0.0645) ^ 2
But i dont see where these numbers are from. Are they hardcoded?
The next step is to calc:
KAMA = alpha * close + (1-alpha) * KAMA[prev]
Which means you need the actual closeprice again and the previous KAMA. If you dont have a previous kama do you use simply the SMA or the mentioned EMA for the actual day and start the next day calculating the KAMA? Similar you do it for an EMA?
You see im not quite sure how its calculated. The other MA had better and more explainations. Though they were easier to understand too.
Someone can help me here?
Thanks!