About Financial Contracts Bond
In this page we exemplify several ways of using bond definitions to retrieve bonds data.
Syntax
Bond.Definition(params string[] instrumentCodes) Bond.PricingDefinition() Bond.AmortizationItemDefinition(double amount)
Usage
The following examples demonstrate how to create various definitions for Bond financial contracts:
- A definition for a single bond with defaults
using LSEG.Data.Content.IPA;
var data = Bond.Definition("US10YT=RR").GetData();
`
- A definition for multiple bond instruments, requesting a subset out of all available fields.
using LSEG.Data.Content.IPA;
var data = Bond.Definition("US10YT=RR", "US20YT=RR")
.Fields("InstrumentCode", "BondType", "EndDate", "CouponRatePercent")
.GetData();
- A definition for a single bond using various property methods.
Some of these property methods require enumeration values as parameters.
The enumeration types used by the property methods are described in the related pages below.
using LSEG.Data.Content.IPA;
var data = Bond.Definition().InstrumentCode("US10YT=RR")
.IssueDate("2002-02-28")
.EndDate("2032-02-28")
.NotionalCcy("USD")
.InterestPaymentFrequency(Bond.IndexFrequency.Annual)
.FixedRatePercent(7)
.InterestCalculationMethod(Bond.DayCountMethods.Dcb_30_Actual)
.PricingParams(Bond.PricingDefinition().CleanPrice(102))
.Fields("InstrumentDescription", "InstrumentCode", "BondType", "RIC",
"Isin", "Ticker", "Cusip", "IssuePrice", "CouponRatePercent",
"CouponType", "CouponTypeDescription")
.GetData();
- An example of an invalid bond, where the instrument name can be invalid or unknown
using LSEG.Data.Content.IPA;
var data = Bond.Definition("JUNK")
.Fields("InstrumentCode", "BondType", "EndDate", "CouponRatePercent")
.GetData();
- A definition for a single bond using extended parameters to apply a single parameter
An equivalent would be to use a Bond defition method like the following:
" .PricingParams(Bond.PricingDefinition().BenchmarkAtIssueYieldPercent(44)) "
using LSEG.Data.Content.IPA;
var data = Bond.Definition("US10YT=RR").Fields("InstrumentCode", "BondType", "EndDate")
.ExtendedParams(new JObject()
{
["pricingParameters"] = new JObject()
{
["benchmarkAtIssueYieldPercent"] = 44
}
})
.GetData();