Skip to content

WG: quantmod addTA() How to scale the y axis

1 message · Konrad Hoppe

#
Hello Vince,

The whole code on that is the following:

install.packages("quantmod")
library(quantmod)

from.dat <- as.Date("01/01/03", format="%m/%d/%y")
to.dat <- as.Date(Sys.Date(), format="%m/%d/%y")

getSymbols("BOS3.DE", src="yahoo", from = from.dat, to = to.dat)
BOS3.DE <- adjustOHLC(BOS3.DE)
chartSeries(BOS3.DE,theme="white",TA="addSMA(200)", yrange=c(5,50))


regards
Konrad


-----Urspr?ngliche Nachricht-----
Von: R. Vince [mailto:rvince99 at hotmail.com] 
Gesendet: Samstag, 28. November 2009 15:59
An: Konrad Hoppe; 'Joshua Ulrich'
Cc: r-sig-finance at stat.math.ethz.ch
Betreff: Re: [R-SIG-Finance] WG: quantmod addTA() How to scale the y axis

Konrad,

Can you share your completed code on this with all? Thanks, R. Vince

----- Original Message ----- 
From: "Konrad Hoppe" <konradhoppe at hotmail.de>
To: "'Joshua Ulrich'" <josh.m.ulrich at gmail.com>
Cc: <r-sig-finance at stat.math.ethz.ch>
Sent: Saturday, November 28, 2009 9:36 AM
Subject: Re: [R-SIG-Finance] WG: quantmod addTA() How to scale the y axis


Thank you very much. I haven't seen that point, because I was unsure what
the method plots.
And the 'addSMA' is a good hint because as I told you I'm new to the package
and actually don't know its whole functionality.

Regards
Konrad

-----Urspr?ngliche Nachricht-----
Von: Joshua Ulrich [mailto:josh.m.ulrich at gmail.com]
Gesendet: Samstag, 28. November 2009 15:28
An: Konrad Hoppe
Cc: r-sig-finance at stat.math.ethz.ch
Betreff: Re: [R-SIG-Finance] WG: quantmod addTA() How to scale the y axis

Konrad,

There are no intersections because chartSeries() plots the unadjusted
data and you're overlaying an average of the split and dividend
adjusted series.  You need to adjust the raw data before charting.

BOS3.DE <- adjustOHLC(BOS3.DE)
chartSeries(BOS3.DE,theme="white",TA="addSMA(200)", yrange=c(5,50))

Note that "addSMA" replicates your "addTA(average(...))" call by using
the SMA function from TTR.

HTH,
Josh
--
http://www.fosstrading.com



On Sat, Nov 28, 2009 at 7:33 AM, Konrad Hoppe <konradhoppe at hotmail.de>
wrote:
series
_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list

-- Subscriber-posting only.
-- If you want to post, subscribe first.