xx = FactorA * Close + (FactorB * PREV(xx)); //
metastock
translates to:
xx = AMA2( Close, FactorA, FactorB );
-----Original Message----- From: Ed Hoopes
[mailto:reefbreak_sd@xxxxxxxxx] Sent: Friday, March 11, 2005 2:33
PM To: amibroker@xxxxxxxxxxxxxxx Subject: [amibroker] Self
Referencing Formula
Group,
I would like
to see some working code for a Self Referencing Formula. That is where the
previous value of the indicator is used in calculating the new value of the
indicator. Ref() doesn't automatically initialize itself - like
MetaStock does.
The problem is with how to initialize the array.
The pseudo-code might look like:
Start: On the first bar set Arg
= Close;
On the next pass, do some math and calculate
"Factor(Arg)"