I would like to be able to change the timezone for my requests to the IB API, how can I do this? I am writing in Python, and thus use the IBPy wrapper found here.
How to reproduce the problem:
- Create the contract to be queried by specifying contract.m_symbol = 'AUD', contract.m_secType = 'CASH', contract.m_exchange = 'IDEALPRO', contract.m_primaryExch = 'IDEALPRO', contract.m_currency = 'NZD'
- Using reqHistoricalData, get the daily opening price of the above contract with EST as the timezone for 23/6/2016.
- Now change the timezone by modifying the 3rd argument of reqHistoricalData to use JST as the timezone for 23/6/2016.
- Compare the opening prices from step 2 and 3
Supposedly, the third argument of the function reqHistoricalData(...) controls the timezone. However, changing from EST to JST doesn't change my prices. I have been in contact with the API guys from IB. They obtain the following results for AUD.NZD:
With EST as timezone opening price for 23/6/16 is: 1.046185 With JST as timezone opening price for 23/6/16 is: 1.04598
I get: 1.046185 for all timezone I have tried (GMT, EST, JST).
I have approached the following resources:
- General usage and examples of reqHistoricalData
- List of accepted timezones
- Documentation of reqHistoricalData() function.
How can I change the timezone in my historic data requests? Any help is greatly appreciated, and I promise to buy you a drink the next time you are in Singapore.