pilwon / node-ib

Interactive Brokers TWS API client library for Node.js
382 stars 134 forks source link

What exactly does the server version mean? #155

Open tredondo opened 4 years ago

tredondo commented 4 years ago

.on('server', version => console.log(version)) always shows 76, whether I connect to Gateway 972, or to TWB 979.

What does the server version field mean?

nemozny commented 4 years ago

I think it is API version. I haven't seen a word about how this works, but from pilwon's comments somewhere in the code in here I've understood 76 is the last old (non-V100plus) version. If you manage to get v100plus handshake working, you actually report to IB gateway a range of versions (i.e. v110..152) in your v100plus handshake, based on the functionality you implemented in your client (see constants.js). So in order to get functionality 100+ working (with some exceptions I also saw in the code here), you have to have v100plus.

tredondo commented 3 years ago

A year later, I still get 76 with TWS 981.

I see a [lot of ifs based on the version in lib/incoming.js, deciding what fields to dequeue. Where are these versions listed? How can we find out at which version a given field has become available? Does that even matter, since most servers will be on the latest version anyway?

nemozny commented 3 years ago

There is 76, because nobody implemented the v100plus handshake. If you tell IB servers any higher version than 76, they will expect the handshake. I've switched my IB client and language since the last comment, so don't look at me.