0

I am plotting a price chart using function chartSeries() in the R package quantmod. Here's an example:

#Load package 'quantmod'
library(quantmod)

#Download quotes for VNQ
hist.xts <- getSymbols('VNQ',
                       from = '2006-1-1',
                       to = '2006-1-31',
                       auto.assign = F)

#Plot price chart
chartSeries(hist.xts, type = 'bars')

And here's the price chart:

price chart

How can I suppress the text "Last 64.050003" so that it doesn't appear on the chart?

Robert
  • 2,111
  • 4
  • 18
  • 32

1 Answers1

2

You have to insert the parameter TA = NULL as indincated in the documentation and in this example: http://www.quantmod.com/examples/charting/#chartseries

chartSeries(hist.xts, type = 'bars', TA = NULL)

enter image description here

tia_0
  • 412
  • 1
  • 3
  • 11
  • Thanks-- somehow I missed that in the documentation. Do you know if there's a way to add a TA option like addVo() while still suppressing the "last price" text? – Robert Aug 06 '16 at 21:41
  • 1
    I've tried to access the parameter of the plot using this answer https://stackoverflow.com/questions/23090963/r-quantmod-chartseries-newta-chob-modify-legend-and-axis-primary-and-secundar but i didn't manage to change the *last price* writing. – tia_0 Aug 07 '16 at 11:36
  • @Robert, to add a TA while supressing the "last price" text, just add the indicator into the next line after constructing the chart , i.e: `addVo()` to add the volume to the chart without "last price". – hvollmeier Aug 10 '16 at 10:42
  • @hvollmeier Thanks for your reply, but when I run `chartSeries(hist.xts, type = 'bars', TA = NULL)` followed by `addVo()` on the next line, the chart text appears again. – Robert Aug 11 '16 at 12:36
  • 1
    Robert you are right. You have to use the experimental `chart_Series` and `add_vo()` functions (watch out for the underscore !) to generate a chart like this (https://www.dropbox.com/s/ofh8rz41bna4du9/chart.png). – hvollmeier Aug 11 '16 at 14:30