[R-SIG-Finance] quantmod: overlaying time series bar charts

Dai, Jiqiong Jiqiong.Dai at soros.com
Wed Apr 29 18:28:22 CEST 2009


In  quantmod:::chartSeries.chob, comment out:

rect(coords[1], coords[3], coords[2], coords[4], col = x at colors$area)

You will make it.



Jiqiong Dai
Soros Fund Management, LLC
888 7th Avenue, 32nd Floor
New York, New York 10106
Tel: (212) 320-5741
Fax: (646) 731-5741

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Jeff Ryan
Sent: Wednesday, April 29, 2009 10:15 AM
To: Sebastian Hauer
Cc: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] quantmod: overlaying time series bar charts

Sebastian,

At present you can't do that on one graphical region.

If you would like two plotted above and below each other, this would be
a solution:

layout(matrix(1:2, nrow=2))
chartSeries(ts1, layout=NULL, TA=NULL)
chartSeries(ts2, layout=NULL, TA=NULL)
layout(1)

The first layout call will have to be adjusted if you make use of
additional TA windows. ?layout is the place to start for that.

Just curious, as this has been requested before, what is your use
case/rationale for the overlay?

Unless the series share the same scale, the charts are bound to be very
confusing.  Even with the same scale I am not too sure you will be
deriving any information from the overlay.

Jeff

On Tue, Apr 28, 2009 at 7:49 AM, Sebastian Hauer
<sebastian.hauer at gmail.com> wrote:
> Hello,
> I was wondering if there is an easy way of overlaying two bar charts 
> using quantmod?
> Here is what I am trying to do:
>
> chartSeries(ts1, type = "bars", show.grid = TRUE, up.col = "green", 
> dn.col = "green") chartSeries(ts2, type = "bars", show.grid = TRUE, 
> up.col = "red", dn.col = "red")
>
> But have ts2 show in the same plot frame or if that does not work have

> it show in a frame below the first one.
>
> Regards,
> Sebastian
>
> _______________________________________________
> 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

_______________________________________________
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.



More information about the R-SIG-Finance mailing list