简体   繁体   中英

Interactive brokers TWS API Python, how to get trading day info

Interactive Broker's TWS software has a way of showing trading day information, ie if the exchange was closed for this day and if open what the trading hours where. See here: https://www.interactivebrokers.com/en/index.php?f=22063

How do I retrieve this information via the relatively new TWS API?

I could not find it anywhere in the docs.

reqContractDetails(id, contract) will return a contractDetails object with tradingHours as a field.

Here's a sample of using the new API. Just call reqContractDetails instead of market data. There's a EWrapper callback for contractDetailsEnd that will be called when the API is finished sending data as there may be more than one contract.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM