IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
1.02k stars 178 forks source link

How to force IB Gateway to start with usfuture market data farm on? #261

Open leebailey88 opened 1 month ago

leebailey88 commented 1 month ago

Screenshot 2024-07-19 134136

I'm trading futures. Sometimes my IB Gateway that's running in a Docker container starts with only the usfarm market data farm turned on, while other times it also includes usfuture and usfuture.nj. I've found that if it doesn't start with usfuture turned on, then I'm not able to get any market data for futures contracts at all until I restart the program and hopefully get lucky with usfuture being on next time.

Is there a way to force the usfuture on from a config or command line option? Maybe in jts.ini?

Screenshot 2024-07-19 135038

rlktradewright commented 1 month ago

IBC can only do things that a user can do via the Gateway (or TWS) UI.

Do you know a way to force Gateway to connect to a particular market data farm using the UI?

No, neither do I.

So I guess that answers the question!

The fact is that market data farms are connected as required as a result of market data requests. In the case of Gateway, this can only be via API calls to reqMktData. If that doesn't do the trick, there's almost certainly something wrong with your API client's code. Make sure you're logging error messages. I can't believe that you could request market data for a futures contract and get no data without there being an error message that explains why.

leebailey88 commented 1 month ago

Thanks for the quick reply! I see, I will keep digging on this particular issue.

In the meantime, I've noticed another problem:

Screenshot 2024-07-22 112041

When I use the RECONNECTDATA command, there's a confirmation modal that pops up. IBC doesn't seem to be automatically clicking the "OK" button to confirm that I want to reconnect data.

rlktradewright commented 1 month ago

You're right. The same is true of RECONNECTACCOUNT.

This seems to be new behaviour in some version of TWS/Gateway since 10.19, which doesn't produce this dialog. Can you please tell me which Gateway version you're using?

I'll fix it when I can find some time.

leebailey88 commented 1 month ago

Thanks! I'm using the latest IB Gateway version 10.30.1