¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Collection of Historical Data


 

I'm working in pulling down a significant set of 1 min price data from the API using the following code:



The code works well.? I put a wrapper around this code and run the app on a single symbol with start and end date windows once every 15 secs or so and I can collect the data I need over time.? There's only one gotcha.? Occasionally, a historical stock listing won't be available via the "SMART" exchange.? When this happens the app hangs and loses its connection to IB and my looping stops.??

I'm looking for some work arounds here.? Can I do a reqContractDetails to understand which exchange my stock is listed on?? How can I access this information (the exchange associated with a particular stock) in advance so I'm not asking for invalid info?

Another possibility is to be able to catch this error some how and have a second try with a different exchange value (e.g. "ISLAND").? This is a little tricky since I'm running the code above at arm's length with os.system but I'm open to suggestions about how to modify the original code or my wrapper code to catch these exceptions so they aren't catastrophic.


Join [email protected] to automatically receive all group messages.