[R-SIG-Finance] quantmod - How to have addTA() not print legend when the indicator is overlaid on another chart?

Mauna 7141175 at gmail.com
Thu Jul 23 10:02:00 CEST 2015


In this code:

library(quantmod)
getSymbols("YHOO")
candleChart(YHOO)
addTA(Cl(YHOO)/2, legend = "", on = NA )

the legend parameter of addTa() works as expected.

But the same value to that parameter does not work if I let on = 1:

library(quantmod)
getSymbols("YHOO")
candleChart(YHOO)
addTA(Cl(YHOO)/2, legend = "", on = 1 )

It shows Cl(YHOO)/2: followed by the last adjusted price as the legend. How
can I remove this legend? Also, is it possible to remove the last price of
shown on the chart? I couldn't find any mention of this in the chartSeries()
 documentation.

The following is the output of my sessionInfo():

R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:[1] LC_COLLATE=English_United States.1252
LC_CTYPE=English_United States.1252   [3] LC_MONETARY=English_United
States.1252 LC_NUMERIC=C                          [5]
LC_TIME=English_United States.1252

attached base packages:[1] parallel  stats     graphics  grDevices
utils     datasets  methods   base

other attached packages:[1] quantmod_0.4-4   TTR_0.22-0
doParallel_1.0.8 iterators_1.0.7  xts_0.9-7       [6] zoo_1.7-12
foreach_1.4.2    magrittr_1.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.11.6      lubridate_1.3.3  lattice_0.20-31
codetools_0.2-11 digest_0.6.8
 [6] dplyr_0.4.2      assertthat_0.1   plyr_1.8.3       grid_3.2.1
  R6_2.1.0        [11] DBI_0.3.1        RSQLite_1.0.0    utilsSE_0.1
   stringi_0.5-5    lazyeval_0.1.10 [16] tools_3.2.1
stringr_1.0.0    compiler_3.2.1   memoise_0.2.1

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list