I've read the online documentation for constructing TWS synbols when using the IB data plugin, by using the TWS Description pop-up windows associated with the symbol. This also works for futures symbols, eg ESZ8-GLOBEX-FUT. If I want to use IB Controller to send an order to TWS, this symbol doesn't work. TWS gives the error messgae
200. No security definition has been found for the request
What should I use instead? I've searched here for IB Controller futures definition, but haven't found anything.
@polomora I just did a short test with this code (while I do not actually use the IB Controller for my trading I have it and played with it a bit in the past).
ibc = GetTradingInterface("IB");
if( ibc.IsConnected() ) // check if connection to IB was successfull
{
ibc.PlaceOrder("ESZ8-GLOBEX-FUT", "BUY", 1, "LMT", 2880, 0, "DAY", False ); // place order but do not transmit yet
}
And DID NOT get any error.
The order was properly transmitted using the IB controller (not submitted).
@beppe and @Tomasz
I used your sample code as follows, and it still doesn't work. I confirm I'm using upper-case letters
parentId = ibc.PlaceOrder("ESZ8-GLOBEX-FUT", "BUY", 1, "LMT", 2880, 0, "DAY", False );
stat = "ApiPending";
_TRACE("ApiPending, parentId " + parentId);
while ( stat == "ApiPending" )
{
ibc.Sleep( 20 );
stat = ibc.GetPendingInfo(parentId, "Status");
}
if( ( stat = ibc.GetPendingInfo(parentId, "Status") ) == "Error" )
{
errMessage = ibc.GetLastError(parentId);
_TRACE(symbol + ", Cannot place main order " + parentId);
_TRACE("PlaceLongOrder: Last Error " + errMessage);
_TRACE("PlaceLongOrder: Cannot handle error - Stop ");
}
And the log shows
ApiPending, parentId 26502
ESZ8-GLOBEX-FUT, Cannot place main order 26502
Last Error 200. No security definition has been found for the request
Cannot handle error - Stop
My TWS account has been enable to accept futures orders, because I can enter the order manually using the TWS user interface.
Are you subscribed to GLOBEX data ? You need to first enter this symbol in AmiBroker and make sure that you are receiving the data. For that you would need to enable GLOBEX on your account subscriptions.
@polomora I looked at the docs and to the sources of the IBController (version 1.3.8.0) and I do not see the GetPendingInfo() function.
Are you using a customized version of the IBController?
@beppe: Indeed I've been using a custom version of IBController.
I've found the error. I had introduced a bug, which translated GLOBEX to SMART, causing the error.
Sorry for wasting your time.
Many thanks again.
Please always include crucial information (such as that you modified IBController yourself) in original request. Should we know it from the start (instead of guessing) it would be much easier to point you to the possible source of error.