-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with addMACD when "col" is specified #321
Comments
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)
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 |
Weird... I'm also on v0.4.18.1. 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
The text was updated successfully, but these errors were encountered: