hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Instrument.Bond

Synopsis

Documentation

type Bond = GenBond CBond #

type FixedRateBond = GenBond CFixedRateBond #

type ConvertibleBond = GenBond CConvertibleBond #

type CallableBond = GenBond CCallableBond #

asBond :: GenBond a -> IO Bond #

bond #

Arguments

:: Word 
-> Calendar 
-> Maybe Day

issueDate

-> GenLeg a

coupons

-> IO Bond 

old constructor for non amortizing bonds. Warning The last passed cash flow must be the bond redemption. No other cash flow can have a date later than the redemption date.

bond' #

Arguments

:: Word

settlementDays

-> Calendar 
-> Double

faceAmount

-> Maybe Day

maturityDate

-> Maybe Day

issueDate

-> GenLeg a

cashFlows

-> IO Bond 

fixedRateBond #

Arguments

:: Word

settlementDays

-> Double

faceAmount

-> Schedule

schedule

-> [Double]

coupons

-> DayCounter

accrualDayCounter

-> BusinessDayConvention

paymentConvention

-> Double

redemption

-> Maybe Day

issueDate

-> Calendar

paymentCalendar

-> IO FixedRateBond 

zero-coupon bond

zeroCouponBond #

Arguments

:: Word

settlementDays

-> Calendar 
-> Double

faceAmount

-> Day

maturityDate

-> BusinessDayConvention 
-> Double

redemption

-> Maybe Day

issueDate

-> IO Bond 

floatingRateBond #

Arguments

:: Word

settlementDays

-> Double

faceAmount

-> Schedule

schedule

-> GenIborIndex a 
-> DayCounter

accrualDayCounter

-> BusinessDayConvention 
-> Word

fixingDays

-> [Double]

gearings

-> [Double]

spreads

-> [Double]

caps

-> [Double]

floors

-> Bool

inArrears

-> Double

redemption

-> Maybe Day

issueDate

-> IO Bond 

floating-rate bond (possibly capped and/or floored)

maturityDate :: GenBond a -> Maybe Day #

Returns the maturity date of the bond

generic compounding and frequency InterestRate coupons

yield #

Arguments

:: GenBond a 
-> DayCounter 
-> Compounding 
-> Frequency 
-> Double

accuracy

-> Word

maxEvaluations

-> IO Double 

theoretical bond yield

accruedAmount :: GenBond a -> Day -> IO Double #

accrued amount at a given date

clean price given a yield and settlement date

cleanPriceFromYield :: GenBond a -> Double -> DayCounter -> Compounding -> Frequency -> Day -> IO Double #

dirty price given a yield and settlement date

nextCashFlowDate :: GenBond a -> Day -> IO (Maybe Day) #

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.

nextCouponRate :: GenBond a -> Day -> IO Double #

notional :: GenBond a -> Day -> IO Double #

previousCashFlowDate :: GenBond a -> Day -> IO (Maybe Day) #

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.

previousCouponRate :: GenBond a -> Day -> IO Double #

settlement value as a function of the clean price The default bond settlement date is used for calculation.

settlementValueFromCleanPrice :: GenBond a -> Double -> IO Double #

theoretical settlement value The default bond settlement date is used for calculation.

settlementValue :: GenBond a -> IO Double #

yield given a (clean) price and settlement date

yieldFromCleanPrice #

Arguments

:: GenBond a 
-> Double

cleanPrice

-> DayCounter 
-> Compounding 
-> Frequency 
-> Day 
-> Double

accuracy

-> Word

maxEvaluations

-> IO Double 

isTradable :: GenBond a -> Day -> IO Bool #

notionals :: GenBond a -> IO [Double] #

returns all the cashflows, including the redemptions.

cashFlows :: GenBond a -> IO Leg #

returns just the redemption flows (not interest payments)

redemptions :: GenBond a -> IO Leg #

settlementDate :: GenBond a -> Day -> IO Day #

startDate :: GenBond a -> IO Day #

accrualDays :: GenBond a -> Day -> IO Int #

accrualEndDate :: GenBond a -> Day -> IO (Maybe Day) #

accrualPeriod :: GenBond a -> Day -> IO Double #

accrualStartDate :: GenBond a -> Day -> IO (Maybe Day) #

accruedDays :: GenBond a -> Day -> IO Int #

accruedPeriod :: GenBond a -> Day -> IO Double #

atmRate :: GenBond b -> GenYieldTermStructure a -> Day -> Double -> IO Double #

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.

basisPointValue' :: GenBond a -> InterestRate -> Day -> IO Double #

bpsFromYield' :: GenBond a -> InterestRate -> Day -> IO Double #

bps :: GenBond b -> GenYieldTermStructure a -> Day -> IO Double #

cleanPrice :: GenBond b -> GenYieldTermStructure a -> Day -> IO Double #

cleanPrice' #

Arguments

:: GenBond b 
-> GenYieldTermStructure a

discount

-> Double

zSpread

-> Compounding 
-> Frequency 
-> Day

settlementDate

-> IO Double 

convexity' #

Arguments

:: GenBond a 
-> InterestRate

yield

-> Day

settlementDate

-> IO Double 

convexity #

Arguments

:: GenBond a 
-> Double

yield

-> DayCounter 
-> Compounding 
-> Frequency 
-> Day

settlementDate

-> IO Double 

duration' #

Arguments

:: GenBond a 
-> InterestRate

yield

-> DurationType 
-> Day 
-> IO Double 

duration #

Arguments

:: GenBond a 
-> Double

yield

-> DayCounter 
-> Compounding 
-> Frequency 
-> DurationType 
-> Day

settlementDate

-> IO Double 

nextCashFlowAmount :: GenBond a -> Day -> IO Double #

previousCashFlowAmount :: GenBond a -> Day -> IO Double #

referencePeriodEnd :: GenBond a -> Day -> IO (Maybe Day) #

referencePeriodStart :: GenBond a -> Day -> IO (Maybe Day) #

yieldFromCleanPrice' #

Arguments

:: GenBond a 
-> Double

cleanPrice

-> DayCounter 
-> Compounding 
-> Frequency 
-> Day

settlementDate

-> Double 
-> Word

maxIterations

-> Double

guess

-> IO Double 

yieldValueBasisPoint' #

Arguments

:: GenBond a 
-> InterestRate

yield

-> Day 
-> IO Double 

yieldValueBasisPoint #

Arguments

:: GenBond a 
-> Double

yield

-> DayCounter 
-> Compounding 
-> Frequency 
-> Day 
-> IO Double 

zSpread #

Arguments

:: GenBond b 
-> Double

cleanPrice

-> GenYieldTermStructure a 
-> Compounding 
-> Frequency 
-> Day

settlementDate

-> Double

accuracy

-> Word

maxIterations

-> Double

guess

-> IO Double 

currentCleanPrice :: GenBond a -> IO Double #

theoretical clean price for the current evaluation date and term structure

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.

currentDirtyPrice :: GenBond a -> IO Double #

callableFixedRateBond #

Arguments

:: Word

settlementDays

-> Double

faceAmount

-> Schedule 
-> [Double]

coupons

-> DayCounter 
-> BusinessDayConvention 
-> Double

redemption

-> Maybe Day

issueDate

-> [Callability] 
-> IO CallableBond 

callableZeroCouponBond #

Arguments

:: Word

settlementDays

-> Double

faceAmount

-> Calendar 
-> Day

maturityDate

-> DayCounter 
-> BusinessDayConvention 
-> Double

redemption

-> Maybe Day

issueDate

-> [Callability] 
-> IO CallableBond 

convertibleFixedCouponBond #

Arguments

:: Exercise 
-> Double

conversionRatio

-> [Callability] 
-> Day

issueDate

-> Word

settlementDays

-> [Double]

coupons

-> DayCounter 
-> Schedule 
-> Double

redemption

-> IO ConvertibleBond 

convertibleFloatingRateBond #

Arguments

:: Exercise 
-> Double

conversionRatio

-> [Callability] 
-> Day

issueDate

-> Word

settlementDays

-> GenIborIndex b 
-> Word

fixingDays

-> [Double]

spreads

-> DayCounter 
-> Schedule 
-> Double

redemption

-> IO ConvertibleBond 

convertibleZeroCouponBond #

Arguments

:: Exercise 
-> Double

conversionRatio

-> [Callability] 
-> Day

issueDate

-> Word

settlementDays

-> DayCounter 
-> Schedule 
-> Double 
-> IO ConvertibleBond