SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Nov 25, 2020 12:18 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: reconnect. seriously
PostPosted: Thu Apr 23, 2009 5:44 am 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 5:13 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 5:45 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 5:57 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 6:27 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 7:27 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 23, 2009 8:36 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
A good idea. We wanted to introduce command line parameters a long time ago ...

Regards,
Anton


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 24, 2009 8:49 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 26, 2009 8:47 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 28, 2009 8:06 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
Thank you Anton,
Will be waiting for this one :)
Slava


Top
 Profile  
 
PostPosted: Mon Jul 20, 2009 4:53 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 24, 2009 4:13 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
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

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 26, 2009 11:28 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 27, 2009 5:13 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
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

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 01, 2009 7:11 pm 
Offline

Joined: Fri Mar 28, 2008 6:28 pm
Posts: 36
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group