Thanks for your input Richard.
I did some testing myself today as well. I modified my downloader to get up to 25 years history. It took 1hr 50mins to get 25 years for the S&P500 stocks. (Of course not all stocks have 25 years history, but it worked.) Interestingly I "found" a new option (new for me) in TWS API settings which I set on and it has helped make my code run far more smoothly. I realised I was not getting any errors reported for pacing issues. Setting this below helps with prompt error messaging. It also helped me discover the problem with AXP. I have not been setting any PrimaryExchange when pulling historical data and for some reason TWS accepts this for recent history, but for older history it seems to keel over and hang up. (As I mentioned, the API Log shows my request going to TWS correctly but nothing comes back. I then saw something strange. I send a cancelHistoricalData() when I get a 2 minute timeout and I see that I am getting an error message saying that there is no such query existing which seems strange. Does this mean that TWS did not even send my reqHistoricalData() to IB? Does TWS actually filter requests itself?) Anyway, I manually added the PrimaryExchange for AXP (I have an option to put PrimaryExchange after symbol in list like AXP@NYSE) and it worked fine. Richard, this brings me to a question for you. You call contractDetails() beforehand to check the contract which I think is smart. However, do you have a methodology to select the correct contract from the list that gets returned? Could you share your logic with me? Once you get the contract, do you specify all fields in the contract for reqHistoricalData() call (e.g. PrimaryExchange, etc.) or leave some things blank? Rgds, David P.S. I am exactly like you. I want to fix this.... :) |