Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameTypeDescriptionAvailable from version

Account

GuidBfsId of the account
AccountNostringThe account number for the position
AssetGuidBfsId of the instrument
BalanceDateDateTimeThe balance date of the position
AmountdecimalThe amount of the position
AccountDimensionKeystringThe dimension of the positon, "T" for traded and "S" for settled

Price

doublePrice of instrument when position was required.
FxRatedoubleThis is the exchange rate used if DisplayCurrency is used. If the currency of the position is EUR and the DisplayCurrency is set to USD this is the exchange rate between EUR and USD
BaseRatedoubleThis is the exchange rate between the currency of the instrument and the base currency of the account.

MarketValue

doubleThe market value for the position.
MarketValueAccountCurrencydoubleThe market value for the position in the account currency. If instrument and account has the same currency this value is the same as MarketValue above.
MarketValueDisplayCurrencydoubleThe market value for the position according to display currency.

DisplayRate

doubleThe exchange rate between the position instrument currency and the DisplayCurrencyCode
AssetTypestringType of asset
DisplayPercentagePriceBoolIf price is in persentage of MinimumLotSizeDisplayMultiplierDecimalMultiplier used with price for display


Code examples

Code Block
languagec#
themeRDark
titleC# - GetHistoricPositions
linenumberstrue
collapsetrue
//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);
}

...