Wednesday, July 11, 2012

IB API, reqMktDataEx : error code 200 no security definition has been found for the request


Have you ever encountered this error? I can't figure out for the life of me what is wrong with my IContract. I've made it exactly as it is on the VB.NET sample they included but I'm still getting "error code 200".

I tried using reqMktData() and thankfully it worked! But I am not satisfied. I want to find out what's wrong with my IContract. Here's the inspection before the parameters are passed to reqMktDataEx()

If you've encountered the same error, please share on how you solved it.

EDIT 5 minutes later:

I solved it damn it.

After calling Tws.CreateContract(), do not change IContract.conId ..

why do I need hours to solve such problems... these guys need to work on their documentation.

=======================
oTws.reqMktDataEx(quote.TickerId, quote.contractInfo, quote.GenericTicks, (int)quote.Snapshot);




+ quote


quote.GenericTicks
string

quote.Snapshot 0 int?

quote.TickerId 1 int
- quote.contractInfo {System.__ComObject} TWSLib.IContract {System.__ComObject}
+ [System.__ComObject] {System.__ComObject} System.__ComObject

comboLegs null dynamic

conId 1 int

currency USD string

exchange SMART string

expiry
string

includeExpired 0 int

localSymbol
string

multiplier
string

primaryExchange NASDAQ string

right
string

secId
string

secIdType
string

secType STK string

strike 0 double

symbol AAPL string

underComp null dynamic
- Dynamic View Expanding the Dynamic View will get the dynamic members for the object

comboLegs null

comboLegsDescrip
System.String

conId 1 System.Int32

currency USD System.String

exchange SMART System.String

expiry
System.String

includeExpired 0 System.Int32

localSymbol
System.String

multiplier
System.String

primaryExchange NASDAQ System.String

right
System.String

secId
System.String

secIdType
System.String

secType STK System.String

strike 0 System.Double

symbol AAPL System.String

underComp null
=======================


IBAPI, TWS API, TWSAPI,