SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sat Feb 29, 2020 1:14 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: BrokerInfo Updated Event
PostPosted: Sat Sep 25, 2010 7:27 pm 
Offline

Joined: Wed Mar 10, 2010 1:42 am
Posts: 63
Hello,

I am looking for an event that fires when my BrokerInfo gets updated from IB's TWS. Is there an event for this?

Currently, when each order is filled I have it grab the new cash balance from the DataManager.GetBrokerInfo("IB") method, but this isn't being updated on/after every position fill immediately! I'm assuming that this is because IB's TWS is delayed in letting OQ know about the new update?

I saw the event: OnActiveChanged(), what exactly has to take place for this event to be triggered?

Thanks in advance!


Top
 Profile  
 
PostPosted: Sat Sep 25, 2010 8:13 pm 
Offline

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

other broker APIs don't update BrokerInfo information in real time, you rather need to ask for it every time you want to get an update, thus we don't have such event in OpenQuant.

Why don't you want to set up a timer in your strategy and check for your account update in OnTimer event handler?

Regards,
Anton


Top
 Profile  
 
PostPosted: Mon Sep 27, 2010 2:25 am 
Offline

Joined: Wed Mar 10, 2010 1:42 am
Posts: 63
Hello Dr. Fokin,

So how do i "ask" for it within OQ? Is there a specific method for that?

I'd rather not code a hourly probe method if I don't have to. I'd like to have it so that when I need it I can get it, since I am keeping an internal cash counter. I do this because If i get filled in lets say 5 positions at the same time, I can internally calculate the sequential order in which they were filled. If i rely on IB, sometimes the cash balance that OQ returns won't be updated until the 3rd "OnOrderFilled() event" happens, then on the 4th "OnOrderFilled() event" the cash balance will suddenly decrease by all 5 positions in an instant.

...hoped that made sense haha. anywho, is there a way to force OQ/IB TWS to update the cash balance?

Thanks!


Top
 Profile  
 
PostPosted: Mon Sep 27, 2010 4:24 pm 
Offline

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

OQ updates BrokerInfo record when it receives a corresponding message from IB, so there is no need to force OQ. Whenever you call DataManager.GetBrokerInfo(), you receive updated information.

And I have no idea how you can force IB :D

Regards,
Anton


Top
 Profile  
 
PostPosted: Sat Jul 30, 2011 9:40 pm 
Offline

Joined: Mon Jan 07, 2008 6:18 am
Posts: 58
soooo.... what does OnActiveChanged do?


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 3 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:  
Powered by phpBB® Forum Software © phpBB Group