[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GT] Re: Re: Re: Re: Re: Re: EMA incorrect when using --nb-item



As discussed, EMA approximates the starting value by using SMA (or any
other measure given as third argument).

Note that the current definition of EMA takes the first point of the
interval as the starting value, meaning that the first point in the
interval is calculated by SMA.

One could argue that for a N-day EMA, the starting value should be the
first point of the interval - N, so that the first point in the interval
would be a fully calculated EMA.

I am attaching a modification of EMA that does this.

Note that

    display_indicator.pl --nb-item=1 I:EMA2 <Market> M
is the same as the value of
    display_indicator.pl --nb-item=M+1 I:EMA2 <Market> M

by definition.

Maybe you will find this interpretation of EMA more intuitive?

Th.

On 07/23/2010 12:19 AM, Thomas Weigert wrote:
>
> As you can see, it settles down eventually. But the key to understand
> here is that EMA will give you a different value depending on the number
> of data items you examine. That is why I don't like to use EMA, unless I
> look at at least 5 years of data. At a minimum, you should use at least
> as much data as the period of the EMA.
>
>