Hi,
The quantmod addTA function works well in one figure, but in the custom
layout, it generates a second plot rather overlapping the main plot. My
objective is to plot two stocks in one figure, and each of them have a set
of technical indicators.
The following codes works, but the TA argument in the chartSeries is just
not as powerful as addTA.
getSymbols(c('QQQQ','SPY'))
layout(matrix(1:2,2,1),c(1,1),c(1,1))
chartSeries(QQQQ['2011'], layout=NULL, TA="addSMA(10);addSMA(20)")
chartSeries(SPY['2011'], layout=NULL, TA="addSMA(10);addSMA(20)")
The following codes do not work.
getSymbols(c('QQQQ','SPY'))
layout(matrix(1:2,2,1),c(1,1),c(1,1))
chartSeries(QQQQ['2011'], layout=NULL, TA=NULL)
addSMA(10)
addSMA(20)
chartSeries(SPY['2011'], layout=NULL, TA=NULL)
addSMA(10)
addSMA(20)
Thanks,
Michael
--
View this message in context: http://r.789695.n4.nabble.com/quantmod-charting-problems-tp3759201p3759201.html
Sent from the Rmetrics mailing list archive at Nabble.com.
quantmod charting problems
3 messages · Brian G. Peterson, randomcz
try on=0 as a parameter to addTa (or add_TA, which works with the newer chart_Seris) Cheers, - Brian
On Sun, 2011-08-21 at 17:43 -0700, randomcz wrote:
Hi,
The quantmod addTA function works well in one figure, but in the custom
layout, it generates a second plot rather overlapping the main plot. My
objective is to plot two stocks in one figure, and each of them have a set
of technical indicators.
The following codes works, but the TA argument in the chartSeries is just
not as powerful as addTA.
getSymbols(c('QQQQ','SPY'))
layout(matrix(1:2,2,1),c(1,1),c(1,1))
chartSeries(QQQQ['2011'], layout=NULL, TA="addSMA(10);addSMA(20)")
chartSeries(SPY['2011'], layout=NULL, TA="addSMA(10);addSMA(20)")
The following codes do not work.
getSymbols(c('QQQQ','SPY'))
layout(matrix(1:2,2,1),c(1,1),c(1,1))
chartSeries(QQQQ['2011'], layout=NULL, TA=NULL)
addSMA(10)
addSMA(20)
chartSeries(SPY['2011'], layout=NULL, TA=NULL)
addSMA(10)
addSMA(20)
Thanks,
Michael
--
View this message in context: http://r.789695.n4.nabble.com/quantmod-charting-problems-tp3759201p3759201.html
Sent from the Rmetrics mailing list archive at Nabble.com.
_______________________________________________ R-SIG-Finance at r-project.org mailing list 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.
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock
Thanks Brian, but it seems that the new chart_Series does not support layout argument. How to plot two stocks in one figure? Michael -- View this message in context: http://r.789695.n4.nabble.com/quantmod-charting-problems-tp3759201p3759377.html Sent from the Rmetrics mailing list archive at Nabble.com.