GetHoldingsOverTime

Filter inputs

NameTypeDescriptionMandatoryAvailable from version
StartDateTimeStart of the period True
EndDateTimeEnd of the Period True
DisplayCurrencyCodestringEnter what currency in ISO-format that the results should be calculated in (defaults to SEK)

AccountsGuid[]An array of accounts to include in the calculation

AssetsGuid[]An array of assets to include in the calculation (leave empty to include all assets for the accounts)

PercentageReturnBoolChoose if return values should be in actual value or as a percentage of the change

Response rows (Array)

NameTypeDescriptionAvailable from version
ValueDecimalThe value of the data point
DateDateTimeThe date of the data point

Code examples

C# - Get holdings over time for a specific account
var request = new GetHoldingsOverTimeRequest()
{
    //Fields = new GetHistoricPositionFields(),
    Fields = new GetHoldingsOverTimeResponseFields(),
    // Args = new GetHistoricPositionArgs()
    Args = new GetHoldingsOverTimeArgs()
};

request.Credentials = CorrectCredentials();
request.identify = CorrectIdentify();
request.Fields = new GetHoldingsOverTimeResponseFields()
{
    Date = true,
    Value = true
};
request.Args = new GetHoldingsOverTimeArgs()
{
    Start = new DateTime(2017,12,31),
    End = new DateTime(2018, 8, 28),
    DisplayCurrencyCode = "SEK",
    PercentageReturn = true,
    Accounts = new Guid[] {Guid.Parse("<BFS Id for a specific account>"), }
};

var response = client.GetHoldingsOverTime(request);
foreach (var responseRow in response.Result)
{
    Console.WriteLine($"Date: {responseRow.Date:yyyy-MM-dd}\tValue: {responseRow.Value:P2}");
}

Terms of License
Change Policy
© 2009 - 2024 Huddlestock Technologies AB All rights reserved