node-ib icon indicating copy to clipboard operation
node-ib copied to clipboard

can’t get quote for MSFT

Open vw550 opened this issue 5 years ago • 2 comments

I can get historical quotes for most stocks, but for MSFT I get the error: “The contract specified for MSFT is ambiguous”. Reading on IB forum it looks like I need to set the “primary exchange” in order to remove the ambiguity, which I gather is ISLAND??.
With node-in, I don’t see how this is possible?? Any help in resolving this error greatly appreciated!! Thanks!

vw550 avatar Mar 14 '20 00:03 vw550

It's the weekend and IB's servers are hosed as usual, but what happens when you pass the exchange to ib.contrack.stock('MSFT', 'ISLAND', 'USD')? How about when passing 'SMART'?

https://github.com/pilwon/node-ib/blob/master/lib/contract/stock.js

The primary exchange is returned by reqContractDetails, rather than something you supply.

tredondo avatar Mar 14 '20 11:03 tredondo

I’ve tried with just ‘SMART’ and just ‘ISLAND’ and tried to combine as in ‘SMART/ISLAND’ and got the same error each time of “ambiguous”. But my code works fine for GOOG, TSLA, etc. it seems I need a setContractDetails function...

vw550 avatar Mar 15 '20 13:03 vw550