ZMA has no effect

Posted By: GPEngine

ZMA has no effect - 07/26/14 20:41

It appears to be nearly the identity function.
The code that is executed is not what is in indicators.c. I know because I gutted that function and re-compiled, and there was no effect.
Proof:
Code:
function run() {
  set(PLOTNOW);
  vars R = series(random());
  vars Z = series(ZMA(R, 1000));
  vars Diff = series(abs(Z[0] - R[0]));
  if (Diff[0] > 0.00000001) {
    quit();
  }
  PlotHeight1 = 100;
  plot("Diff", Diff, LINE+NEW, RED);
}

Posted By: GPEngine

Re: ZMA has no effect - 07/26/14 20:43

I meant to say ZMA behaves as if it were defined as
Code:
var ZMA(vars Data, int unused_Period) {
  return Data[0];
}

Posted By: jcl

Re: ZMA has no effect - 07/28/14 07:18

Thanks for the info - and yes, I see a big and obvious bug in the ZMA code in indicators.c. Can you see it too? This will be fixed in the next update.
Posted By: GPEngine

Re: ZMA has no effect - 07/28/14 15:07

The first line.
Posted By: jcl

Re: ZMA has no effect - 07/29/14 07:53

Yes.
© 2024 lite-C Forums