[R-SIG-Finance] Using abline with chartSeries

Worik Stanton worik.stanton at gmail.com
Mon Apr 9 05:24:40 CEST 2012


On 08/04/12 14:39, Joshua Ulrich wrote:
> Use rseek.org instead of Google (it provides a custom Google search).
> The answer to your question is the first result under "support lists"
> when you search for "chartseries vertical line".
>
> chartSeries(IBM.m)
> addTA(.xts(TRUE,.index(IBM.m)[24]), on=1)
>
Actually, no.  As an experiment I used your advice, on rseek.org,  and 
have not come across this.  "chartseries" matches "chart series" 
(without the quotes) so any useful advice is burried under a mountain of 
unhelpful advice.

Using google and looking for "chartSeries quantstrat abline" (again 
without quotes) I found 
http://www.r-bloggers.com/great-faj-article-on-statistical-measure-of-financial-turbulence-part-3/ 
that advised....

chartSeries(turbulence,theme="white",name="Correlation and % Change as 
Measure of Financial Turbulence")
abline(h=0.8)

So  again tried...

 > getSymbols("IBM")
[1] "IBM"
 > IBM.m <- to.monthly(IBM)
 > chartSeries(IBM.m, theme="white")
 > abline(h=160)

But the horizontal line is *not* at 160, unless the y-axis is wrong.

So how is it done?

cheers
Worik

-- 
Foo!



More information about the R-SIG-Finance mailing list