[R-SIG-Finance] Using abline with chartSeries

Worik Stanton worik.stanton at gmail.com
Sun Apr 8 04:10:45 CEST 2012


Friends

I would like to be able to draw vertical lines on a chart resulting from 
chartSeries.

I can draw horrizontal lines but they do not apear in the correct place.

In the following example I draw a dotted white horizontal line, but not 
where I asked for it, and I get no vertical line using either of the two 
methods.  I cannot find an answer via Google.  I am stumped

library(quantstrat)
getSymbols("IBM")
IBM.m <- to.monthly(IBM)
chartSeries(IBM.m)
abline(h=140, lty=2, col="white")
QQ <- index(IBM.m[24,])
abline(v=QQ, col="white", lty=2)
abline(v=.index(IBM.m[24,]), col="white", lty=2)



-- 
Foo!



More information about the R-SIG-Finance mailing list