DEV Community

Discussion on: How to get historical market data from Interactive Brokers using Python

Collapse
 
pmzw75 profile image
Paul

Hi, very nice post. Just a question. I am running into an issue when no data can be downloaded for a contract. The script then hangs. How can I put a if-else construct based on this returned Error code 162?

INFO:ibapi.wrapper:ANSWER error {'reqId': 6, 'errorCode': 162, 'errorString': 'Historical Market Data Service error message:BEST queries are not supported for this contract'}
Error code 162