[R] Quantmod abline and axis configuration

Joshua Ulrich josh.m.ulrich at gmail.com
Sun Apr 10 01:09:41 CEST 2016


On Sat, Apr 9, 2016 at 2:14 PM, bgnumis bgnum <bgnumis at gmail.com> wrote:
> Hi all,
>
> I have this code
>
>
> I want to add two ablines like this
>
> abline(h=2400, lty=3, col="lightgrey")
>
> abline(h=400, lty=3, col="lightgrey")
>
> But doesnt wotk.
>
Use addLines().  It does what abline() does, although you cannot specify lty.

> I alo try to set ylim from 0 to max "Foa"+1000 but I´m not able ¿Is it
> posible?
>
Yes, use the yrange argument.

>
>
> require(latticeExtra)
> require(ggplot2)
> require(reshape2)
> suppressPackageStartupMessages(require(googleVis))
> require(quantmod)
> require(PerformanceAnalytics)
> require(xtsExtra)
> require(rCharts)
>
>
>
>
>
> Foa<-as.xts(read.zoo("fa.txt",col.names=c("Date","LAST"), sep="",dec=",",
> format="%d/%m/%Y"))
>
> chartSeries(Foa,theme="white",TA = c(addBBands(50,2), addBBands(100,2),
> addBBands(250,2), ylim(0,4000))
> )
>
> t=chartTheme()
> t$BBands$fill="#ff666633"
> reChart(theme="white")
> t$BBands$col=c('red','blue','green')
> t$BBands$col='blue'
> reChart(theme="t")
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2016 | www.rinfinance.com



More information about the R-help mailing list