[R-SIG-Finance] quantmod EMA and SMA

Joshua Ulrich josh.m.ulrich at gmail.com
Mon Mar 9 15:04:53 CET 2015


On Mon, Mar 9, 2015 at 8:14 AM, Olivier MARTIN
<Olivier.Martin at avignon.inra.fr> wrote:
> Hi all,
>
> I compare the serie from the function EMA() and the one from addEMA()
>
>   getSymbols("^FCHI")
> M7=EMA(Cl(FCHI),7)
> candleChart(FCHI,theme="white",subset="2015",TA=NULL)
> addEMA(7)
> addTA(M7,on=-1)
>
> I don't understant why I don't obtain the same serie with the two
> functions...

M7 is calculated using the close price.  You didn't specify which
column to use in the addEMA call, so it used the first column--the
open.

> Reagrds,
> Olivier.
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com



More information about the R-SIG-Finance mailing list