| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Instrument.Bond
Synopsis
- type GenBond b = GenInstrument (AnyOf CBond' b)
- type Bond = GenBond CBond
- type GenFixedRateBond fb = GenBond (AnyOf CFixedRateBond' fb)
- type FixedRateBond = GenFixedRateBond CFixedRateBond
- type BTP = GenFixedRateBond CBTP
- type CPIBond = GenBond CCPIBond
- type CallableBond = GenBond CCallableBond
- type ConvertibleBond = GenBond CConvertibleBond
- data RendistatoBasket
- data RendistatoCalculator
- data BondPriceType
- data CPIInterpolationType
- data Discounting y
- data BpsDiscounting y
- data AmortizingFloatingRateBondOpts = AmortizingFloatingRateBondOpts {
- afrbPaymentConvention :: BusinessDayConvention
- afrbFixingDays :: Maybe Word
- afrbGearings :: [Double]
- afrbSpreads :: [Double]
- afrbCaps :: [Double]
- afrbFloors :: [Double]
- afrbInArrears :: Bool
- afrbIssueDate :: Maybe Day
- afrbExCouponPeriod :: (Int, TimeUnit)
- afrbExCouponCalendar :: Maybe Calendar
- afrbExCouponConvention :: BusinessDayConvention
- afrbExCouponEndOfMonth :: Bool
- afrbRedemptions :: [Double]
- afrbPaymentLag :: Int
- defaultAmortizingFloatingRateBondOpts :: AmortizingFloatingRateBondOpts
- asBond :: GenBond b -> IO Bond
- bond :: Word -> Calendar -> Maybe Day -> GenLeg l -> IO Bond
- fixedRateBond :: Word -> Double -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Double -> Maybe Day -> Calendar -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> DayCounter -> IO FixedRateBond
- btp :: Day -> Double -> Maybe Day -> Maybe Day -> IO BTP
- btpWithRedemption :: Day -> Double -> Double -> Maybe Day -> Maybe Day -> IO BTP
- zeroCouponBond :: Word -> Calendar -> Double -> Day -> BusinessDayConvention -> Double -> Maybe Day -> IO Bond
- floatingRateBond :: Word -> Double -> Schedule -> GenIborIndex ibor -> DayCounter -> BusinessDayConvention -> Word -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Double -> Maybe Day -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> BusinessDayConvention -> IO Bond
- cmsRateBond :: Word -> Double -> Schedule -> GenSwapIndex sidx -> DayCounter -> BusinessDayConvention -> Word -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Double -> Maybe Day -> IO Bond
- cpiBond :: Word -> Double -> Double -> (Word, TimeUnit) -> ZeroInflationIndex -> CPIInterpolationType -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Maybe Day -> Calendar -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> IO CPIBond
- amortizingFixedRateBond :: Word -> NonEmpty Double -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Maybe Day -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> [Double] -> Int -> IO Bond
- amortizingCmsRateBond :: Word -> NonEmpty Double -> Schedule -> GenSwapIndex sidx -> DayCounter -> BusinessDayConvention -> Word -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Maybe Day -> [Double] -> IO Bond
- amortizingFloatingRateBond :: Word -> NonEmpty Double -> Schedule -> GenIborIndex ibor -> DayCounter -> AmortizingFloatingRateBondOpts -> IO Bond
- sinkingSchedule :: Day -> (Int, TimeUnit) -> Frequency -> Calendar -> IO Schedule
- sinkingNotionals :: (Int, TimeUnit) -> Frequency -> Double -> Double -> IO [Double]
- rendistatoBasket :: NonEmpty (BTP, Double, GenQuote q) -> IO RendistatoBasket
- rendistatoCalculator :: RendistatoBasket -> (Int, TimeUnit) -> Maybe (GenYieldTermStructure y1) -> GenYieldTermStructure y2 -> IO RendistatoCalculator
- callableFixedRateBond :: Word -> Double -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Double -> Maybe Day -> [Callability] -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> IO CallableBond
- callableZeroCouponBond :: Word -> Double -> Calendar -> Day -> DayCounter -> BusinessDayConvention -> Double -> Maybe Day -> [Callability] -> IO CallableBond
- convertibleFixedCouponBond :: Exercise -> Double -> [Callability] -> Day -> Word -> NonEmpty Double -> DayCounter -> Schedule -> Double -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> IO ConvertibleBond
- convertibleFloatingRateBond :: Exercise -> Double -> [Callability] -> Day -> Word -> GenIborIndex ibor -> Word -> [Double] -> DayCounter -> Schedule -> Double -> (Int, TimeUnit) -> Calendar -> BusinessDayConvention -> Bool -> IO ConvertibleBond
- convertibleZeroCouponBond :: Exercise -> Double -> [Callability] -> Day -> Word -> DayCounter -> Schedule -> Double -> IO ConvertibleBond
- maturityDate :: GenBond b -> IO (Maybe Day)
- yield :: GenBond b -> DayCounter -> Compounding -> Frequency -> Double -> Word -> (Double, BondPriceType) -> IO Double
- accruedAmount :: GenBond b -> Day -> IO Double
- dirtyPriceFromYield :: GenBond b -> Double -> DayCounter -> Compounding -> Frequency -> Day -> IO Double
- nextCashFlowDate :: GenBond b -> Day -> IO (Maybe Day)
- nextCouponRate :: GenBond b -> Day -> IO Double
- notional :: GenBond b -> Day -> IO Double
- previousCashFlowDate :: GenBond b -> Day -> IO (Maybe Day)
- previousCouponRate :: GenBond b -> Day -> IO Double
- settlementValueFromCleanPrice :: GenBond b -> Double -> IO Double
- settlementValue :: GenBond b -> IO Double
- yieldFromPrice :: GenBond b -> (Double, BondPriceType) -> DayCounter -> Compounding -> Frequency -> Day -> Double -> Word -> IO Double
- isTradable :: GenBond b -> Day -> IO Bool
- notionals :: GenBond b -> IO [Double]
- cashFlows :: GenBond b -> IO Leg
- redemptions :: GenBond b -> IO Leg
- settlementDate :: GenBond b -> Day -> IO Day
- startDate :: GenBond b -> IO Day
- accrualDays :: GenBond b -> Day -> IO Int
- accrualEndDate :: GenBond b -> Day -> IO (Maybe Day)
- accrualPeriod :: GenBond b -> Day -> IO Double
- accrualStartDate :: GenBond b -> Day -> IO (Maybe Day)
- accruedDays :: GenBond b -> Day -> IO Int
- accruedPeriod :: GenBond b -> Day -> IO Double
- atmRate :: GenBond b -> GenYieldTermStructure y -> Day -> (Double, BondPriceType) -> IO Double
- basisPointValue :: GenBond b -> InterestRate -> Day -> IO Double
- bps :: GenBond b -> BpsDiscounting y -> Day -> IO Double
- cleanPrice :: GenBond b -> Discounting y -> Day -> IO Double
- convexity :: GenBond b -> InterestRate -> Day -> IO Double
- duration :: GenBond b -> InterestRate -> DurationType -> Day -> IO Double
- nextCashFlowAmount :: GenBond b -> Day -> IO Double
- previousCashFlowAmount :: GenBond b -> Day -> IO Double
- referencePeriodEnd :: GenBond b -> Day -> IO (Maybe Day)
- referencePeriodStart :: GenBond b -> Day -> IO (Maybe Day)
- yieldFromPriceWithGuess :: GenBond b -> (Double, BondPriceType) -> DayCounter -> Compounding -> Frequency -> Day -> Double -> Word -> Double -> IO Double
- yieldValueBasisPoint :: GenBond b -> InterestRate -> Day -> IO Double
- zSpread :: GenBond b -> (Double, BondPriceType) -> GenYieldTermStructure y -> Compounding -> Frequency -> Day -> Double -> Word -> Double -> IO Double
- currentCleanPrice :: GenBond b -> IO Double
- currentDirtyPrice :: GenBond b -> IO Double
- rendistatoYield :: RendistatoCalculator -> IO Double
- rendistatoDuration :: RendistatoCalculator -> IO Double
- rendistatoYields :: RendistatoCalculator -> IO [Double]
- rendistatoDurations :: RendistatoCalculator -> IO [Double]
- rendistatoSwapLengths :: RendistatoCalculator -> IO [Double]
- rendistatoSwapRates :: RendistatoCalculator -> IO [Double]
- rendistatoSwapYields :: RendistatoCalculator -> IO [Double]
- rendistatoSwapDurations :: RendistatoCalculator -> IO [Double]
- rendistatoEquivalentSwap :: RendistatoCalculator -> IO VanillaSwap
- rendistatoEquivalentSwapRate :: RendistatoCalculator -> IO Double
- rendistatoEquivalentSwapYield :: RendistatoCalculator -> IO Double
- rendistatoEquivalentSwapDuration :: RendistatoCalculator -> IO Double
- rendistatoEquivalentSwapLength :: RendistatoCalculator -> IO Double
- rendistatoEquivalentSwapSpread :: RendistatoCalculator -> IO Double
- rendistatoEquivalentSwapLengthQuote :: RendistatoCalculator -> IO Quote
- rendistatoEquivalentSwapSpreadQuote :: RendistatoCalculator -> IO Quote
Types
Bond hierarchy
type GenBond b = GenInstrument (AnyOf CBond' b) Source #
type Bond = GenBond CBond Source #
An Instrument; see the hierarchy under GenInstrument.
type GenFixedRateBond fb = GenBond (AnyOf CFixedRateBond' fb) Source #
type FixedRateBond = GenFixedRateBond CFixedRateBond Source #
A Bond; see the hierarchy under GenInstrument.
type BTP = GenFixedRateBond CBTP Source #
A FixedRateBond; see the hierarchy under GenInstrument.
type CallableBond = GenBond CCallableBond Source #
A Bond; see the hierarchy under GenInstrument.
type ConvertibleBond = GenBond CConvertibleBond Source #
A Bond; see the hierarchy under GenInstrument.
data RendistatoBasket Source #
data RendistatoCalculator Source #
Configuration
data BondPriceType Source #
Instances
| Enum BondPriceType Source # | |
Defined in QuantLib.Internal.Common Methods succ :: BondPriceType -> BondPriceType # pred :: BondPriceType -> BondPriceType # toEnum :: Int -> BondPriceType # fromEnum :: BondPriceType -> Int # enumFrom :: BondPriceType -> [BondPriceType] # enumFromThen :: BondPriceType -> BondPriceType -> [BondPriceType] # enumFromTo :: BondPriceType -> BondPriceType -> [BondPriceType] # enumFromThenTo :: BondPriceType -> BondPriceType -> BondPriceType -> [BondPriceType] # | |
| Read BondPriceType Source # | |
Defined in QuantLib.Internal.Common Methods readsPrec :: Int -> ReadS BondPriceType # readList :: ReadS [BondPriceType] # | |
| Show BondPriceType Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> BondPriceType -> ShowS # show :: BondPriceType -> String # showList :: [BondPriceType] -> ShowS # | |
| Eq BondPriceType Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: BondPriceType -> BondPriceType -> Bool # (/=) :: BondPriceType -> BondPriceType -> Bool # | |
data CPIInterpolationType Source #
Instances
data Discounting y Source #
Where discount factors come from.
Constructors
| DiscountingCurve !(GenYieldTermStructure y) | |
| DiscountingZSpread !(GenYieldTermStructure y) !Double !Compounding !Frequency | curve, zSpread, compounding, frequency |
| DiscountingYield !InterestRate |
data BpsDiscounting y Source #
Discounting restricted to the cases bps supports: upstream has no Z-spreaded bps.
Constructors
| BpsDiscountingCurve !(GenYieldTermStructure y) | |
| BpsDiscountingYield !InterestRate |
data AmortizingFloatingRateBondOpts Source #
Constructors
| AmortizingFloatingRateBondOpts | |
Fields
| |
Constructors
Hierarchy conversion
Bonds and baskets
constructor for amortizing or non-amortizing bonds. Redemptions and maturity are calculated from the coupon data, if available. Therefore, redemptions must not be included in the passed cash flows.
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Schedule | schedule |
| -> NonEmpty Double | coupons |
| -> DayCounter | accrualDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> Calendar | paymentCalendar |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> DayCounter | firstPeriodDayCounter |
| -> IO FixedRateBond |
generic compounding and frequency InterestRate coupons
Italian BTP (Buono Poliennali del Tesoro): a FixedRateBond with the Italian Treasury's own
hardcoded conventions baked in -- semiannual, Actual/Actual (ISMA), ModifiedFollowing, TARGET
payment calendar, par (100) redemption. accruedAmount (generic, via GenBond) additionally
rounds to 5 decimal places on a BTP, through the C++ override -- no separate binding needed.
yield upstream is a thin wrapper fixing yield's day counter/compounding/frequency
arguments to Actual/Actual (ISMA)/Compounded/Annual and is not bound; call the generic
yield with those same arguments instead.
Arguments
| :: Day | maturityDate |
| -> Double | fixedRate |
| -> Double | redemption |
| -> Maybe Day | startDate |
| -> Maybe Day | issueDate |
| -> IO BTP |
As btp, but with an explicit (non-par) redemption amount -- needed only for one remaining
legacy BTP (as of upstream's own documentation) that redeems below par.
Arguments
| :: Word | settlementDays |
| -> Calendar | |
| -> Double | faceAmount |
| -> Day | maturityDate |
| -> BusinessDayConvention | |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> IO Bond |
zero-coupon bond
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Schedule | schedule |
| -> GenIborIndex ibor | |
| -> DayCounter | accrualDayCounter |
| -> BusinessDayConvention | |
| -> Word | fixingDays |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> [Double] | caps |
| -> [Double] | floors |
| -> Bool | inArrears |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> BusinessDayConvention | fixingConvention |
| -> IO Bond |
floating-rate bond (possibly capped and/or floored)
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Schedule | schedule |
| -> GenSwapIndex sidx | |
| -> DayCounter | paymentDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Word | fixingDays |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> [Double] | caps |
| -> [Double] | floors |
| -> Bool | inArrears |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> IO Bond |
CMS-rate bond
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Double | baseCPI |
| -> (Word, TimeUnit) | observationLag |
| -> ZeroInflationIndex | |
| -> CPIInterpolationType | observationInterpolation |
| -> Schedule | |
| -> NonEmpty Double | coupons |
| -> DayCounter | accrualDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Maybe Day | issueDate |
| -> Calendar | paymentCalendar |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> IO CPIBond |
An inflation-linked bond whose redemption and coupons scale with a ZeroInflationIndex
fixing relative to baseCPI.
amortizingFixedRateBond Source #
Arguments
| :: Word | settlementDays |
| -> NonEmpty Double | notionals |
| -> Schedule | schedule |
| -> NonEmpty Double | coupons |
| -> DayCounter | accrualDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Maybe Day | issueDate |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> [Double] | redemptions |
| -> Int | paymentLag |
| -> IO Bond |
amortizing fixed-rate bond: like fixedRateBond but with a per-period notional schedule
instead of a single face amount (see sinkingSchedule/sinkingNotionals for building one).
amortizingCmsRateBond Source #
Arguments
| :: Word | settlementDays |
| -> NonEmpty Double | notionals |
| -> Schedule | schedule |
| -> GenSwapIndex sidx | |
| -> DayCounter | paymentDayCounter |
| -> BusinessDayConvention | paymentConvention |
| -> Word | fixingDays |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> [Double] | caps |
| -> [Double] | floors |
| -> Bool | inArrears |
| -> Maybe Day | issueDate |
| -> [Double] | redemptions |
| -> IO Bond |
amortizing CMS-rate bond (possibly capped and/or floored) with a per-period notional schedule instead of a single face amount, and a per-period redemption schedule instead of a single redemption value.
amortizingFloatingRateBond :: Word -> NonEmpty Double -> Schedule -> GenIborIndex ibor -> DayCounter -> AmortizingFloatingRateBondOpts -> IO Bond Source #
amortizing floating-rate bond (possibly capped and/or floored) with a per-period
notional schedule instead of a single face amount; see AmortizingFloatingRateBondOpts
for the trailing optional parameters (default via defaultAmortizingFloatingRateBondOpts,
override with record-update syntax).
Arguments
| :: Day | startDate |
| -> (Int, TimeUnit) | bondLength |
| -> Frequency | |
| -> Calendar | paymentCalendar |
| -> IO Schedule |
returns a schedule for French amortization
Arguments
| :: (Int, TimeUnit) | bondLength |
| -> Frequency | |
| -> Double | couponRate |
| -> Double | initialNotional |
| -> IO [Double] |
returns a sequence of notionals for French amortization
rendistatoBasket :: NonEmpty (BTP, Double, GenQuote q) -> IO RendistatoBasket Source #
A weighted collection of BTPs with their outstanding amounts and live clean-price quotes,
used by rendistatoCalculator. size/btps/cleanPriceQuotes/outstandings/weights/outstanding
are all constructor echoes and are not bound.
Arguments
| :: RendistatoBasket | basket |
| -> (Int, TimeUnit) | euriborTenor |
| -> Maybe (GenYieldTermStructure y1) | euriborForwardCurve |
| -> GenYieldTermStructure y2 | discountCurve |
| -> IO RendistatoCalculator |
QuantLib's own BTP-vs-EUR-swap-curve relative-value tool
(ql/instruments/bonds/btp.hpp's RendistatoCalculator): aggregates a RendistatoBasket
into a weighted BTP yield/duration, prices a fixed ladder of 1..15Y EUR swaps against a
discount curve, and reports the swap whose duration is closest to (without exceeding) the
basket's own duration as the "equivalent swap". euriborForwardCurve forwards the internally
constructed Euribor index used for those comparison swaps' floating leg -- matching upstream's
own Euribor default when Nothing, but the calculator immediately prices those swaps
(fairRate), which needs a real forwarding curve to project floating cashflows, so a
Nothing here throws rather than degrading gracefully; pass the same curve as
discountCurve unless a genuinely different forward curve is wanted. discountCurve is
required, with no upstream default.
Callable and convertible bonds
callableFixedRateBond Source #
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Schedule | |
| -> NonEmpty Double | coupons |
| -> DayCounter | |
| -> BusinessDayConvention | |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> [Callability] | |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> IO CallableBond |
fixed-rate bond with an embedded call/put schedule
callableZeroCouponBond Source #
Arguments
| :: Word | settlementDays |
| -> Double | faceAmount |
| -> Calendar | |
| -> Day | maturityDate |
| -> DayCounter | |
| -> BusinessDayConvention | |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> [Callability] | |
| -> IO CallableBond |
zero-coupon bond with an embedded call/put schedule
convertibleFixedCouponBond Source #
Arguments
| :: Exercise | |
| -> Double | conversionRatio |
| -> [Callability] | |
| -> Day | issueDate |
| -> Word | settlementDays |
| -> NonEmpty Double | coupons |
| -> DayCounter | |
| -> Schedule | |
| -> Double | redemption |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> IO ConvertibleBond |
convertible bond with a fixed-rate coupon leg
convertibleFloatingRateBond Source #
Arguments
| :: Exercise | |
| -> Double | conversionRatio |
| -> [Callability] | |
| -> Day | issueDate |
| -> Word | settlementDays |
| -> GenIborIndex ibor | |
| -> Word | fixingDays |
| -> [Double] | spreads |
| -> DayCounter | |
| -> Schedule | |
| -> Double | redemption |
| -> (Int, TimeUnit) | exCouponPeriod |
| -> Calendar | exCouponCalendar |
| -> BusinessDayConvention | exCouponConvention |
| -> Bool | exCouponEndOfMonth |
| -> IO ConvertibleBond |
convertible bond with a floating-rate coupon leg
convertibleZeroCouponBond Source #
Arguments
| :: Exercise | |
| -> Double | conversionRatio |
| -> [Callability] | |
| -> Day | issueDate |
| -> Word | settlementDays |
| -> DayCounter | |
| -> Schedule | |
| -> Double | |
| -> IO ConvertibleBond |
convertible zero-coupon bond
Inspectors
Bond state
Arguments
| :: GenBond b | |
| -> DayCounter | |
| -> Compounding | |
| -> Frequency | |
| -> Double | accuracy |
| -> Word | maxEvaluations |
| -> (Double, BondPriceType) | guess, priceType |
| -> IO Double |
theoretical bond yield
dirtyPriceFromYield :: GenBond b -> Double -> DayCounter -> Compounding -> Frequency -> Day -> IO Double Source #
dirty price given a yield and settlement date
nextCashFlowDate :: GenBond b -> Day -> IO (Maybe Day) Source #
date of the next cash flow after the given (or default settlement) date
nextCouponRate :: GenBond b -> Day -> IO Double Source #
Expected next coupon: depending on (the bond and) the given date the coupon can be historic, deterministic or expected in a stochastic sense. When the bond settlement date is used the coupon is the already-fixed not-yet-paid one.The current bond settlement is used if no date is given.
previousCashFlowDate :: GenBond b -> Day -> IO (Maybe Day) Source #
date of the cash flow immediately before the given (or default settlement) date
previousCouponRate :: GenBond b -> Day -> IO Double Source #
Previous coupon already paid at a given date. Expected previous coupon: depending on (the bond and) the given date the coupon can be historic, deterministic or expected in a stochastic sense. When the bond settlement date is used the coupon is the last paid one.The current bond settlement is used if no date is given.
settlementValueFromCleanPrice :: GenBond b -> Double -> IO Double Source #
settlement value as a function of the clean price The default bond settlement date is used for calculation.
settlementValue :: GenBond b -> IO Double Source #
theoretical settlement value The default bond settlement date is used for calculation.
Arguments
| :: GenBond b | |
| -> (Double, BondPriceType) | |
| -> DayCounter | |
| -> Compounding | |
| -> Frequency | |
| -> Day | |
| -> Double | accuracy |
| -> Word | maxEvaluations |
| -> IO Double |
yield given a (clean) price and settlement date
isTradable :: GenBond b -> Day -> IO Bool Source #
whether the bond can be traded (i.e. still has a positive notional) at the given date
notionals :: GenBond b -> IO [Double] Source #
notionals for each period of the bond's amortization schedule
redemptions :: GenBond b -> IO Leg Source #
returns just the redemption flows (not interest payments)
settlementDate :: GenBond b -> Day -> IO Day Source #
settlement date computed from the given date (or today's date if none is given)
Bond analytics
accrualDays :: GenBond b -> Day -> IO Int Source #
number of days in the current accrual period up to the given (or default settlement) date
accrualEndDate :: GenBond b -> Day -> IO (Maybe Day) Source #
end date of the accrual period containing the given (or default settlement) date
accrualPeriod :: GenBond b -> Day -> IO Double Source #
length in time of the accrual period containing the given (or default settlement) date
accrualStartDate :: GenBond b -> Day -> IO (Maybe Day) Source #
start date of the accrual period containing the given (or default settlement) date
accruedDays :: GenBond b -> Day -> IO Int Source #
number of days accrued up to the given (or default settlement) date
accruedPeriod :: GenBond b -> Day -> IO Double Source #
length in time accrued up to the given (or default settlement) date
atmRate :: GenBond b -> GenYieldTermStructure y -> Day -> (Double, BondPriceType) -> IO Double Source #
the bond's yield to maturity given a market price and discount curve
basisPointValue :: GenBond b -> InterestRate -> Day -> IO Double Source #
basis-point value given an InterestRate yield
bps :: GenBond b -> BpsDiscounting y -> Day -> IO Double Source #
Basis-point sensitivity under the given discounting, at a settlement date.
cleanPrice :: GenBond b -> Discounting y -> Day -> IO Double Source #
Clean price under the given discounting, at a settlement date.
Arguments
| :: GenBond b | |
| -> InterestRate | yield |
| -> Day | settlementDate |
| -> IO Double |
convexity given an InterestRate yield
Arguments
| :: GenBond b | |
| -> InterestRate | yield |
| -> DurationType | |
| -> Day | |
| -> IO Double |
duration given an InterestRate yield and duration type
nextCashFlowAmount :: GenBond b -> Day -> IO Double Source #
amount of the cash flow immediately after the given (or default settlement) date
previousCashFlowAmount :: GenBond b -> Day -> IO Double Source #
amount of the cash flow immediately before the given (or default settlement) date
referencePeriodEnd :: GenBond b -> Day -> IO (Maybe Day) Source #
end date of the reference period containing the given (or default settlement) date
referencePeriodStart :: GenBond b -> Day -> IO (Maybe Day) Source #
start date of the reference period containing the given (or default settlement) date
yieldFromPriceWithGuess Source #
Arguments
| :: GenBond b | |
| -> (Double, BondPriceType) | |
| -> DayCounter | |
| -> Compounding | |
| -> Frequency | |
| -> Day | settlementDate |
| -> Double | |
| -> Word | maxIterations |
| -> Double | guess |
| -> IO Double |
yield given a (clean) price and settlement date, solved to the given accuracy
Arguments
| :: GenBond b | |
| -> InterestRate | yield |
| -> Day | |
| -> IO Double |
yield value of a basis point given an InterestRate yield
Arguments
| :: GenBond b | |
| -> (Double, BondPriceType) | |
| -> GenYieldTermStructure y | |
| -> Compounding | |
| -> Frequency | |
| -> Day | settlementDate |
| -> Double | accuracy |
| -> Word | maxIterations |
| -> Double | guess |
| -> IO Double |
Z-spread over a discount curve implied by a (clean) price, solved to the given accuracy
Current prices
currentCleanPrice :: GenBond b -> IO Double Source #
theoretical clean price for the current evaluation date and term structure
currentDirtyPrice :: GenBond b -> IO Double Source #
theoretical dirty price The default bond settlement is used for calculation. Warning the theoretical price calculated from a flat term structure might differ slightly from the price calculated from the corresponding yield by means of the other overload of this function. If the price from a constant yield is desired, it is advisable to use such other overload.
Rendistato basket analytics
rendistatoYield :: RendistatoCalculator -> IO Double Source #
the basket's outstanding-weighted BTP yield: sum (weights * yields) -- a near-tautology
over rendistatoYields, kept because it is upstream's own published aggregate.
rendistatoDuration :: RendistatoCalculator -> IO Double Source #
the basket's outstanding-weighted BTP (modified) duration.
rendistatoYields :: RendistatoCalculator -> IO [Double] Source #
per-bond yields, in basket order.
rendistatoDurations :: RendistatoCalculator -> IO [Double] Source #
per-bond (modified) durations, in basket order.
rendistatoSwapLengths :: RendistatoCalculator -> IO [Double] Source #
the fixed 1..15Y comparison-swap ladder's lengths, in years -- pairs positionally with
rendistatoSwapRates/rendistatoSwapYields/rendistatoSwapDurations.
rendistatoSwapRates :: RendistatoCalculator -> IO [Double] Source #
each ladder swap's fair (par) rate.
rendistatoSwapYields :: RendistatoCalculator -> IO [Double] Source #
each ladder swap's fixed leg, repriced as a par bond and re-expressed as a BTP-convention yield.
rendistatoSwapDurations :: RendistatoCalculator -> IO [Double] Source #
each ladder swap's fixed leg (modified) duration, on the same par-bond proxy.
rendistatoEquivalentSwap :: RendistatoCalculator -> IO VanillaSwap Source #
the ladder swap whose duration is closest to (without exceeding) the basket's own duration.
rendistatoEquivalentSwapRate :: RendistatoCalculator -> IO Double Source #
the equivalent swap's fair rate.
rendistatoEquivalentSwapYield :: RendistatoCalculator -> IO Double Source #
the equivalent swap's par-bond-proxy yield.
rendistatoEquivalentSwapDuration :: RendistatoCalculator -> IO Double Source #
the equivalent swap's par-bond-proxy duration.
rendistatoEquivalentSwapLength :: RendistatoCalculator -> IO Double Source #
the equivalent swap's length, in years.
rendistatoEquivalentSwapSpread :: RendistatoCalculator -> IO Double Source #
rendistatoYield - rendistatoEquivalentSwapRate: the basket's spread over
its equivalent swap.
rendistatoEquivalentSwapLengthQuote :: RendistatoCalculator -> IO Quote Source #
A live Quote tracking rendistatoEquivalentSwapLength -- re-evaluates on every
access rather than snapshotting it, so it can be wired into curve bootstrapping like any other
quote.
rendistatoEquivalentSwapSpreadQuote :: RendistatoCalculator -> IO Quote Source #
A live Quote tracking rendistatoEquivalentSwapSpread.