I'll try to find some time for this soon, but it won't be today, so it'll be next week before I can actually try placing orders.
?
Just one thing: the information you quoted from your API log is missing the important stuff: I'm not interested in the error message, I'm interested in the message from the API to TWS that contains the order details, and which caused the error message. This should be just before the error message, so shortly before 18:32:06:634: in fact it will probably be the previous line in the logfile. It'll be a really long message that will include the encoded condition along with all the other stuff for the order. I want to be able to see exactly what bytes were generated for this order. So please can you quote that line.
Wow Richard, that is very kind of you, if you could please debug it, that?would be great, thank you very much!
?
I tried but I'm having some issues preparing the C# program to debug, a lot of lost references, classes... I need to refresh how everything works together and I also have xml compatibility?issues with the Microsoft Visual Studio 15.
?
to set the?previous order use the following:
Type
Last trade date
Strike
P/C
Multiplier
Exchange
Prim Exch
Currency
Local Symbol
Con Id
Combo Legs
Delta-Neutral
Action
Quantity
Cash Qty
Order Type
Lmt Price
FUT
?
?
?
?
NYBOT
?
USD
CTK2
?
?
?
BUY
1
?
LMT
1.13
?
Then on DN column on the same tab:
1) you can try first with the demo example that works, placing: last of bid/ask Price of 8314(SMART) is <= 0?
? ? It should run as expected and create a conditional order on the IBM stock
2) then try please the following: last Price of 269459887(GLOBEX) is >= 1.15?
?
you will get the following error on API log:
18:31:51:424 -> ---:4-2--1-2104-Market data farm connection is OK:usfuture.nj- 18:31:51:424 -> ---44-2--1-2104-Market data farm connection is OK:hfarm- 18:31:51:424 -> ---84-2--1-2104-Market data farm connection is OK:usfarm.nj- 18:31:51:424 -> ---54-2--1-2104-Market data farm connection is OK:eufarm- 18:31:51:424 -> ---74-2--1-2104-Market data farm connection is OK:usfuture- 18:31:51:424 -> ---74-2--1-2104-Market data farm connection is OK:cashfarm- 18:31:51:424 -> ---54-2--1-2104-Market data farm connection is OK:usfarm- 18:31:51:424 -> ---34-2--1-2106-HMDS data farm connection is OK:ushmds- 18:31:51:424 -> ---84-2--1-2158-Sec-def data farm connection is OK:secdefil- 18:32:06:634 -> --- 4-2-1879051859-320-Error reading request.Message id 1879051859.? Unable to parse data. java.lang.NumberFormatException: For input string: "GLOBEX"- 18:32:06:634 <- 2-0-0- 18:32:06:634 -> ---)4-2-0-300-Can't find EId with tickerId:0-
?
on TWS log:
2022-02-03 18:35:28.874 [EF] INFO ?[JTS-EServerSocket-1608] - [0:157:157:1:0:0:0:ERR] Message id 1879051859.? Unable to parse data. java.lang.NumberFormatException: For input string: "GLOBEX" 2022-02-03 18:35:28.878 [EF] INFO ?[JTS-EServerSocket-1608] - [0:157:157:1:0:0:0:ERR] Invalid incoming request type - 0 2022-02-03 18:35:28.878 [EF] ERROR [JTS-EServerSocket-1608] - [0:157:157:1:0:0:0:ERR] Client socket broken - java.lang.NumberFormatException: For input string: "1.79769313486232E+308" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at jextend.bh.p(bh.java:921) at jextend.dV.a6(dV.java:2615) at jextend.dV.run(dV.java:2202) at java.lang.Thread.run(Unknown Source)
?
?
Thank you very much again
?
?
El jue, 3 feb 2022 a las 0:47, Richard L King (<rlking@...>) escribió:
It's not really possible to debug the TWSLib when it's invoked from Excel. But It would be pretty straightforward to write a small C# program that calls the TWSLib API functions, with a suitable simple condition string, and step through that in the debugger (note that the VBA in the Excel workbook doesn't really do anything except call the TWSLib methods, so there's no need to have Excel involved at all).
?
You could then have a variant of this program that calls the C# API functions directly for the same condition: if these two programs differ in their interaction with TWS, that would give a good clue as to where the problem lies.
?
As it happens, I have a sample API demo program that exists in two versions: one uses the ActiveX TWSLib, and the other uses the C# API, so I could do what I suggested above with relatively little effort. If you like, I'll try to find time for this, but if you’ve got another way to progress this, I'd rather not spend the time on it.
?
By the way, it would be helpful if you could give us an extract from the API log that includes the place order message from the API to TWS, rather than just the response from TWS, so we can see exactly what's being sent.
Hi Jürgen, thank you again, however regarding the twsactivex?api the data input is all coming from the excel cells and transformed accordingly by the demo program. This issue that I currently have its happening on the demo Excel provided by IB and I did check the function and it gets the conditions well parsed, the issue comes after sending the order? to the TWS?using the Api.Tws.placeOrderEx function?
?
anyone in this group, please, do you know if it is possible to debug the placeOrderEx function? Or is it better to contact IB and report the potential bug on their API?