Hi,
Does anyone provide the code for the adaptive moving average indicator available in the PRT predefined indicators list.
Many thanks in advance.
Tariq
Here is the code of the adaptive moving average of ProRealTime. It is the same as a KAMA (Kaufman’s Adaptive Moving Average):
// parameters :
Period = 9
FastPeriod = 2
SlowPeriod = 30
Fastest = 2 / (FastPeriod + 1)
Slowest = 2 / (SlowPeriod + 1)
if barindex < Period+1 then
Kama=close
else
Num = abs(close-close[Period])
Den = summation[Period](abs(close-close[1]))
ER = Num / Den
Alpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)
KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])
endif
return kama
Kaufman Adaptive Moving Average KAMA
Nicolas than you very much for this.
Kind regards,
Tariq