How to correctly convert currency in PriceHistoryExtractionRequest

maximilian.syndikus
edited June 19 in DSS

Hi,

I need to programmatically convert historical EOD prices for ISINs over a certain time horizon to EUR.

I struggle to correctly apply the conversion when the prices are stated in a minor currency such as GBp.

Example: I want to convert the EOD prices of ISIN "GB0008706128" (Lloyds Bank) - which is
denominated in GBp - from 2025-06-16 to 2025-06-17 to EUR. I follow these steps:

Getting the EOD price timeseries
a) I get all the price history using a ExtractWithNotes request of type PriceHistoryExtractionRequest

Request

{    "ExtractionRequest": {        "@odata .type": "#DataScope.Select.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest",        "ContentFieldNames": [            "ISIN",            "RIC",            "Trade Date",            "Universal Close Price",            "Currency Code"        ],        "IdentifierList": {            "@odata .type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",            "InstrumentIdentifiers": [                {                    "Identifier": "GB0008706128",                    "IdentifierType": "Isin"                },                {                    "Identifier": "GBPEUR=R",                    "IdentifierType": "Ric"                }            ],            "ValidationOptions": null,            "UseUserPreferencesForValidationOptions": false        },        "Condition": {            "QueryStartDate": "2025-06-16",            "QueryEndDate": "2025-06-17",            "AdjustedPrices": true        }    }}

Response

{            "IdentifierType": "Isin",            "Identifier": "GB0008706128",            "ISIN": "GB0008706128",            "RIC": "LLOY.L",            "Trade Date": "2025-06-17",            "Universal Close Price": 75.74,            "Currency Code": "GBp"        }

As you can see the prices are stated in minor currency GBp (pence). So far so good. However before I can apply FX conversion based on the GBPEUR rate I need to convert the minor currency prices to major currency, i.e. I need a currency scaling factor.



Getting the Currency Scaling Factor
b) Before getting the FX close prices for the ric "GBPEUR=R" I need to get a scaling factor for the prices above to convert from minor to major currency and only then apply the FX rate. For this I send an ExtractWithNotes request of type CompositeExtractionRequest

Request

{    "ExtractionRequest": {        "@odata .type": "#DataScope.Select.Api.Extractions.ExtractionRequests.CompositeExtractionRequest",        "ContentFieldNames": [            "Currency Code",            "Currency Code Description",            "Currency Code Scaled",            "Currency Code Scaled Factor",            "Currency Code Scaled Description"        ],        "IdentifierList": {            "@odata .type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",            "InstrumentIdentifiers": [                {                    "Identifier": "GB0008706128",                    "IdentifierType": "Isin"                }            ],            "ValidationOptions": null,            "UseUserPreferencesForValidationOptions": false        },        "Condition": null    }}

And indeed the response carries the right conversion factor to convert from GBp to GBP

        {            "IdentifierType": "Isin",            "Identifier": "GB0008706128",            "Currency Code": "GBp",            "Currency Code Description": "British Penny",            "Currency Code Scaled": "GBp",            "Currency Code Scaled Factor": 100,            "Currency Code Scaled Description": "British Penny"        }

However this currency code scaled factor is only set (correctly) when I set the "ScalableCurrency" to false in the request conditions (or set the entire Conditions object to null as in the request above).

The problem is that when omitting the "ScalableCurrency" condition in the composite extraction request, the currency codes only show the minor currency. And if I set the "ScalableCurrency" condition then the major currency is shown under "Currency Code Scaled" but the "Currency Code Scaled Factor" is just 1.

"Currency Code": "GBp",            "Currency Code Description": "British Penny",            "Currency Code Scaled": "GBP",            "Currency Code Scaled Factor": 1,            "Currency Code Scaled Description": "British Pound",

So in order to get the major currency which I need to do the FX conversion to EUR later and to get the currency scaling factor from minor to major currencies I have to send two requests (one with the "ScalableCurrency" condition set and one without)

Is there a way to avoid having to send two requests?

Answers

  • Hello @maximilian.syndikus

    I see the same behavior - the condition scalable currency when applied shows the correct major currency, but incorrect scaling factor.

    Since this is a content issue, I would ask you to reach out to data content experts by opening a support ticket at LSEG MyAccount.