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

reqHistoricalData does not work due to differing timezones #11

Open
kylebalkissoon opened this issue Feb 18, 2016 · 1 comment
Open

Comments

@kylebalkissoon
Copy link

reqHistoricalData when called without an endDateTime passed grabs the current time from reqCurrentTime and then passes it back to IB as the endDateTime with the GMT timezone.

This will not work if the IBGateway is in a non GMT timezone specifically EDT.

library(IBrokers)
IBConn=ibgConnect(1234)
Contract2get = twsCurrency("EUR",currency = "JPY")
##Does not work
test = reqHistoricalData(IBConn,Contract = Contract2get,whatToShow ='BID_ASK',
  useRTH = "0",barSize = '1 min',duration="1 D")

##Works note my IBG is in EST
test = reqHistoricalData(IBConn,Contract = Contract2get,whatToShow ='BID_ASK',
  useRTH = "0",barSize = '1 min',duration="1 D",
  endDateTime = paste0(gsub("-","",reqCurrentTime(IBConn))," EST"))
@joshuaulrich
Copy link
Owner

I assume "Does not work" means there's an error; I can't replicate any error. Can you please provide the error message and the output from running traceback() after the error is thrown? Also, please provide the output from sessionInfo() and Sys.timezone(), and TWS version you're running.

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

2 participants