Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python-3.x

tws

Interactive Broker's TWS software has a way of showing trading day information, i.e. 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.

like image 454
pashute Avatar asked Oct 15 '25 16:10

pashute


1 Answers

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.

like image 182
brian Avatar answered Oct 17 '25 11:10

brian