It seems that is a bug in the addMACD
function.
If you look at its source code (e.g. with fix(addMACD)
) you will see that it does:
col <- if (missing(col))
col <- c("#999999", "#777777", "#BBBBBB", "#FF0000")
Hence, if you define col
, the above lines assigns NULL to col
.
If you change those lines to
if (missing(col))
col <- c("#999999", "#777777", "#BBBBBB", "#FF0000")
or just delete them altogether and specify a default value for col
the function will work as expected.
You may want to have a look at this (and related discussions) on how to edit a function in R: What ways are there to edit a function in R?