[R-SIG-Finance] abline for quantmod charts

Jeff Ryan jeff.a.ryan at gmail.com
Thu Apr 30 23:16:48 CEST 2009


Hi Hae,

The best way to do this at the moment is with addTA:

chartSeries(YHOO)
addTA(xts(TRUE,as.Date("2008-04-01")),on=-(1:2),col="#333333")

zoomChart('200803/200804')

You'll notice that it draws a thick line (region).  This is usually
more useful than just a line on quantmod charts, as the spacing is
between observations is padded.

I will at some point be adding access for primitive graphics function
to the whole charting process, but for now this should do what you
want.


HTH,
Jeff

On Thu, Apr 30, 2009 at 3:56 PM, Hae Kyung Im <haky.im at gmail.com> wrote:
> Hi,
>
> I was trying to add vertical lines to a quantmod plot using
>
> abline( v = somdatetime ) like in the following example
>
>> getSymbols("YHOO")
> [1] "YHOO"
>> chartSeries(YHOO)
>> abline( v=as.POSIXct("2008-04-01","%Y-%m-%d") )
>
> But nothing shows up on the chart.
>
> Any ideas on how to do this?
>
> Thanks
> Haky
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list