[R-SIG-Finance] How to scroll in time in a quantmod chart?

Jeff Ryan jeff.a.ryan at gmail.com
Thu Oct 16 18:48:19 CEST 2008


Hi Michael,

You can't scroll per se, at least not by clicking.

You can however display only subsets of your data, without affecting
any TA additions you have on the charts.

?zoomChart and the 'subset' argument to chartSeries should do it.

library(quantmod)
getSymbols("QQQQ", from='1999-03-10')
periodicity(QQQQ)

chartSeries(QQQQ)  # the whole series
chartSeries(QQQQ, subset='last 6 months')
chartSeries(QQQQ, subset='2007')
chartSeries(QQQQ, subset='2000-01/2000-07-20')

zoomChart()  # full chart again

zoomChart('2006')

You can also change some chart parameters on the fly too:

reChart(type='bars')

You can interactively select time to view with zooom().  Double click
on the chart to go to the full data view.

The 3rd 'o' in 'zooom' is for good luck...and to avoid namespace clashes :)

HTH
Jeff


On Thu, Oct 16, 2008 at 11:39 AM, Michael Zak <michael at zak.li> wrote:
> Hello
>
> I use charts from the quantmod package and I'm excited! But now I'm asking
> myself, if there is a way to scroll in time if I want to display a lot of
> data (I have data for the last 10 years). Is there a option I can do that
> with quantmod itself or shall I give it try with the windows() function from
> the tkrplot package or is there an other solution for that?
>
> Thank you, Michael Zak
>
> _______________________________________________
> 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