SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Oct 14, 2024 8:36 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Sep 17, 2011 1:19 am 
Offline

Joined: Wed Aug 24, 2011 7:11 pm
Posts: 42
Hi there,

I'm writing my own code to push trades from OQ to database. Part of this involves connection to a message broker (AMQP) which runs on its own (internal) threads. I need an event of some kind when OpenQuant is shutting down as I need to dispose of the connection. Without this when OQ is closed my code & the messaging connection keeps the process alive.

I tried subscribing to Application.ApplicationExit but it doesn't fire. Is there anything else I can do to get an event or callback when OQ is closed by the user?

Thanks,


Top
 Profile  
 
PostPosted: Sat Sep 17, 2011 11:44 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Hi,

perhaps Alex will reply on Monday with some better idea, but I think you can try to put your code in a destructor of an object that is disposed on application close.

Regards,
Anton


Top
 Profile  
 
PostPosted: Sat Sep 17, 2011 3:45 pm 
Offline

Joined: Wed Aug 24, 2011 7:11 pm
Posts: 42
Currently I'm initializing my services in the static constructor of a base strategy which I then inherit in OQ strategies. Also I managed to get a shutdown event by subscribing to Application.ThreadExit and checking for synchronisationContext != null (which indicates the UI thread shutting down).

However, I think I'm going about this the wrong way.

Basically what I want to do is route completed orders to my own trade booking system for auditing purposes. It may be better for me to create an Execution Provider (which would have explicit Connect/Disconnect/Shutdown method calls) that first routes the order to broker (Interactive Brokers) and second to my own Trade Booking system if successfully filled.

Does this sound like a better plan?

I understand the Interactive Brokers execution provider isn't open sourced, would it be difficult to do the above?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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