Fixed Bond Pricing and Sensitivities


#1

Hello,
I’m new to Strata and found it very interesting at first sight. I was looking for pure Java financial library and this really seem to fit my needs.

My main need now is related to the pricing of a fixed vanilla bond. I explain what I need. Currently I have a portfolio of vanilla Euro fixed bond. My goal is to price those bonds, and to calculate interest rate sensitivities.

My input is a set of rate corresponding to the current Euro Swap curve used as the base to discount the bonds.

I would like to:

  1. Create a curve from those spot rate
  2. Calculate the static spread from a bond , so the spread to be put identical on each rate that discounting the flow give me the market price I need.
  3. Then I need to add/substract the shock I need from this spread in order to be able to calculate parallel interest rate sensitivites on the same bond.

Is this possibile in strata? any suggestion, code would be so appreciated.

thank you


#2

Hi FinanceGiu,

Welcome to Strata.

What you want to do is possible in Strata. Here are a couple of pointers related to your requests.

  1. Creating curves from the sport rate is done through the “CurveCalibrator”. This is a tool that allows you to calibrate the curves in a very flexible way. The best way to start using it is probably using one of the pre-build tests that act as examples. The simplest one is probably “CalibrationDiscountingSimple1Test”: https://github.com/OpenGamma/Strata/blob/master/modules/pricer/src/test/java/com/opengamma/strata/pricer/curve/CalibrationDiscountingSimple1Test.java

  2. Pricing and measures related to bonds are in the pricers “DiscountingFixedCouponBondTradePricer” and “DiscountingFixedCouponBondProductPricer”. In particular the computation of the spread you want (called Z Spread in the library) can be obtained with the method “zSpreadFromCurvesAndDirtyPrice”.

  3. It is possible to compute different interest rate sensitivities for the instruments (bonds in particular). You can compute zero-coupon (curve parameters) sensitivities or market rate (market quote) sensitivities. For bonds there is also the conventional modified duration (representing the change of price for a change of yield).

Marc


#3

Thank you. I’m starting with OpenGamma. Two quick question more.
Is pricing of Zero Coupon available too? Floating Rate Note are priced?

Thank you


#4

Hi Giuliano,

We have not implemented FRN into Strata at this stage.

For Zero Coupon bonds, we don’t have a specific instruments for that. You can create a FixedCouponBond with a fixedRate = 0. From a legal perspective this may be different from a pure zero coupon bond, but from a pricing and risk perspective it will be the same.

Regards,

Marc


#5

Thank you. Starting with examples from Strata.

Following this classic example of Bond pricing:

PeriodicSchedule accrualSchedule = PeriodicSchedule
.builder()
.startDate(issueDate)
.endDate(maturityDate)
.lastRegularEndDate(maturityDate)
.businessDayAdjustment(businessDayAdj)
.frequency(Frequency.P6M)
.stubConvention(StubConvention.SHORT_INITIAL)
.rollConvention(RollConventions.EOM)
.build();

FixedCouponBond fcb = FixedCouponBond
.builder()
	.accrualSchedule(accrualSchedule)
	.currency(Currency.CAD)
	.securityId(SecurityId.of("CUSIP", "135087WL4"))
	.notional(1000)
	.fixedRate(coupon)
	.dayCount(DayCounts.ACT_365_ACTUAL)
	.yieldConvention(FixedCouponBondYieldConvention.US_STREET)
	.legalEntityId(StandardId.of("LegalEntity", "DUMMY"))
	.settlementDateOffset(DaysAdjustment.ofBusinessDays(3, HolidayCalendarIds.CATO))
		.build();

ResolvedFixedCouponBond resolvedBond = fcb.resolve(ReferenceData.standard());

	yield = DiscountingFixedCouponBondProductPricer.DEFAULT.yieldFromDirtyPrice(resolvedBond, settlementDate, dirty);

what i’m missing from this example is where the curve to discount is considered? or it’s returning the IRR of the bond? in case I need to performe sensitivies and calculate the z-spread I need a discounting curve. I’m a bit confused on this.

Thank you