Closed nvalueanalytics closed 3 years ago
Thanks for the report! This is fixed now. Please let me know if you run into any other issue(s).
@joshuaulrich Thanks for addressing this, it no longer throws an error but the visualization is still broken (see attached screenshots) Basically when specifying col, and empty chart is created but no axis, lines, or tick-marks are added
addMACD()
addMACD(col = c("#FF0000", "#008000", "#BBBBBB","#FF0000"))
Do you want me to open a new issue?
Hmm, it works for me...
library(quantmod)
getSymbols("JAN")
jan <- to.weekly(JAN)
chartSeries(jan, subset="2018/", theme=chartTheme("white"))
addBBands()
addMACD(col = c("#FF0000", "#008000", "#BBBBBB","#FF0000"))
packageVersion("quantmod")
# [1] '0.4.18.1'
Are you using the latest development version? Maybe there's something else in your environment that conflicts with the change I made? Try starting R with the --vanilla
flag so none of your potential customizations are used.
Weird... I'm also on v0.4.18.1. I'll try to figure it out on my end :)
Thanks for the quick response and for all the great work you've put into this
Restarting R did the trick, now it works perfectly when plotting on standard output device but still not when putting the output to PDF... Will do some digging...Thanks again!
Glad that you got it working!
The PDF issue is probably because you need to plot/print the last call to a plotting function (like you do for lattice or ggplot). There should be some examples on stack overflow.
Description
When explicitly passing colors to addMACD an error occurs (see examples below). After a bit of research I think the issue is with the vectorized function "ifelse" which evaluates the difference between the MACD line and the signal line.
cols <- ifelse((macd[,1]-macd[,2]) > 0, col[1],col[2])
What is not clear to me is why, if I specify
histogram = F
no lines are generated eitherExpected behavior
I should be able to specify custom colors (or other parameters) without affecting the function
Minimal, reproducible example
This
or this
cause the following
However when using
No error is generated. But also no lines in the chart
Session Info