Open GoogleCodeExporter opened 9 years ago
This may help finding the error. After I set the time zone to the correct time
zone:
Browse[3]> Sys.setenv(TZ="Europe/Istanbul")
Browse[3]> Sys.time()
[1] "2014-08-08 03:01:04.078636 EEST" # CORRECT TIME
Browse[3]> reqHistoricalData(tws, twsEquity("SPY"), barSize="5 mins",
duration="600 S", tzone="UTC")
waiting for TWS reply on SPY .... done.
SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.WAP SPY.hasGaps SPY.Count
2014-08-07 21:50:00 192.19 192.27 192.14 192.18 3898 192.208
0 751
2014-08-07 21:55:00 192.19 192.22 192.06 192.11 4079 192.150
0 741
2014-08-07 22:00:00 192.10 192.22 192.08 192.21 4242 192.148
0 738
Browse[3]> reqHistoricalData(tws, twsEquity("SPY"), barSize="5 mins",
duration="600 S", tzone="America/Chicago")
waiting for TWS reply on SPY .... done.
SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.WAP SPY.hasGaps SPY.Count
2014-08-07 16:55:00 192.19 192.22 192.06 192.11 4079 192.150
0 741
2014-08-07 17:00:00 192.10 192.22 192.08 192.19 4253 192.148
0 741
2014-08-07 17:05:00 192.22 192.22 192.16 192.17 369 192.189
0 63
This is not the correct time for Chicago:
Browse[3]> Sys.setenv(TZ="America/Chicago")
Browse[3]> Sys.time()
[1] "2014-08-07 19:08:35.706916 CDT"
So, the ONLY way to get the correct results is to set TZ to GMT, which doesn't
make any sense :(
Original comment by examach...@gmail.com
on 8 Aug 2014 at 12:09
Yes, I've verified that the function works correctly iff TZ="GMT"
Original comment by examach...@gmail.com
on 8 Aug 2014 at 12:16
Original issue reported on code.google.com by
examach...@gmail.com
on 8 Aug 2014 at 12:01