Keyboard Shortcuts
Likes
Search
Problem retrieving option strings with TWS API
GUY
¿ªÔÆÌåÓýHello everyone I'm French and I'm working on a project about options with TWS API. I would like to retrieve the list of option chains for a stock with date of contracts, strike, ask and bid that are linked to each contract. For that, I use the reqContractDetails() function and the definition of ContractDetails(); I retrieve the list of contracts but only the dates, strike and type of contract (PUT and CALL) Does anyone know how to retrieve the bid and ask for each of these contracts Thank you in advance for your answers. G BONNARDEL ? Envoy¨¦ ¨¤ partir de pour Windows ? De?: Richard L King
Envoy¨¦ le?:mardi 21 f¨¦vrier 2023 12:12 ??: [email protected] Objet?:Re: [TWS API] Historical Data Download : Compare Experiences ? My downloader works rather differently, in that it uses a lot of asynchrony to get the data as fast as possible. ? I¡¯ve just run it for daily S&P500 bars from 01/01/2005 to 01/0/2015. It went through the whole list, taking 66 minutes in total. ? It doesn¡¯t do anything differently for older data. For each symbol (read from stdin) it does a contract details request (just to make sure the symbol is valid: my S&P500 list is a bit out of date, with about 30 or so incorrect symbols so far), followed by a historical data request, and then writes the returned data out to a text file. Multiple contract details requests and historical data requests are made concurrently, up to 20 of them for the contracts. As each contract request completes, the corresponding historical data request is added to a queue and the next contract request is made. As each data request completes, the next one in the queue is fired. ? So it appears that TWS itself doesn¡¯t prevent old data downloads running smoothly. ? I don¡¯t know what to suggest regarding your issue, though it does look like it¡¯s likely to be a fault in your code. The fact that it hangs after 98 API requests looks very suspicious. But then why wouldn¡¯t it do the same with more recent data?... ? Using single requests for 20 years should work fine, but if you¡¯re anything like me you¡¯ll probably want to track down the cause of the problem. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of David Armour ? I, like many of you I am sure, have created a data downloader. I came across a problem recently with my code which has been running well for ages (years). The difference this time is I am trying to download quite old data. Let me explain. ? |