Reputation: 6774
With this code there is a "candlestick" for each day. What is the proper way to modify either getSymbols() or chartSeries() to have a larger granularity? eg. weekly, monthly, quarterly?
library(quantmod)
getSymbols("AAPL")
chartSeries(AAPL, type="candlestick", subset="last 12 months")
Upvotes: 0
Views: 259
Reputation: 290
try this for weekly data:
v <- to.weekly(AAPL) chartSeries(v, type="candlestick", subset="last 12 months")
or for monthly:
m <- to.monthly(AAPL) chartSeries(m, type="candlestick", subset="last 12 months")
or for quarterly:
q <- to.quarterly(AAPL) ; chartSeries(q, type="candlestick", subset="last 10 years")
Upvotes: 1