SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Dec 16, 2019 6:49 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Nov 11, 2019 3:23 pm 
Offline

Joined: Wed Aug 07, 2019 7:49 am
Posts: 20
Hi,

I'm having trouble with Framework.AccountDataManager.GetSnapshot(4);

It is not returning all the positions I see in IB TWS. All the positions in TWS have been created throught the TWS gui and I am using ClientId=0, so they should definately appear.
If you compare the two screenshots I've provided you will see my code below is not printing the AUD.CAD and AUD.JPY cfd positions.


IExecutionProvider provider = Framework.ProviderManager.GetExecutionProvider(MetaStrategy.ExecutionProvider.Id);
provider.Connect();
while (!provider.IsConnected) { }
AccountDataSnapshot accData = Framework.AccountDataManager.GetSnapshot(provider.Id);

foreach (AccountDataEntry entry in accData.Entries)
{
Console.WriteLine(entry.Account);

AccountData[] positions = entry.Positions;
foreach (AccountData position in positions)
{
Console.WriteLine();
Console.WriteLine($"{position}:");
foreach(AccountDataField accDataField in position.Fields)
{
Console.WriteLine($"{accDataField.Name}, {accDataField.Value}");
}

}
}
}


Am I missing something?


Attachments:
File comment: This image shows that my code did not print all the positions.
AccountDataSnapshot.PNG
AccountDataSnapshot.PNG [ 47.17 KiB | Viewed 278 times ]
File comment: This image shows my positions in TWS.
tws.PNG
tws.PNG [ 32.77 KiB | Viewed 278 times ]
Top
 Profile  
 
PostPosted: Wed Nov 13, 2019 2:11 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 562
Hi ambl,
how many accounts do you have?
I see only one 'DU1428200'.


Top
 Profile  
 
PostPosted: Fri Nov 15, 2019 4:21 am 
Offline

Joined: Wed Aug 07, 2019 7:49 am
Posts: 20
I have only 1 account. Its not retrieving all positions for DU1428200.


Top
 Profile  
 
PostPosted: Thu Nov 21, 2019 12:50 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 562
Hi,
fix will be available in next release.


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

All times are UTC + 3 hours


Who is online

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