JanBoonen / TwsApiCpp

Improved TWS API POSIX C++ library for the Interactive Brokers (IB) TWS (same project as TwsApiC++ in Yahoo TWSAPI).
106 stars 56 forks source link

One other question: futures options with this system? #12

Open markmcwiggins opened 5 years ago

markmcwiggins commented 5 years ago

Hi again ..

My project involves automating not only equity spreads but futures options spreads too .. but how to specify expiry and the instrument string?

I'm working on an example with oil futures options and calling reqContractDetails with various contract symbols (/CLX9, /CLZ9) and the expiration specified just as it works for the equities.

I have changed the secType to FOP and the exchange to GLOBEX but I keep getting "no security is found for this request" ... So in summary:

Contract C; C.symbol = "CL"; // and "CLZ9" and "CLX9" -- same lack of results C.expiry = "20191115"; C.secType = "FOP"; C.exchange = "GLOBEX"; C.currency = "USD";

Am I missing something? Please advise ... Thanks!