[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kaufman MA



PureBytes Links

Trading Reference Links

That's an interesting piece of code but it's not Kaufman's adaptive
moving average. The ones posted earlier are correct.

-- 
  Dennis

> {KMA Moving Average User Function}
>  
> {period= length of moving average
> filter= whole %trendchange to givesignal
> lag = 0to enter on close,ntoenter n-periods later}
>   
> input:period(numericsimple), filter(numeric), lag(numericsimple);
> vars:ma(0), change(0), signal(0);
> 
> signal = signal[1];
> ma = average(close, period);
> change =(ma - ma[1]) *100/close[1];
> 
> if lag>=0 and change[lag]>filter then signal = 1;
> if lag>=0 and change[lag]< -filter then signal = -1;
> 
> Kaufman_MA = signal;