Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Bond calculator - cash flow

How is it possible to create the "norm factor" and "residual amount usd" column in bond calculator cash flow section using Eikon API or codebook? If so, is it possible to have these columns for multiple bond ISINs?

1713196345294.png


eikon-data-apiworkspace#technologybondscodebookipa
1713196345294.png (268.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
6.1k 21 3 6

Hi @asli.sahin,

For such information, I would advise using the IPA service. You can reach it in Python in CodeBook if needed. For more information on it, please see:

Bond Contracts: Documentation | Devportal (lseg.com)

Cash Flow Definitions: Documentation | Devportal (lseg.com)

A example showcasing IPA at play can be found on CodeBook under:

__Examples__/03. Quantitative Analytics/03.03. Bonds/Bond_Pricing.ipynb

1713254413988.png


1713254413988.png (62.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 0

Hi Thanks,

With the IPA financial contracts page I checked bonds: https://developers.lseg.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-platform-apis/documentation/manuals-and-guides/ipa-financial-contracts/ipa-financial-contracts---bond-contracts

But find it hard to understand where to find these two columns : Norm. Factor and Residual Amount USD.

Below excel, it is possible to bring the data with the underlined formula.

Thanks.

1713258893055.png

1713258855594.png



1713258893055.png (64.4 KiB)
1713258855594.png (102.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
81.1k 264 53 76

@asli.sahin

It should be this code.

response = bond.Definition(
    instrument_code = 'US1536637036',
    fields = [
        "CashFlowDatesArray",
        "CashFlowResidualAmountsInDealCcyArray"
    ]
).get_data()
response.data
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you. With your example, it bring the below.

Am I missing something here? Thank you.

1713957240115.png

1713957240115.png (153.2 KiB)
Upvotes
81.1k 264 53 76

@asli.sahin

It returns the raw json response so you need to reformat it. For example:

response = bond.Definition(
    instrument_code = 'US1536637036',
    fields = [
        "CashFlowDatesArray",
        "CashFlowResidualAmountsInDealCcyArray"
    ]
).get_data()

dict = {response.data.raw["headers"][0]["name"]: response.data.raw["data"][0][0], response.data.raw["headers"][1]["name"]: response.data.raw["data"][0][1]}

df = pd.DataFrame(dict)
df

The output is:

1714028592293.png



1714028592293.png (14.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, Many thanks.

If this was for a group of bonds. How can we adjust the code please?

I tried a few variations but it didn't work. Many thanks.

@asli.sahin

Please share the code you are using.

Hello, how would the code change if it is for multiple instruments? Could you please share an example with multiple instruments? Many thanks.
Upvotes
1 0 0 0

Also, if I would like to add the below in excel, how would the code be?

1714053367482.png


1714053367482.png (11.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It is similar to the rd.get_data method.

rd.get_data(["153663703="],["TR.REDAMT"])

Or,

rd.get_data(["153663703="],["TR.REDAMT"],
            {"SDate":"","EDate":""})

You can use the Data Item Browser tool to check for fields and parameters.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.