...
Code Block | ||
---|---|---|
| ||
//Use the GetHistoricPositions var client = new BFSServiceReference.bfsapiSoapClient(); var credentials = new BFSServiceReference.Credentials() { UserName = bfsusername, //Username of administrative user in your instance of BFS Password = bfspassword, //Password of the administrative user in your instance of BFS }; var positions = client.GetHistoricPositions(new BFSServiceReference.GetHistoricPositionRequest() { Credentials = credentials, identify = bfsidentifier, //Identifier is a unique token for your instance of BFS Args = new GetHistoricPositionArgs() { StartDate = new DateTime(2016, 04, 01, 0, 0, 0, DateTimeKind.Utc), EndDate = new DateTime(2016, 04, 20, 0, 0, 0, DateTimeKind.Utc), DisplayCurrencyCode = "USD", AccountDimensionKey = "T", Accounts = new[] { new Guid("40045f57-9914-41d2-9ffd-a33a59de10c9"), } }, Fields = new BFSServiceReference.GetHistoricPositionFields() { Account = true, AccountNo = true, AccountDimensionKey = true, Amount = true, Asset = true, AssetType = true, BalanceDate = true, BaseRate = true, DisplayCurrencyCode = true, DisplayRate = true, FxRate = true, MarketValue = true, MarketValueAccountCurrency = true, MarketValueDisplayCurrency = true, Price = true }, }); foreach (var c in positions.Result) { Console.WriteLine(c.Account + ", " + c.AccountNo + ", " + c.AccountDimensionKey + ", " + c.Amount + ", " + c.Asset + ", " + c.AssetType + ", " + c.BalanceDate + ", " + c.BaseRate + ", " + c.DisplayCurrencyCode + ", " // + c.FxRate + ", " + c.MarketValue + ", " + c.MarketValueAccountCurrency + ", " + c.MarketValueDisplayCurrency + ", " // + c.Price + ", " + c.MarketValue); } |
XML - GetHistoricPositions example request
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"> <soap:Body> <GetHistoricPositions xmlns="http://tempuri.org/"> <req> <Credentials> <UserName>{{username}}</UserName> <Password>{{password}}</Password> </Credentials> <identify>{{identifier}}</identify> <Args> <Accounts> <guid>[Guid of the account]</guid> <guid>[Guid of the account]</guid> </Accounts> <StartDate>[The start date]</StartDate> <EndDate>[The end date]</EndDate> <AccountDimensionKey>[The account dimension T or S (Trade/Settle)]</AccountDimensionKey> <DisplayCurrencyCode>[The currency code. For example USD]</DisplayCurrencyCode> </Args> <Fields> <BrickId>true</BrickId> <Asset>true</Asset> <CreatedDate>true</CreatedDate> <Account>true</Account> <AccountNo>true</AccountNo> <BalanceDate>true</BalanceDate> <Amount>true</Amount> <AccountDimensionKey>true</AccountDimensionKey> <Price>true</Price> <FxRate>true</FxRate> <BaseRate>true</BaseRate> <MarketValue>true</MarketValue> <MarketValueAccountCurrency>true</MarketValueAccountCurrency> <MarketValueDisplayCurrency>true</MarketValueDisplayCurrency> <DisplayRate>true</DisplayRate> <AssetType>true</AssetType> <DisplayPercentagePrice>false</DisplayPercentagePrice> <IncludeZeroes>true</IncludeZeroes> </Fields> </req> </GetHistoricPositions> </soap:Body> </soap:Envelope> |
...