I downloaded and installed new TWS, created a new VB project, it still has the same problem. It is strange that updateAccountTime is ok while updateAccountValueis not.
I think you will find that the parameters in the events causing you trouble include one called "currency". VB objects to naming a a variable "currency". Just rename them "curency".
Yes, the "currency" parameter causes the problom. Those event handlers can be recognized again after renaming the parameter. Thank you.
I've heard that someone is selling a charting package based on the `IB data feed'. How ridiculous is that?
In the TWS example program I see the Order ID# calculated to a 100000+ number. I am just using nextValidID() at startup and then incrementing from there. Is there a problem with doing it this way? After the market closed I tried reqExecutions() for the first time. The executions came back thru OrderStatus, OpenORder1, and OpenOrder2, but they didn't seem to be in any particular order. Has any one else experienced this and is there some order to it?
Yes it´s a little bid tricky. After connect() you get the next ID-number with the ValidId() Event. If you invoke reqOpenOrders() or reqExecutions() to fill own spread sheets, this ID Number will be incremented with every new openOrder1 Event. I use something like newID:=MAX(lastID,IDEvent)+1 But the true stumbling stone is, that there in no possibility to get the uniquely transaction numbers. What we need do build own portfolio tracking are added fields in the OrderStatus event for "filled" notifications Transaction Number - Time stamp - commission A reqExecution Method with a date parameter would also be a nice headway. hope the IB guys hear my praying sincerely morningdew
I used API to place a stop limit order, TWS returned a message "The price does not conform to the minimum price variation for this contract", anyone knows what causes this problem? Thanks
One of the prices is not a valid price for the instrument you are buying/selling. U.S. options, for example, are priced in 0.05, 0.10 increments. Trying to use a price of 3.01 for an option will yield this message. Same goes for a price of 10.005 for a stock, 1166.123 for an ES contract, etc. If you're calculating the price, be sure to round it to two decimal places - this is a common issue with DDE/Excel. The price might appear to be correct when formatted to 2 decimals in the spreadsheet, but if you're adding/subtracting from a quote that came in via DDE, you'll see (if you format it with more decimal places) that the quote was off slightly, resulting in your order price also being off slightly.