Giter VIP home page Giter VIP logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 8 Aug 2014 at 12:09

from ibrokers.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Yes, I've verified that the function works correctly iff TZ="GMT"

Original comment by [email protected] on 8 Aug 2014 at 12:16

from ibrokers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.