PureBytes Links
Trading Reference Links
|
Dear Anthony,
>How can this be if I coded incorrectly.
The difference may be so small visually that you
just can't see it.
With certain parameters sets you would need to
compare the numbers to
see the difference.
BTW: Dimitris obviously understood you farbetter
than I, as he
correctly guessed that you want to get an EMA
from EMA :-)
EMA.PREV - formulas using MS' PREV could be
rewritten in AFL
using JScript as shown in the
<A
href="">http://www.amibroker.com/docs/ab400.html
Best regards,
Tomasz Janeczko
amibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Anthony Faragasso
To: <A
href=""
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
Sent: Monday, November 12, 2001 2:21
PM
Subject: Re: [amibroker] Re: Slow
Stochastic moving buy-sell levels
Hi tomasz;
Thank you, As You and Dimitri have given me valuable
information on this subject. I have discontinued my journey into this
subject.....for the moment.
after producing; graph0=ema(c,10);
graph1=ema(ema(c,10),10);
and comparing the values returned by the code above ,with the values of My
Custom EMA with Decay , I found them to be the same, How can this be if I
coded incorrectly.
One of my original questions was how to initialize the EMA.PREV statement,
when the code starts with the close.
Anyway, Thank you Tomasz;
Anthony
Tomasz Janeczko wrote:
Dear
Anthony, The reason is
that you are using Ref( array, -1 ) for PREV.<FONT
face=Arial>This is not correct. <FONT
face=Arial>Ref() works via shifting the array
back/forwards.You can not use
it for self-referencing formulas like EMA is. <FONT
face=Arial>Therefore your formula does not calculate correct
EMA and this is thereason for
the difference. MS's PREV
works in such a way that the formula is re-evaluated<FONT
face=Arial>as many times as the number of bars loaded. This
leads to extremely long<FONT
size=-1>execution times. <FONT
size=-1>Best regards,Tomasz
Janeczko<FONT
size=-1>amibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Anthony
Faragasso
To: <A
href=""
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
Sent: Monday, November 12, 2001 1:15
PM
Subject: Re: [amibroker] Re: Slow
Stochastic moving buy-sell levels Tomasz;
See the Attached Image, There seems to be some Difference, that iswhy
I questioned. When I placed the formula under your explanation, they
appear to be the same.
This is an 8 period EMA of the Close. graph0=EMA(c,8);
ema_today = factor * close + ( 1
- factor ) * ema_yesterday.
value1 =(Smooth*Close)+(Decay*EMA.PREV)
after you find value from above code, do you then continue
with... graph0=EMA(value1,8); Possibly that is why
there is a difference in custom EMA and Ami EMA. Because I continued with
the above.
Also, I know there was Discussion , but how do I satisfy the( EMA.Prev)
|