Z Spread
Function Z Spread within Bond with keys Bond Z Spread keysreturns the Z-spread of the referenced bond as of a given reference date Tˢ
Several values may be also returned here in the form of a 1D-array
Here the Z-spread is defined as the single rate z that when added to the time-dependent "risk-free" rate r, produces the time-dependent rate r+z, which when used to discount all future bond cash flows down to time Tˢ, the resulting present value equals the given dirty bond price at the same time Tˢ
This function requires the input of a "risk-free" curve - a treasury or swap curve - that is used to imply the time-dependent rate r.
It also needs the bond clean price as of time Tˢ, so that the respective dirty price can be calculated.
If the settlement date Tˢ is not explicitly given, it will be set to the bond's settlement date as implied by a trade transaction assumed to occur on the trade dateT₀ (typically today).
PRECAUTION: This function treats the referenced bond as if it were a fixed rate bond even if this is not the case!
All index-linked cash flows are treated as fixed cash flows that pay the amount forecasted by the corresponding curve.
