If I try to request a reqMktData I can´t get tickPrice() and TickSize() events. After that request the log.txt is full of plenty "No EC errors for tag 109 ... " Has someone a similar behavior or a useful hint to this ? (the rest of the activeX stuff - connect/disconnect order/cancel set properties and the events errMessage,connectionClosed and orderstatus - is full available and works without problems) (tested with Xbase++ & JaceAge 3.0c) TIA morningdew 8:03:46 JTS-EServerSocket1: Starting new conversation with 8:03:46 JTS-EServerSocket1: Client version is 1 8:05:55 JTS-Dispatcher: Error: No EC for req tag 109 handling market data 8:05:55 JTS-Dispatcher: Exception caught while dispatching java.lang.NullPointerException at jclient.em.d(em.java:166) at jclient.ch.d(ch.java:2994) at jclient.ch.g(ch.java:1189) at jclient.ch.a(ch.java:1231) at jconnection.h.a(h.java:207) at jconnection.h.run(h.java:57)
I know this topic has been tossed around a few times.. but the threads are so long now that I can't find what the final say is about the order id # in the activeX... it appears that the activeX "remembers" the last id # even for the previous run. and therefore next time it fires up I need to manually set the starting # large enough... is there anyway to initialize it so it always start from the same number? What is your experience with this issue? Thanks.
Unless they changed it the last id is remembered in the user.ini file. The id is fabricated from the raw date/time number so each day is higher. In addition a rolling count of 0 to 10 is added to it to keep multiple orders placed at the same time from having the same id. So you can change the user.ini field each day or use IB's system.
Dozu, I'm not shure if you found the answer already, it's been a few days... Anyway, look closer at the VBA code within the TWS Spreadsheet. There you'll find a function that generates an unique id number... it's all in there. I hope this helps Jaba
As others have said, the last order ID that the TWS saw is stored in the <JTSHomeDirectory>\????????\user.ini file, in the DdeId item. In my spreadsheet, I simply keep the last Id I use in a specific cell, and have my order sending function get its IDs from: Public Function GetId() As Long Cells(1, 29).Value = Cells(1, 29).Value + 1 GetId = Cells(1, 29).Value End Function Hint: Make sure to set your starting ID to at least a 7-digit number (e.g. 1000000). The comparison in the TWS is broken (or used to be, anyway), using an alpha comparison instead of a numeric one. It thinks that 123 is greater than 1000. If you start at 1000000, you can send a lot of orders before you have to worry about it Of course, this is a problem if you have multiple spreadsheets, but you can get around that by putting the counter in a spreadsheet by itself, and then loading that with each of the others, as long as you don't run more than one at the same time. Hmmm. Even that may be possible.
I'd like to get some help to fix my VB program. IB Activex component is used in my VB program, I put some code in Event handlers including updateAccountValue and openOrder1, and the program runs ok. But if I reload the project next time, VB no longer recognizes those handlers(they are marked as red), and I have to recreate subs. Anyone has any idea about this?
Sounds like the OCX is somehow becoming unreferenced. Are you saving before you exit? Are you using a trial version of VB that doesn't allow you to save references? Are you deleting the reference or renaming your OCX object? Did you switch from using no index # on your OCX to using an index # (control array)? Very strange.
TriPack Only three events (updatePortfolio, updateAccountValue and openOrder1) have this problem, other events like tickprice and orderstatus are just fine. I use VB 6, not trial version. My program is very simple, only one IB activex control is in form, and I don't use array, and ocx name is not changed either. Do I need to specifically select something for IB activex in Referces window(menu: Project->References)? I didn't see TWS control listed there.
Try deleting the IB ActiveX control off your form then putting it back on the form. You may have upgraded the TWS to a newer version OCX than the one that was placed on your form initially.