PureBytes Links
Trading Reference Links
|
this gives you something to work on
EMA is defined as follows
f = 2/(range + 1)
ema[i] = f * price[i] + ema[i -1] - f*ema[i
-1);
now if we substitue ema1current as ema[i], ema1previous
as ema[i -1], and sf1 as f and close as price, we get
ema[i] = ema[i -1] + f * (price[i] - ema[i
-1]);
now the formula you basically posted is
ema1 = ema(c, range1) where sf1 = 2/(range1 +
1);
ema2 = ema(c, range2);
macd = ema1 - ema2;
signal = ema(macd, range3);
So your formula is basically the ema version of
macd;
cheers
I need a drink now.
It still does not work.
These are the settings :
fast= .108, slow = .213, average = .199
Formula:
EMA1current =
EMA1previous + SF1 ( Close - EMA1previous ) EMA2current = EMA2previous + SF2
( Close - EMA2previous ) MACDcurrent = EMA1current - EMA2current Signal
Line = MACD previous + SLSF ( MACDcurrent - MACDprevious )
SF=2/(N+1)
//Dinapoli MACD FastLength =
Param("FastLength",8,0,36,2); SlowLength =
Param("SlowLength",17,0,52,2); MACMA =
Param("MACMA",9,0,15,1);
SmoothingFactor1 = 2 / ( fastlength + 1 )
; SmoothingFactor2 = 2 / ( slowlength + 1 ) ; SmoothingFactor3 = 2 / (
MACMA + 1 ) ;
EMA1 = AMA (Close,fastlength) ; EMAfast = EMA1 + (
SmoothingFactor1 * (Close-EMA1) ) ;
EMA2 = AMA (Close,slowlength)
; EMAslow = EMA2 + ( SmoothingFactor2 * (Close - EMA2) ) ;
MACD1 =
EMAfast-EMAslow ;
Plot( MACD1, StrFormat(_SECTION_NAME()+"(%g,%g)",
fastlength,slowlength), ParamColor("MACD color", colorRed ), ParamStyle("MACD
style") );
On 3/28/06, Terry
<MagicTH@xxxxxxxxxxx>
wrote:
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
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
YAHOO! GROUPS LINKS
|