hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Index.InterestRate

Synopsis

Types

Interest-rate index hierarchy

type GenInterestRateIndex ridx = GenIndex (AnyOf CInterestRateIndex' ridx) Source #

An InterestRateIndex or one of its leaves; see the hierarchy under GenIndex.

type InterestRateIndex = GenInterestRateIndex CInterestRateIndex Source #

An Index; see the hierarchy under GenIndex.

type GenIborIndex ibor = GenInterestRateIndex (AnyOf CIborIndex' ibor) Source #

An IborIndex or one of its leaves; see the hierarchy under GenIndex.

type IborIndex = GenIborIndex CIborIndex Source #

An InterestRateIndex; see the hierarchy under GenIndex.

type GenSwapIndex sidx = GenInterestRateIndex (AnyOf CSwapIndex' sidx) Source #

A SwapIndex or one of its leaves; see the hierarchy under GenIndex.

type SwapIndex = GenSwapIndex CSwapIndex Source #

An InterestRateIndex; see the hierarchy under GenIndex.

type BMAIndex = GenInterestRateIndex CBMAIndex Source #

An InterestRateIndex; see the hierarchy under GenIndex.

type OvernightIborIndex = GenIborIndex COvernightIndex Source #

An IborIndex; see the hierarchy under GenIndex.

type SwapSpreadIndex = GenInterestRateIndex CSwapSpreadIndex Source #

An InterestRateIndex; see the hierarchy under GenIndex.

type OvernightIndexedSwapIndex = GenSwapIndex COvernightIndexedSwapIndex Source #

A SwapIndex; see the hierarchy under GenIndex.

Constructors

BMA indices

bmaIndex :: Maybe (GenYieldTermStructure y) -> IO BMAIndex Source #

Creates the BMA (Bond Market Association) short-term tax-exempt index, optionally linked to a forwarding curve.

Hierarchy conversion

Overnight and swap indices

data OvernightIborIndexType Source #

overnightIborIndex :: OvernightIborIndexType -> Maybe (GenYieldTermStructure y) -> IO OvernightIborIndex Source #

Creates one of the built-in overnight indexes (e.g. Sofr, Estr, Sonia), optionally linked to a forwarding curve.

data LiborSwapIndexType Source #

liborSwapIndex Source #

Arguments

:: LiborSwapIndexType 
-> (Int, TimeUnit) 
-> Maybe (GenYieldTermStructure y1)

forwarding

-> Maybe (GenYieldTermStructure y2)

discounting

-> IO SwapIndex 

Creates one of the built-in ISDA-fix swap-rate indexes for a given tenor, with separate forwarding and discounting curves.

overnightIndexedSwapIndex :: String -> (Int, TimeUnit) -> Word -> Currency -> OvernightIborIndex -> Bool -> RateAveragingType -> IO OvernightIndexedSwapIndex Source #

Construct an overnight-indexed swap index. The private binding marshals RateAveragingType as an Int to avoid a c2hs cross-module enum-import cycle.

swapIndex Source #

Arguments

:: String 
-> (Int, TimeUnit) 
-> Word

settlementDays

-> Currency 
-> Calendar 
-> (Int, TimeUnit)

fixedLegTenor

-> BusinessDayConvention 
-> DayCounter 
-> GenIborIndex ibor 
-> IO SwapIndex 

Creates a swap-rate index whose forwarding and discounting both come from the underlying ibor index's curve.

swapIndexWithDiscountCurve Source #

Arguments

:: String

familyName

-> (Int, TimeUnit)

tenor

-> Word

settlementDays

-> Currency 
-> Calendar 
-> (Int, TimeUnit)

fixedLegTenor

-> BusinessDayConvention

fixedLegConvention

-> DayCounter

fixedLegDayCounter

-> GenIborIndex ibor 
-> GenYieldTermStructure y 
-> IO SwapIndex 

Creates a swap-rate index with a discounting curve distinct from the forwarding curve of the underlying ibor index.

swapSpreadIndex Source #

Arguments

:: String

familyName

-> GenSwapIndex sidx1

swapIndex1

-> GenSwapIndex sidx2

swapIndex2

-> Double

gearing1

-> Double

gearing2

-> IO SwapSpreadIndex 

Interest-rate index equal to gearing1 * swapIndex1 + gearing2 * swapIndex2. It has no native fixing history: a historical fixing is available only when both component swap indexes have one.

Ibor index catalogue

data IborConstructor Source #

Bundled Patterns

pattern Bbsw1M :: IborConstructor 
pattern Bbsw2M :: IborConstructor 
pattern Bbsw3M :: IborConstructor 
pattern Bbsw4M :: IborConstructor 
pattern Bbsw5M :: IborConstructor 
pattern Bbsw6M :: IborConstructor 
pattern BiborSW :: IborConstructor 
pattern Bibor1M :: IborConstructor 
pattern Bibor2M :: IborConstructor 
pattern Bibor3M :: IborConstructor 
pattern Bibor6M :: IborConstructor 
pattern Bibor9M :: IborConstructor 
pattern Bibor1Y :: IborConstructor 
pattern Bkbm1M :: IborConstructor 
pattern Bkbm2M :: IborConstructor 
pattern Bkbm3M :: IborConstructor 
pattern Bkbm4M :: IborConstructor 
pattern Bkbm5M :: IborConstructor 
pattern Bkbm6M :: IborConstructor 
pattern EuriborSW :: IborConstructor 
pattern Euribor2W :: IborConstructor 
pattern Euribor3W :: IborConstructor 
pattern Euribor1M :: IborConstructor 
pattern Euribor2M :: IborConstructor 
pattern Euribor3M :: IborConstructor 
pattern Euribor4M :: IborConstructor 
pattern Euribor5M :: IborConstructor 
pattern Euribor6M :: IborConstructor 
pattern Euribor7M :: IborConstructor 
pattern Euribor8M :: IborConstructor 
pattern Euribor9M :: IborConstructor 
pattern Euribor10M :: IborConstructor 
pattern Euribor11M :: IborConstructor 
pattern Euribor1Y :: IborConstructor 
pattern Euribor365_SW :: IborConstructor 
pattern Euribor365_2W :: IborConstructor 
pattern Euribor365_3W :: IborConstructor 
pattern Euribor365_1M :: IborConstructor 
pattern Euribor365_2M :: IborConstructor 
pattern Euribor365_3M :: IborConstructor 
pattern Euribor365_4M :: IborConstructor 
pattern Euribor365_5M :: IborConstructor 
pattern Euribor365_6M :: IborConstructor 
pattern Euribor365_7M :: IborConstructor 
pattern Euribor365_8M :: IborConstructor 
pattern Euribor365_9M :: IborConstructor 
pattern Euribor365_10M :: IborConstructor 
pattern Euribor365_11M :: IborConstructor 
pattern Euribor365_1Y :: IborConstructor 
pattern EurLiborSW :: IborConstructor 
pattern EurLibor2W :: IborConstructor 
pattern EurLibor1M :: IborConstructor 
pattern EurLibor2M :: IborConstructor 
pattern EurLibor3M :: IborConstructor 
pattern EurLibor4M :: IborConstructor 
pattern EurLibor5M :: IborConstructor 
pattern EurLibor6M :: IborConstructor 
pattern EurLibor7M :: IborConstructor 
pattern EurLibor8M :: IborConstructor 
pattern EurLibor9M :: IborConstructor 
pattern EurLibor10M :: IborConstructor 
pattern EurLibor11M :: IborConstructor 
pattern EurLibor1Y :: IborConstructor 

overnightIndex Source #

Arguments

:: String 
-> Word

settlementDays

-> Currency 
-> Calendar 
-> DayCounter 
-> Maybe (GenYieldTermStructure y) 
-> IO OvernightIborIndex 

Creates a generic overnight index, optionally linked to a forwarding curve.

Inspectors

Index dates and conventions

fixingSchedule :: BMAIndex -> Day -> Day -> IO Schedule Source #

This method returns a schedule of fixing dates between start and end.

forecastFixing :: GenInterestRateIndex ridx -> Day -> IO Double Source #

It can be overridden to implement particular conventions.

currency :: GenInterestRateIndex ridx -> IO Currency Source #

Returns the index's underlying currency.

dayCounter :: GenInterestRateIndex ridx -> IO DayCounter Source #

Returns the day counter used by the index.

fixingDays :: GenInterestRateIndex ridx -> Word Source #

Returns the number of business days between a fixing date and the corresponding value date.

tenor :: GenInterestRateIndex ridx -> IO (Word, TimeUnit) Source #

Returns the index's tenor.

fixingDate Source #

Arguments

:: GenInterestRateIndex ridx

index

-> Day

valueDate

-> IO Day 

Returns the fixing date corresponding to a value date, using this index's convention-specific business-day rules. Concrete indexes can override the base calculation.

valueDate Source #

Arguments

:: GenInterestRateIndex ridx

index

-> Day

fixingDate

-> IO Day 

Returns the value date corresponding to a fixing date, using this index's convention-specific business-day rules. Throws when fixingDate is not a valid fixing day for the index.

maturityDate Source #

Arguments

:: GenInterestRateIndex ridx

index

-> Day

valueDate

-> IO Day 

Returns the maturity date corresponding to a value date. This is a concrete-index calculation: Ibor, Libor, swap, and custom indexes can each apply their own tenor, calendar, and end-of-month conventions.

businessDayConvention :: GenIborIndex ibor -> BusinessDayConvention Source #

Returns the business day convention used to adjust the index's value/maturity dates.

endOfMonth :: GenIborIndex ibor -> Bool Source #

Returns whether the index's date calculations roll to the end of the month.

Underlying swaps and history

underlyingSwap :: GenSwapIndex sidx -> Day -> IO VanillaSwap Source #

Returns the vanilla swap underlying the index for a given fixing date. Relinking the index's term structure afterwards has no effect on the returned swap.

underlyingOis :: OvernightIndexedSwapIndex -> Day -> IO OvernightIndexedSwap Source #

Returns the overnight-indexed swap underlying the index for a given fixing date. Relinking the index's term structure afterwards has no effect on the returned swap.

historicalRatesAnalysis :: Day -> Day -> (Int, TimeUnit) -> NonEmpty (GenInterestRateIndex ridx) -> IO HistoricalIndexAnalysis Source #

Convenience wrapper: historicalIndexAnalysis specialised to interest-rate indexes.