SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Sep 21, 2018 9:29 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Feb 08, 2013 12:05 am 
Offline

Joined: Tue Jan 08, 2013 12:01 pm
Posts: 12
Hi,

We have written a custom provider for OpenQuant. We need to find out how to pass Account PNL, instrument position and PNL updates from the broker back to OQ. For data and orders we have the Emit*() methods available but we couldn't find anything for PNL and account.

1. Does OQ manage the position and PNL based on the executions it received from broker i.e. EmitFilled().?
2. If yes then, orders opened using the external broker interface won't be reflected in OQ's orders. Correct?
3. The numbers won't reconcile.

It looks like the BrokerAccounts and BrokerPosition classes may be useful in this scenario but we are not entirely sure how to go about this.

Thanks,
Aziz


Top
 Profile  
 
PostPosted: Fri Feb 08, 2013 9:54 am 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Hi,

1. yes
2. yes

In scenario code (and in the strategy code too) you are able to request BrokerInfo. In your custom plugin you implement virtual GetBrokerInfo method and return the necessary information.

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Fri Feb 08, 2013 12:11 pm 
Offline

Joined: Tue Jan 08, 2013 12:01 pm
Posts: 12
Sure, we'll try that out.

Thanks,
Aziz


Top
 Profile  
 
PostPosted: Fri May 17, 2013 3:08 pm 
Offline

Joined: Tue Jan 08, 2013 12:01 pm
Posts: 12
Hi Alexei,

Currently we have taken the following steps.

1. Created and initialized BrokerInfo instance in UserProvider class.

2. When a broker info event arrives like PNL update, we add a custom field to the instance:
Code:
instance.Accounts[UserName].Positions[0].AddCustomField("PNL", oInfo.ClosedPnl.ToString());

3. Override the GetBrokerInfo() function to return the instance.
Code:
protected override BrokerInfo GetBrokerInfo()
        {
            return instanc;
        }


NOTE: instance.AddAccount(UserName) throws an exception that it already exists in the dictionary so we figured it is not required.

Can you confirm these are the correct steps or we are on the wrong direction? We are not seeing any information in the accounts drop down in the broker info. Please guide us to the correct path.

Thanks,
Aziz


Top
 Profile  
 
PostPosted: Fri May 17, 2013 3:45 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Hi Aziz,

BrokerInfo window does not update its content automatically - try to refresh it manually.
Also, make sure that your plugin is selected as Execution Provider of the current Mode.

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Wed May 22, 2013 10:35 am 
Offline

Joined: Tue Jan 08, 2013 12:01 pm
Posts: 12
Thanks Alexey, this seems to work.


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 4 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