Skip to content
Advertisement

IBKR TWS API reqIds does not send back any messages to nextValidId

Shouldn’t the following code at least print “hi”, as I connect to the API and then reqIds is supposed to shoot a message back to nextValidId?

Instead, when I run this, nothing happens at all.

JavaScript

Advertisement

Answer

delete these lines

JavaScript

You don’t need to request ids on startup, the next one comes automatically. Don’t disconnect before you get a response. If you would like to disconnect automatically, call disconnect() in the nextValidId method after getting a response.

You shouldn’t use this filter if reqId > -1: The -1 errors are important information about the servers.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement