[R-SIG-Finance] chart_Series: Adding multiple custom indicators

Mike m|ke9 @end|ng |rom po@teo@n|
Thu Jul 6 08:23:04 CEST 2023


On 05 Jul 2023 Joshua Ulrich <josh.m.ulrich using gmail.com> wrote:

> On Wed, Jul 5, 2023 at 3:11 PM Mike <mike9 using posteo.nl> wrote:

> > > packageVersion('quantmod')
> > [1] '0.4.23'

> > On an older machine running quantmod 0.4.20 I get this message as a
> > warning instead of an error.

> That chart_Series() code didn't change between those 2 versions of
> quantmod. This went from a warning to an error based on changes in R
> itself. You can verify by running the code below on both machines:
> 
> ta <- list("a", "b")
> !is.null(ta) && nchar(ta) > 0
> ## Error in !is.null(ta) && nchar(ta) > 0 :
> ##  'length = 2' in coercion to 'logical(1)'

Yes, it seems to be a change in R. The newer machine is running R
4.3.0, the older is running R 4.2.3.

> The chart_Series() docs say that the TA arg should be "a character
> string of semi-colon seperated TA calls". So you can do this:
> 
> chart_Series(data, name = "test data", TA = paste(ta, collapse = ";"))

This did it.

Thanks Josh.

Mike



More information about the R-SIG-Finance mailing list