Interactive Brokers Java API Example

oem2win

Newbie
2 0
Referring to following coding, I would like to know on how to retrieve the ConID from contractdetials.

Does anyone have any suggestions?
Thanks in advance for any suggestions

private static void contractOperations(EClientSocket client) {

//! [reqcontractdetails]
client.reqContractDetails(214, ContractSamples.SimpleFuture());
//! [reqcontractdetails]

//! [reqmatchingsymbols]
client.reqMatchingSymbols(214, "IB");
//! [reqmatchingsymbols]
 

neil9327

Junior member
17 0
Referring to following coding, I would like to know on how to retrieve the ConID from contractdetials.

Does anyone have any suggestions?
Thanks in advance for any suggestions

private static void contractOperations(EClientSocket client) {

//! [reqcontractdetails]
client.reqContractDetails(214, ContractSamples.SimpleFuture());
//! [reqcontractdetails]

//! [reqmatchingsymbols]
client.reqMatchingSymbols(214, "IB");
//! [reqmatchingsymbols]
When your client application calls method "reqContractDetails" through the EClientSocket connection, Interactive Brokers will reply to your client by calling method "contractDetails()" in your client's implementation of the EWrapper connection.
In the first instance I would code your application to simply print to console all of the data received as parameters to this method - and look for ConID in that.
 

AdBlock Detected

We get it, advertisements are annoying!

But it's thanks to our sponsors that access to Trade2Win remains free for all. By viewing our ads you help us pay our bills, so please support the site and disable your AdBlocker.

I've Disabled AdBlock