Skip to content
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

Incorrect timestamp returned from ActualPrice function #5

Open
mpatkinson7 opened this issue Mar 4, 2017 · 0 comments
Open

Incorrect timestamp returned from ActualPrice function #5

mpatkinson7 opened this issue Mar 4, 2017 · 0 comments

Comments

@mpatkinson7
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant