[R-SIG-Finance] Using abline with chartSeries

slava zimine slzimine at gmail.com
Fri Apr 20 17:59:41 CEST 2012


Hi

Please check  if the  functions attached  do what you wish.

functions currently set to work with xts  ohlc  with time frames   m1, m5,
m15, h1,d1, w1, mo1


regards.

SZ


> source('addVoep.R') ; source('addEp.R')

>loadSymbols('IBM')

>mg <- to.monthly(IBM)

barChart(mg, TA='addEp();addVoep()' )

On Sat, Apr 7, 2012 at 10:10 PM, Worik Stanton <worik.stanton at gmail.com>wrote:

> 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!
>
> ______________________________**_________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120420/647af3a9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: addEp.R
Type: application/octet-stream
Size: 2630 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120420/647af3a9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: addVoep.R
Type: application/octet-stream
Size: 6030 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120420/647af3a9/attachment-0001.obj>


More information about the R-SIG-Finance mailing list