EMA requires bars (or days) as integers.
You are using a formula that converts number of bars (as integers) into a
fractional smoothing factor. This smoothing factor works with AMA and should be
between 0 and 1.00. Change your two EMA() to AMA() and your Param statements must
use integers if you're going to use smoothing. The param statement should be
something like this:
FastLength = Param("FastLength",8,2,200,1);
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tony Lei
Sent: Tuesday, March 28, 2006
13:22
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Dinapoli MACD
There is something wrong with this formula and I can't
figure it out.
FastLength =
Param("FastLength",.213,0,36,2);
SlowLength =
Param("SlowLength",.108,0,52,2);
MACMA = Param("MACMA",.199,0,15,1);
SmoothingFactor1 = 2 / ( fastlength + 1 ) ;
SmoothingFactor2 = 2 / ( slowlength + 1 ) ;
SmoothingFactor3 = 2 / ( MACMA + 1 ) ;
EMA1 = EMA (Close, fastlength) ;
EMAfast = EMA1 + ( SmoothingFactor1 * (Close-EMA1)
) ;
EMA2 = EMA (Close, slowlength );
EMAslow = EMA2 + ( SmoothingFactor2 * (Close -
EMA2) ) ;
MACD1 = EMAfast-EMAslow ;
Plot (MACD1, "", 5, 4 ) ;
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS