SetHistoricPrices

Inputs (Array of PriceDateEntry)

NameTypeDescriptionMandatoryDefault valueAvailable from versionComment
PriceDateEntries[]PriceDateEntry[]Array of PriceDateEntriesYes


ClearAllPreviousDataboolClears all data previous to the first date in the range in PriceDateEntries.Nofalse2.23 
ClearPreviousDataByRangeboolClears all data between the first and the last date in the rangeNofalse2.23
UpdateCurrentPriceFromLastPriceboolUpdate the price on the instrument from the last date in the range in PriceDateEntriesNofalse2.23 Feature change from 2.23. If you want to update the price with the latest price, the property must be set to true.
Included in NuGet package version 1.1.1 and above https://www.nuget.org/packages/Bricknode.Soap.Sdk/
ClearAllsubsequentDataboolClears all data after the last date in the range in PriceDateEntries.Nofalse2.23 

PriceDateEntry

NameTypeDescriptionMandatory
AssetIdGuidThis is the unique id of the asset that should be updatedYes
PricedoubleThe new price of the assetYes
PriceDateDateTimeThe date that the new price will be in useYes

Outputs

NameTypeDescription
MessagestringA message indicating if something went wrong during the call or not

Code examples

C# - SetHistoricPrices
//Use SetHistoricPrices to add quote history to an instrument
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 response = client.SetHistoricPrices(new BFSServiceReference.SetHistoricPricesRequest()
{
    Credentials = credentials,

    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS    

    PriceDateEntries = new PriceDateEntry[]
    {
        new PriceDateEntry()
        {
            AssetId = new Guid("7f1478ff-62a8-42a5-bff5-8487f72d7861"),
            Price = 100,
            PriceDate = DateTime.UtcNow,
        },
        new PriceDateEntry()
        {
            AssetId = new Guid("7f1478ff-62a8-42a5-bff5-8487f72d7861"),
            Price = 100,
            PriceDate = DateTime.UtcNow.AddDays(-1),
        },
        new PriceDateEntry()
        {
            AssetId = new Guid("7f1478ff-62a8-42a5-bff5-8487f72d7861"),
            Price = 100,
            PriceDate = DateTime.UtcNow.AddDays(-2),
        }
    }

});

Console.WriteLine(response.Message);


Blog stream

Create a blog post to share news and announcements with your team and company.

Related pages

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