Closed Burrguy closed 4 years ago
Thanks for reaching out @Burrguy
This example is still using the old API syntax. Apologies for any confusion. I thought I updated all of them for new +9.73 API but guess I missed this one. The only change here is how the contract is defined.
contract = com.ib.client.Contract();
contract.symbol('IBM')
contract.primaryExch([]);
contract.currency('USD');
contract.secType('OPT');
Let me know if you find other issues.
@Burrguy closing this but feel free to reopen if not resolved
I am running OptionsComputationsIB4m.m
The code fails on the last line, with this error: No public field m_primaryExch exists for class com.ib.client.Contract.
Error in OptionsComputationsIB4m (line 21) contract.m_primaryExch = []; contract.m_secType='OPT';
Because the GenericStockContract does not contain either variable listed above the code fails
This is what contract does contain: val =
conid 0 symbol IBM strike 0.0 exchange SMART currency USD primaryExch ISLAND
I suppose this could be because the wrong API version is installed, I have matlab R2018b installed, build 978,1g if TWS and the latest API.
Also ver -java: Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode