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

Re: McGinley Dynamics



PureBytes Links

Trading Reference Links

Yeah, I wondered about the parentheses. While I was at it, I removed the
unnecessary one inside the power function.

MD = MD[1] + (c - MD[1]) / (K * period * power(c / MD[1], 4))

The logic of this still looks screwy to me. Looks like it's trying to be
an adaptive moving average but it's asymmetric. It moves slow when the
market's going up and fast when it's going down. I don't have Kaufman
handy so I'll make a leap of faith and assume it's trying to move fast
when the market moves fast and slow when it's choppy. While I'm at it,
I'll lose one of the redundant inputs and make it so it works (sorta)
with positive/negative data series....

{Dennis's Dynamics: DH 2002}
{unverified and untested}

input: price(close), smooth(6);
var: dd(price), delta(0), denom(1), factor(1);

if smooth > 1 then begin
  delta = price - dd[1];
  if price <> 0 then
    denom = smooth * power(1 - absvalue(delta)/price, 4)
  else
    denom = smooth;
  if denom > 1 then 
    factor = 1 / denom;
  dd = dd[1] + delta * factor;
end else 
  dd = price;

plot1(dd, "DD");

-- 
  Dennis