Dear Stack overflow community, I am trying to compute the returns of an asset using periodReturn's quantmod functions:
HLCtest is a "High Low Close" object, head(HLCtest) gives:
## Date High low Close
##1 1991-01-01 GMT 1517.93 1517.93 1517.93
##2 1991-01-02 GMT 1509.58 1487.96 1505.10
##3 1991-01-03 GMT 1540.22 1500.54 1539.50
##4 1991-01-04 GMT 1552.15 1533.77 1547.66
##5 1991-01-07 GMT 1524.38 1501.26 1507.87
##6 1991-01-08 GMT 1507.37 1474.79 1500.24
> yearlyReturn(HLCtest, subset=NULL, type='arithmetic', leading=TRUE)
I get the following error message:
> Error in try.xts(x) :
Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format
I used:
> strftime(HLCtest$Date, format ="", tz="GMT", usetz = TRUE)
to make sure the date format was ISO8601 standard.
and also:
> is.HLC(HLCtest) to make sure the object was "High Low Close" object.
Could someone please tell me what is this error message telling me and how to fix it?
head(HLCtest)- rbmgetSymbolsor you need todputthe data (at least first few rows. - rbmdputoutput of first 5 rows ofHLCtest- rbm