ROandaAPI icon indicating copy to clipboard operation
ROandaAPI copied to clipboard

Incorrect timestamp returned from ActualPrice function

Open mpatkinson7 opened this issue 8 years ago • 0 comments

Over the weekend, the ActualPrice function returns the current date as opposed to the date the instrument last traded. For example, calling the ActualPrice function on a Saturday will return Saturday's date instead of the last date (the previous Friday usually) when the instrument traded.

The fix is straightforward and included below. Don't bother calling as.POSIXct when it isn't used later anyway.

Replace the line below... DateTime <- as.POSIXct(substr(InstPrecjson[[1]]$time,12,19), format = "%H:%M:%S")

... with this line. DateTime <- substr(InstPrecjson[[1]]$time,1,19)

mpatkinson7 avatar Mar 04 '17 06:03 mpatkinson7