Hello,
I’m writing code to to place buy orders and to automatically update sell STP and LMT orders that are placed with TWS using the IB Controller. I have no problems with all of my current positions, except for two: MSFT and GDX. For these two positions, I get the error message
CloseLongOrder: Last Error 200. The contract description specified for GDX is ambiguous.
The code is
childId1 = ibc.PlaceOrder( symbol, "SELL", quantity, "LMT", exitLimitPrice, 0, orderTime,
isTransmit, 100, "", 0, ocaGroup );
ibc.Sleep( 200 );
errMessage = ibc.GetLastError(childId1);
_TRACE("CloseLongOrder: Last Error " + errMessage);
I have also tried using suffix “-SMART-STK”, and it makes no difference:
childId1 = ibc.PlaceOrder( symbol+"-SMART-STK", "SELL", quantity, "LMT", exitLimitPrice,
0, orderTime, isTransmit, 100, "", 0, ocaGroup );
Strange it is only a problem for some symbols, and not for others. For GDX, I’ve checked the symbol definition on TWS:
VANECK VECTORS GOLD MINERS E
Underlying GDX
Security Type STK
Currency USD
Exchange SMART
Primary Exchange ARCA
Symbol GDX
Issuer Country US
Stock type ETF
Paul