Index Types and Functions¶
These types and methods help to construct indexes (e.g. Libor) and use them in instrument pricing.
General Interest Rate Index Methods¶
InterestRateIndex is the Abstract Type from which the Ibor and Libor indexes are derived. These are some general methods for all interest rate indexes.
-
fixing_date
(idx::InterestRateIndex, d::Date)¶ Returns the fixing date of the index
-
value_date
(idx::InterestRateIndex, d::Date)¶ Returns the value date of the index
-
fixing
(idx::InterestRateIndex, ts::TermStructure, _fixing_date::Date, forecast_todays_fixing::Bool=true)¶ Returns the fixing of the index at a given date
-
forecast_fixing
(idx::InterestRateIndex, ts::TermStructure, _fixing_date::Date)¶ Calculates a forecasted fixing for a future date, given a fixing date
-
forecast_fixing
(idx::InterestRateIndex, ts::TermStructure, d1::Date, d2::Date, t::Float64) Calculates a forecasted fixing for a future date given two dates and the time period between the two dates
-
is_valid_fixing_date
(idx::InterestRateIndex, d::Date)¶ Determines whether or not a date is a valid fixing date for the index (namely, is it a valid business day)
-
add_fixing!(idx::InterestRateIndex, d::Date, fixingVal::Float64)
Adds a fixing and date to the index’s cache of fixings
Ibor Index¶
immutable IborIndex <: InterestRateIndex
familyName::AbstractString
tenor::TenorPeriod
fixingDays::Int
currency::AbstractCurrency
fixingCalendar::BusinessCalendar
convention::BusinessDayConvention
endOfMonth::Bool
dc::DayCount
ts::TermStructure
pastFixings::Dict{Date, Float64}
end
-
IborIndex
(familyName::AbstractString, tenor::TenorPeriod, fixingDays::Int, currency::AbstractCurrency, fixingCalendar::BusinessCalendar, convention::BusinessDayConvention, endOfMonth::Bool, dc::DayCount, ts::TermStructure = NullTermStructure())¶ Constructor for the Ibor Index, will default to a NullTermStructure (which must be set later - this actually will clone this index with a new TS, since the type is immutable)
-
maturity_date
(idx::IborIndex, d::Date)¶ Returns the maturity date of the index
Libor Index¶
immutable LiborIndex <: InterestRateIndex
familyName::AbstractString
tenor::TenorPeriod
fixingDays::Int
currency::Currency
fixingCalendar::BusinessCalendar
jointCalendar::JointCalendar
convention::BusinessDayConvention
endOfMonth::Bool
dc::DayCount
ts::TermStructure
end
-
LiborIndex
(familyName::AbstractString, tenor::TenorPeriod, fixingDays::Int, currency::Currency, fixingCalendar::BusinessCalendar, jointCalendar::JointCalendar, convention::BusinessDayConvention, endOfMonth::Bool, dc::DayCount, ts::TermStructure = NullTermStructure())¶ Default constructor for a Libor Index
-
LiborIndex
(familyName::AbstractString, tenor::TenorPeriod, fixingDays::Int, currency::Currency, fixingCalendar::BusinessCalendar, dc::DayCount, yts::YieldTermStructure) Additional constructor for a Libor Index, with no joint calendar or business day convention passed (the joint calendar is calculated)
-
value_date
(idx::LiborIndex, d::Date) Returns the value date of a libor index
-
maturity_date
(idx::LiborIndex, d::Date) Returns the maturity date of a libor index
Indexes Derived from Libor and Ibor¶
-
euribor_index
(tenor::TenorPeriod)¶ Builds a Euribor Ibor index with a given time period (e.g. 6 month)
-
euribor_index
(tenor::TenorPeriod, ts::TermStructure) Builds a Euribor Ibor index with a given time period (e.g. 6 month) with a custom term structure
-
usd_libor_index
(tenor::TenorPeriod, yts::YieldTermStructure)¶ Builds a USD Libor index with a given time period (e.g. 6 month) and term structure
Swap Index¶
immutable SwapIndex <: InterestRateIndex
familyName::AbstractString
tenor::TenorPeriod
fixingDays::Int
currency::Currency
fixingCalendar::BusinessCalendar
fixedLegTenor::Dates.Period
fixedLegConvention::BusinessDayConvention
fixedLegDayCount::DayCount
discount::TermStructure
iborIndex::IborIndex
exogenousDiscount::Bool
lastSwap::VanillaSwap
lastFixingDate::Date
end
-
SwapIndex
(familyName::AbstractString, tenor::TenorPeriod, fixingDays::Int, currency::Currency, fixingCalendar::BusinessCalendar, fixedLegTenor::Dates.Period, fixedLegConvention::BusinessDayConvention, fixedLegDayCount::DayCount, discount::TermStructure, iborIndex::IborIndex, exogenousDiscount::Bool = true)¶ Constructor for a Swap Index