SmartQuant Discussion
http://www.smartquant.com/forums/

reconnect. seriously
http://www.smartquant.com/forums/viewtopic.php?f=44&t=7393
Page 1 of 2

Author:  SlavaNY [ Thu Apr 23, 2009 5:44 am ]
Post subject:  reconnect. seriously

Hi,
it is no secret that TWS sometimes loses connectivity to IB due to many different nuanced reasons. Usually TWS reconnects. Sometimes it does not. Now, in this case I can still do the following: send myself an email and wake up at 3 am or try to do force reconnect: i.e. if after some time (lets just say 2 minutes) TWS is still disconnected from IB, I can a) shutdown TWS as a process, b) can start new TWS and do auto-login (see TWSAPI yahoo group), and as a final step c) I need OQ to reconnect as well to TWS. And here I hit the snag: ExecutionProvider is a string in OQ.. I cant seem to be able to access 'Providers' list programmatically, the only way I can think about now is to emulate keystrokes/mouse clicks on OQ window to try do clean reconnect, which strikes me as very ineffective.
So here is my simple question: how can I reconnect from Strategy to a new instance of TWS? it should not be that mind-boggling..
Regards,
Slava

Author:  Dr. Anton Fokin [ Thu Apr 23, 2009 5:13 pm ]
Post subject: 

The problem is that all internal OQ providers, including IB TWS provider, are native SQ framework providers and not OQ custom providers, i.e. there is no class in OQ API that corresponds to IB TWS.

Another issue is that you not only need to re-connect to IB TWS from OQ to make your strategy run again, you also need to re-send market data requests and synchronize your orders, etc.

Though it's possible to add provider wrappers to OQ API that will call Connect/Disconnect.

Regards,
Anton

Author:  SlavaNY [ Thu Apr 23, 2009 5:45 pm ]
Post subject: 

Hi Anton,
thanks for reply.
Could you please point me on how to add wrappers to OQ API to implement these Connect/Disconnect/Sunscribe/Unsubscribe messages?

How can custom wrapper/plugin re-use existing functionality of native provider and extend it - obviously I dont want to re-implement all the functionality, I just need to extend it. Ideally ExecutionProvider would be a class instance with just methods I would be able to call

Regards,
Slava

Author:  Dr. Anton Fokin [ Thu Apr 23, 2009 5:57 pm ]
Post subject: 

I meant it's easy for _us_ to add a wrapper class with Connect/Disconnect methods instead of current string version of Strategy.Provider property. I don't think we will ever add subscribe / unsubscribe and all other functionalities since it will require all other infrastrucutre copied to OpenQuant API from underlying framework.

Basically you need QuantDeveloper framework from QuantHouse to do what you want. Alternatively you may implement your custom provider that will do reconnect behind the scene.

Regards,
Anton

Author:  SlavaNY [ Thu Apr 23, 2009 6:27 pm ]
Post subject: 

Anton,
would you please consider addition of Connect/Disconnect to ExecutionProvider in some future 0.01 release if that is really easy for you? I just lost 2 nights of trading because TWS 'went gray' and never came back. I can relaunch TWS auto-magically, but my hands are tied on OQ->TWS side

Regards,
Slava

Author:  SlavaNY [ Thu Apr 23, 2009 7:27 pm ]
Post subject: 

or alternatively is it possible to start an OpenQuant with command line parameters so it would automatically go into live mode and start a strategy?

Author:  Dr. Anton Fokin [ Thu Apr 23, 2009 8:36 pm ]
Post subject: 

A good idea. We wanted to introduce command line parameters a long time ago ...

Regards,
Anton

Author:  SlavaNY [ Fri Apr 24, 2009 8:49 pm ]
Post subject: 

Hi Anton,
thank you for your replies,
so would it be reasonable to expect Connect/Disconnect and/or command line parameters in some future OQ release?
Regards,
Slava

Author:  Dr. Anton Fokin [ Sun Apr 26, 2009 8:47 pm ]
Post subject: 

I guess the answer is "yes / soon" for the command line params and "no / I am not sure" for Connect/Disconnect. As I've mentioned Connect/Disconnect would not solve the reconnect problem but would create a lot of confusion instead.

Regards,
Anton

Author:  SlavaNY [ Tue Apr 28, 2009 8:06 pm ]
Post subject: 

Thank you Anton,
Will be waiting for this one :)
Slava

Author:  SlavaNY [ Mon Jul 20, 2009 4:53 pm ]
Post subject:  Quotes stopped flowing. Reconnect issue again

Hi,
I had quotes stopped feeding into my application twice for the last two weeks. I can detect the situation by essentially having a timer firing every minute, and sending an email if no quote change occurred in the last 15-20 minutes. Although it has been discussed here several times, there is no way for me to programmatically reset OQ <-> IB connection when this happens.
Yes, you need to resubscribe to the instruments, but I dont see how it is so difficult. Alternatively, you can expose subscribe API, so I can do it from my strategy.
If you look at the forum history and search for "reconnect", people are asking for the feauture for about 1.5 years now.. Saying "It is an IB fault, and therefore we are going to do nothing about it" does not sound too seriously IMHO.

Alternatively, if OQ does not want to provide reconnect functionality, I would like to have some explanation/guidelines on what I am supposed to do as a developer when OQ <-> IB link is broken. It does not matter where the problem has originated, in automated trading solution there should be a way to deal with it.

Please treat it as a support request, not as a general question to the forum
Regards,
Slava

Author:  Alexei Kurov [ Fri Jul 24, 2009 4:13 pm ]
Post subject: 

Hello All,

The data link broken/restored issue(between IB and TWS) is not a reason of the problem.
Please, see the following videos:
http://www.smartquant.net/video/ib_auto_reconnect/ib_auto_reconnect.html
and
http://www.smartquant.net/video/ib_auto_reconnect2/ib_auto_reconnect2.html

Regards,
Alex

Author:  SlavaNY [ Sun Jul 26, 2009 11:28 pm ]
Post subject: 

Hi,
I agree with you, the problem is not wit TWS <-> IB link,
it is in OQ <-> TWS link - that is actually what my post of July,20 was about, sorry for not making it clear.
So how does OpenQuant team advises to deal with these problems in an automated solution?

Regards,
Slava

Author:  Alexei Kurov [ Mon Jul 27, 2009 5:13 pm ]
Post subject: 

Hi Slava,

Ok, we will try to find a way to add such(manual reconnect provider from the strategy code) functionality to the OQ API.

Regards,
Alex

Author:  SlavaNY [ Tue Sep 01, 2009 7:11 pm ]
Post subject: 

Hi,
any hint when that would happen?

Also, Anton said sometime in May that command line OQ is in the works.
Could you give updates on that as well?

Regards,
Slava

Page 1 of 2 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/