IB ActiveX

Originally posted by TriPack
I made a simple test application to try out the new ActiveX OCX. It is very simple to get up and running and the documentation is straightforoward. I was hoping that not only would it allow more reliable communications but also FASTER transmission of data. When I compared quotes this morning I noticed that the ActiveX quotes were consistently lagging behind the DDE quotes (which themselves aren't as fast as I would like.) Can someone verify if they are receiving the same results?

That quote feed performance would suffer in an OCX implementation compared to DDE is something that was clear even before they released the OCX. COM adds lots of additional abstraction layers compared to DDE which is actually a very efficient window message based protocol. There is absolutely no reason to switch to the OCX if you just want quotes. (MS is pushing a new COM-based technology for streaming data delivery called RTD that is supposed to supercede the traditional DDE links into applications like Excel. However, this requires special COM interfaces to be implemented and is only supported starting with Excel XP).


The online manual states that the ActiveX OCX receives quotes updated every second. This is fine because the TWS only updates every second. However it appears that there is a separate timer working for the ActiveX control than for the TWS. This means that the additional delay due to unsynchronized timers is between 0 and 1 second. It would be nice if the TWS could use the same timer loop (or somehow synchronize to the TWS timer) to fire off quotes to the ActiveX OCX, rather than just operating independently.

I believe the OCX is simply a wrapper around the socket API that IB released along with it. It probably uses a Windows timer that triggers once per second to check the socket for incoming data. I guess your best bet is to use the socket API directly which allows you to implement your own polling mechanism and approximate synchronization by polling e.g. every 1/10 second.

But why not stick with DDE in the first place? From what I've seen so far, the OCX does not add anything that the DDE interface does not already provide. And DDE is fast, efficient and easily programmed from C++ as well as applications like Excel.

The biggest gripe I have with the API is that ID management is not internalized within TWS and exposed through methods like GetNewID(). The current implementation renders the concurrent use of multiple applications that don't explicitly synchronize their use of IDs with each other impossible. I had hoped that this would change with the OCX and socket API, but I guess not.

Dave
 
I opened TwsActiveX.xls and clicked "connect", got error message from IB : "Can not accept connection request from host 127.0.0.1/127.0.0.1" and I clicked "ok", got error message in Excel "The TWS is out of date and must be upgraded".

I'm running build 752.6, the TwsDDE.xls works fine. Any idea? Thanks.
 
I just emailed ernie at help desk today with exactly this problem.

I got reply:

"I'm going to bring this issue to the development department and see what they add to clarify where the problem is with this.....I'll drop you a note when I hear back from them."

I will post this board when I hear a solution.

Until then the DDE link works. Some people, like me, though have to delete the following directory once a day to ensure that DDE works. Unfortunately that erases your TWS settings.

C:\jts\diqfsdyr
 
Originally posted by Funster

Until then the DDE link works. Some people, like me, though have to delete the following directory once a day to ensure that DDE works. Unfortunately that erases your TWS settings.

C:\jts\diqfsdyr

You're probably reusing old transaction IDs. TWS enforces the use of unique and ascending ID values even across sessions. To do this on every exit TWS stores the last used ID value in the DdeId= line in the user.ini file.
 
Originally posted by Funster
I just emailed ernie at help desk today with exactly this problem.

I got reply:

"I'm going to bring this issue to the development department and see what they add to clarify where the problem is with this.....I'll drop you a note when I hear back from them."

I will post this board when I hear a solution.

Until then the DDE link works. Some people, like me, though have to delete the following directory once a day to ensure that DDE works. Unfortunately that erases your TWS settings.

C:\jts\diqfsdyr

That's kind of like replacing your whole house when a window is broken :-)

Insted of removing that directory and it's contents (and spending hours reconfiguring), while TWS is not up, edit the user.ini file within that directory that you mentioned. Search for the line:

DdeId=xxxxxxxx

and remove that line. The next time you start TWS, it will accept orders with any id.
 
I just thought some of you might be interested ... I am using the ActiveX control in a PowerBuilder application and so far it seems to work fine. I am still in the testing stage but hope to go live with an automated trading system (ATS) by the end of this week.

I originally designed the ATS to work with DDE, decided to make the switch to ActiveX because I could connect directly with TWS without going through excel.

Unnecessary complexity makes me nervous :)

M
 
Hi,skerbitz

What's your IB version? I got same error in twsActivex.xls and VB program using tws.ocx. What's your upgrade path of the IB? Thanks
 
I believe the OCX is simply a wrapper around the socket API that IB released along with it. It probably uses a Windows timer that triggers once per second to check the socket for incoming data. I guess your best bet is to use the socket API directly which allows you to implement your own polling mechanism and approximate synchronization by polling e.g. every 1/10 second.

Why poll at all? It would be way better for TWS to implement a Model View Controller metaphor (Pattern for those that like that word.) This way, TWS just calls the function in all the Views that are registered with it every time an event occured (bid changed, last changed, etc.) This saves a heck of a lot of usless polling.

But why not stick with DDE in the first place? From what I've seen so far, the OCX does not add anything that the DDE interface does not already provide. And DDE is fast, efficient and easily programmed from C++ as well as applications like Excel.

I don't know much about DDE. I was able to get stuff working with VB (which I didn't know anything about either, but VB is really easy.) Would you be willing to share a trivial program that communicates with TWS in C/C++ that does simple things (quotes, orders, etc) ?

The biggest gripe I have with the API is that ID management is not internalized within TWS and exposed through methods like GetNewID(). The current implementation renders the concurrent use of multiple applications that don't explicitly synchronize their use of IDs with each other impossible. I had hoped that this would change with the OCX and socket API, but I guess not.

Dave

I have not made up my mind if I dislike this. The freedom to implement it myself may become useful in the future. The best of both worlds would be to implement it in TWS, but allow the programmer to "Hook it." This way, you can just use a working default.

nitro
 
Originally posted by dlincke


That quote feed performance would suffer in an OCX implementation compared to DDE is something that was clear even before they released the OCX. COM adds lots of additional abstraction layers compared to DDE which is actually a very efficient window message based protocol. There is absolutely no reason to switch to the OCX if you just want quotes. (MS is pushing a new COM-based technology for streaming data delivery called RTD that is supposed to supercede the traditional DDE links into applications like Excel. However, this requires special COM interfaces to be implemented and is only supported starting with Excel XP).

Dave

Funny you mention RTD ("Real Time Data"). I tried it when it was first available, and it is anything but what its name implies -- it only updates every few seconds. At least the sample programs. Crap.
 
Originally posted by klin
I opened TwsActiveX.xls and clicked "connect", got error message from IB : "Can not accept connection request from host 127.0.0.1/127.0.0.1" and I clicked "ok", got error message in Excel "The TWS is out of date and must be upgraded".

I'm running build 752.6, the TwsDDE.xls works fine. Any idea? Thanks.

Hi Klin and others,

Has anyone had a resolution to this problem? I still get this problem, and have tried installing and uninstalling to no avail. Also tried emailing help@..., also to no avail. (In fact, I didn't get any kind of response beyond the new auto-responder .)

I am running Windows 2000, and also build 752.6. I think somebody else mentioned about this problem on their Win2k boxes.

Has anyone had this problem under NT or 98?

Has anyone on Win2K had the ActiveX work??

Thanks everyone! :-)
 
Back
Top