| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.CashFlow
Synopsis
- type Leg = GenLeg CLeg
- type CouponLeg = GenLeg CCouponLeg
- asLeg :: GenLeg a -> IO Leg
- data Dividend
- data DurationType
- data RateAveragingType
- data GenLeg a
- leg :: [(Day, Double)] -> IO Leg
- startDate :: GenLeg a -> IO Day
- nextCashFlows :: GenLeg a -> Bool -> Maybe Day -> IO Leg
- previousCashFlows :: GenLeg a -> Bool -> Maybe Day -> IO Leg
- cashFlows :: Leg -> Maybe Bool -> Maybe Day -> IO [(Day, Double, Bool)]
- duration :: GenLeg a -> InterestRate -> DurationType -> Bool -> Maybe Day -> Maybe Day -> IO Double
- accrualDays :: GenLeg a -> Bool -> Maybe Day -> IO Int
- accrualEndDate :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- accrualPeriod :: GenLeg a -> Bool -> Maybe Day -> IO Double
- accrualStartDate :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- accruedAmount :: GenLeg a -> Bool -> Maybe Day -> IO Double
- accruedDays :: GenLeg a -> Bool -> Maybe Day -> IO Int
- accruedPeriod :: GenLeg a -> Bool -> Maybe Day -> IO Double
- atmRate :: GenLeg a -> GenYieldTermStructure b -> Bool -> Maybe Day -> Maybe Day -> Double -> IO Double
- basisPointValue' :: GenLeg a -> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
- basisPointValue :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- bpsFromYield :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- bpsFromYield' :: GenLeg a -> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
- bps :: GenLeg a -> GenYieldTermStructure b -> Bool -> Maybe Day -> Maybe Day -> IO Double
- convexity' :: GenLeg a -> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
- convexity :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- duration' :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> DurationType -> Bool -> Maybe Day -> Maybe Day -> IO Double
- isExpired :: GenLeg a -> Bool -> Maybe Day -> IO Bool
- maturityDate :: GenLeg a -> IO Day
- nextCashFlowAmount :: GenLeg a -> Bool -> Maybe Day -> IO Double
- nextCashFlowDate :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- nextCouponRate :: GenLeg a -> Bool -> Maybe Day -> IO Double
- nominal :: GenLeg a -> Bool -> Maybe Day -> IO Double
- npvFromYield :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- npvFromYield' :: GenLeg a -> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
- npv' :: GenLeg a -> GenYieldTermStructure b -> Double -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- npv :: GenLeg a -> GenYieldTermStructure b -> Bool -> Maybe Day -> Maybe Day -> IO Double
- npvbps :: GenLeg a -> GenYieldTermStructure b -> Bool -> Day -> Day -> IO (Double, Double)
- previousCashFlowAmount :: GenLeg a -> Bool -> Maybe Day -> IO Double
- previousCashFlowDate :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- previousCouponRate :: GenLeg a -> Bool -> Maybe Day -> IO Double
- referencePeriodEnd :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- referencePeriodStart :: GenLeg a -> Bool -> Maybe Day -> IO (Maybe Day)
- yield :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> Double -> Word -> Double -> IO Double
- yieldValueBasisPoint' :: GenLeg a -> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
- yieldValueBasisPoint :: GenLeg a -> Double -> DayCounter -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> IO Double
- zSpread :: GenLeg a -> Double -> GenYieldTermStructure b -> Compounding -> Frequency -> Bool -> Maybe Day -> Maybe Day -> Double -> Word -> Double -> IO Double
- toCouponLeg :: GenLeg a -> IO CouponLeg
- couponAccrualStartDates :: CouponLeg -> IO [Day]
- fixedDividend :: Double -> Day -> IO Dividend
- fractionalDividend' :: Double -> Double -> Day -> IO Dividend
- fractionalDividend :: Double -> Day -> IO Dividend
- averageBMALeg :: Schedule -> BMAIndex -> [Double] -> DayCounter -> BusinessDayConvention -> [Double] -> [Double] -> IO Leg
- fixedRateLeg :: Schedule -> [Double] -> [InterestRate] -> BusinessDayConvention -> DayCounter -> Calendar -> IO Leg
- iborLeg :: Schedule -> GenIborIndex a -> [Double] -> DayCounter -> BusinessDayConvention -> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Bool -> IO Leg
- overnightLeg :: Schedule -> OvernightIborIndex -> [Double] -> DayCounter -> BusinessDayConvention -> [Double] -> [Double] -> IO Leg
- rangeAccrualLeg :: Schedule -> GenIborIndex a -> [Double] -> DayCounter -> BusinessDayConvention -> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> (Int, TimeUnit) -> BusinessDayConvention -> IO Leg
- data YieldCurveModel
- data FloatingRateCouponPricer
- blackIborCouponPricer :: OptionletVolatilityStructure -> IO FloatingRateCouponPricer
- setCouponPricer :: GenLeg a -> FloatingRateCouponPricer -> IO ()
- setCouponPricers :: GenLeg a -> [FloatingRateCouponPricer] -> IO ()
- analyticHaganPricer :: SwaptionVolatilityStructure -> YieldCurveModel -> GenQuote a -> IO FloatingRateCouponPricer
- numericHaganPricer :: SwaptionVolatilityStructure -> YieldCurveModel -> GenQuote a -> Double -> Double -> Double -> IO FloatingRateCouponPricer
Documentation
data DurationType #
Instances
| Enum DurationType # | |
Defined in QuantLib.CashFlow Methods succ :: DurationType -> DurationType # pred :: DurationType -> DurationType # toEnum :: Int -> DurationType # fromEnum :: DurationType -> Int # enumFrom :: DurationType -> [DurationType] # enumFromThen :: DurationType -> DurationType -> [DurationType] # enumFromTo :: DurationType -> DurationType -> [DurationType] # enumFromThenTo :: DurationType -> DurationType -> DurationType -> [DurationType] # | |
| Show DurationType # | |
Defined in QuantLib.CashFlow Methods showsPrec :: Int -> DurationType -> ShowS # show :: DurationType -> String # showList :: [DurationType] -> ShowS # | |
| Eq DurationType # | |
Defined in QuantLib.CashFlow | |
data RateAveragingType #
Constructors
| AveragingSimple | |
| AveragingCompound |
Instances
| Enum RateAveragingType # | |
Defined in QuantLib.CashFlow Methods succ :: RateAveragingType -> RateAveragingType # pred :: RateAveragingType -> RateAveragingType # toEnum :: Int -> RateAveragingType # fromEnum :: RateAveragingType -> Int # enumFrom :: RateAveragingType -> [RateAveragingType] # enumFromThen :: RateAveragingType -> RateAveragingType -> [RateAveragingType] # enumFromTo :: RateAveragingType -> RateAveragingType -> [RateAveragingType] # enumFromThenTo :: RateAveragingType -> RateAveragingType -> RateAveragingType -> [RateAveragingType] # | |
| Show RateAveragingType # | |
Defined in QuantLib.CashFlow Methods showsPrec :: Int -> RateAveragingType -> ShowS # show :: RateAveragingType -> String # showList :: [RateAveragingType] -> ShowS # | |
| Eq RateAveragingType # | |
Defined in QuantLib.CashFlow Methods (==) :: RateAveragingType -> RateAveragingType -> Bool # (/=) :: RateAveragingType -> RateAveragingType -> Bool # | |
startDate :: GenLeg a -> IO Day #
Returns the start (i.e. first accrual) date for the given Leg
return cashflows that will occur after settlementDate
return cashflows that occurred before settlementDate
Arguments
| :: Leg | |
| -> Maybe Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> IO [(Day, Double, Bool)] | date, amount, hasOccurred |
return cash flows together with an indicator whether they occurred as of settlementDate
Arguments
| :: GenLeg a | |
| -> InterestRate | yield |
| -> DurationType | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
Cash-flow duration. The simple duration of a string of cash flows is defined as \[ D_{\mathrm{simple}} = \frac{\sum t_i c_i B(t_i)}{\sum c_i B(t_i)} \] where $ c_i $ is the amount of the $ i $-th cash flow, $ t_i $ is its payment time, and $ B(t_i) $ is the corresponding discount according to the passed yield.The modified duration is defined as \[ D_{\mathrm{modified}} = -\frac{1}{P} \frac{\partial P}{\partial y} \] where $ P $ is the present value of the cash flows according to the given IRR $ y $.The Macaulay duration is defined for a compounded IRR as \[ D_{\mathrm{Macaulay}} = \left( 1 + \frac{y}{N} \right) D_{\mathrm{modified}} \] where $ y $ is the IRR and $ N $ is the number of cash flows per year.
Arguments
| :: GenLeg a | |
| -> GenYieldTermStructure b | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> Double | npv |
| -> IO Double |
At-the-money rate of the cash flows. The result is the fixed rate for which a fixed rate cash flow vector, equivalent to the input vector, has the required NPV according to the given term structure. If the required NPV is not given, the input cash flow vector's NPV is used instead.
Basis-point sensitivity of the cash flows. The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given term structure.
Arguments
| :: GenLeg a | |
| -> InterestRate | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
Basis-point value. Obtained by setting dy = 0.0001 in the 2nd-order Taylor series expansion.
Arguments
| :: GenLeg a | |
| -> InterestRate | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
Basis-point sensitivity of the cash flows. The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter.
Arguments
| :: GenLeg a | |
| -> GenYieldTermStructure b | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
NPV of the cash flows. For details on z-spread refer to: "Credit Spreads Explained", Lehman Brothers European Fixed Income Research - March 2004, D. O'KaneThe NPV is the sum of the cash flows, each discounted according to the z-spreaded term structure. The result is affected by the choice of the z-spread compounding and the relative frequency and day counter.
Arguments
| :: GenLeg a | |
| -> InterestRate | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
Cash-flow convexity. The convexity of a string of cash flows is defined as \[ C = \frac{1}{P} \frac{\partial^2 P}{\partial y^2} \] where $ P $ is the present value of the cash flows according to the given IRR $ y $.
Arguments
| :: GenLeg a | |
| -> Double | |
| -> DayCounter | |
| -> Compounding | |
| -> Frequency | |
| -> DurationType | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
maturityDate :: GenLeg a -> IO Day #
NPV of the cash flows. The IRR is the interest rate at which the NPV of the cash flows equals the dirty price.The NPV is the sum of the cash flows, each discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter.
Arguments
| :: GenLeg a | |
| -> GenYieldTermStructure b | |
| -> Double | zSpread |
| -> Compounding | |
| -> Frequency | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
NPV of the cash flows. The NPV is the sum of the cash flows, each discounted according to the given term structure.
Arguments
| :: GenLeg a | |
| -> GenYieldTermStructure b | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
NPV and BPS of the cash flows. The NPV and BPS of the cash flows calculated together for performance reason
Arguments
| :: GenLeg a | |
| -> GenYieldTermStructure b | |
| -> Bool | includeSettlementDateFlows |
| -> Day | settlementDate |
| -> Day | npvDate |
| -> IO (Double, Double) |
implied Z-spread.
Implied internal rate of return. The function verifies the theoretical existance of an IRR and numerically establishes the IRR to the desired precision.
Arguments
| :: GenLeg a | |
| -> InterestRate | yield |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
start of the accrual periods for a coupon leg
Arguments
| :: GenLeg a | |
| -> Double | yield |
| -> DayCounter | |
| -> Compounding | |
| -> Frequency | |
| -> Bool | includeSettlementDateFlows |
| -> Maybe Day | settlementDate |
| -> Maybe Day | npvDate |
| -> IO Double |
Yield value of a basis point. The yield value of a one basis point change in price is the derivative of the yield with respect to the price multiplied by 0.01
toCouponLeg :: GenLeg a -> IO CouponLeg #
couponAccrualStartDates :: CouponLeg -> IO [Day] #
Arguments
| :: Schedule | |
| -> BMAIndex | |
| -> [Double] | notionals |
| -> DayCounter | |
| -> BusinessDayConvention | |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> IO Leg |
Arguments
| :: Schedule | |
| -> [Double] | notionals |
| -> [InterestRate] | couponRates |
| -> BusinessDayConvention | paymentAdjustment |
| -> DayCounter | firstPeriodDayCounter |
| -> Calendar | paymentCalendar |
| -> IO Leg |
Arguments
| :: Schedule | |
| -> GenIborIndex a | |
| -> [Double] | notionals |
| -> DayCounter | |
| -> BusinessDayConvention | paymentAdjustment |
| -> [Word] | fixingDays |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> [Double] | caps |
| -> [Double] | floors |
| -> Bool | inArrears |
| -> Bool | zeroPayments |
| -> IO Leg |
Arguments
| :: Schedule | |
| -> OvernightIborIndex | |
| -> [Double] | notionals' |
| -> DayCounter | |
| -> BusinessDayConvention | |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> IO Leg |
Arguments
| :: Schedule | |
| -> GenIborIndex a | |
| -> [Double] | notionals |
| -> DayCounter | |
| -> BusinessDayConvention | |
| -> [Word] | fixingDays |
| -> [Double] | gearings |
| -> [Double] | spreads |
| -> [Double] | lowerTriggers |
| -> [Double] | upperTriggers |
| -> (Int, TimeUnit) | observationTenor |
| -> BusinessDayConvention | |
| -> IO Leg |
try to downcast leg to a coupon leg don't blame me, it's how QuantLib works
data YieldCurveModel #
Constructors
| Standard | |
| ExactYield | |
| ParallelShifts | |
| NonParallelShifts |
Instances
| Enum YieldCurveModel # | |
Defined in QuantLib.CashFlow Methods succ :: YieldCurveModel -> YieldCurveModel # pred :: YieldCurveModel -> YieldCurveModel # toEnum :: Int -> YieldCurveModel # fromEnum :: YieldCurveModel -> Int # enumFrom :: YieldCurveModel -> [YieldCurveModel] # enumFromThen :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel] # enumFromTo :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel] # enumFromThenTo :: YieldCurveModel -> YieldCurveModel -> YieldCurveModel -> [YieldCurveModel] # | |
| Show YieldCurveModel # | |
Defined in QuantLib.CashFlow Methods showsPrec :: Int -> YieldCurveModel -> ShowS # show :: YieldCurveModel -> String # showList :: [YieldCurveModel] -> ShowS # | |
| Eq YieldCurveModel # | |
Defined in QuantLib.CashFlow Methods (==) :: YieldCurveModel -> YieldCurveModel -> Bool # (/=) :: YieldCurveModel -> YieldCurveModel -> Bool # | |
blackIborCouponPricer :: OptionletVolatilityStructure -> IO FloatingRateCouponPricer #
Black-formula pricer for capped/floored Ibor coupons
setCouponPricer :: GenLeg a -> FloatingRateCouponPricer -> IO () #
setCouponPricers :: GenLeg a -> [FloatingRateCouponPricer] -> IO () #
Arguments
| :: SwaptionVolatilityStructure | |
| -> YieldCurveModel | |
| -> GenQuote a | meanReversion |
| -> IO FloatingRateCouponPricer |
Arguments
| :: SwaptionVolatilityStructure | |
| -> YieldCurveModel | |
| -> GenQuote a | meanReversion |
| -> Double | lowerLimit |
| -> Double | upperLimit |
| -> Double | precision |
| -> IO FloatingRateCouponPricer |