Enum YieldQuoteConvention
pub enum YieldQuoteConvention {
Default,
UsStreet,
UkGilt,
DeGovt,
Annual,
SemiAnnual,
Quarterly,
Monthly,
Continuous,
Simple,
Ise,
JapaneseSimple,
}Expand description
The convention a quoted yield is stated under, by the one name a caller gives it.
A caller naming a yield says one word — "ust", "semiannual",
"continuous", "jgb" — and that word may be a street convention (a
YieldConvention, compounding at the market’s frequency), a fixed
compounding, or one of the two YieldQuoteMethods that are not a
discounting relationship at all. This vocabulary is that word: one closed
set, so the spellings a rejection advertises and the spellings the parser
takes cannot drift, and so a caller can hold the value rather than the
string. It resolves through the two types above and adds no arithmetic of
its own.
Variants§
Default
The bond’s own payment frequency under periodic compounding.
UsStreet
US Treasury street convention: semiannual periodic compounding.
UkGilt
UK gilt convention: semiannual periodic compounding.
DeGovt
German government convention: annual periodic compounding.
Annual
Periodic compounding once a year, whatever the bond pays.
SemiAnnual
Periodic compounding twice a year, whatever the bond pays.
Quarterly
Periodic compounding four times a year, whatever the bond pays.
Monthly
Periodic compounding twelve times a year, whatever the bond pays.
Continuous
Continuous compounding.
Simple
Money-market simple interest: no compounding at all.
Ise
The ISE (Turkish) convention: YieldKernel::Ise.
JapaneseSimple
The Japanese simple yield: YieldKernel::JapaneseSimple.
Implementations§
§impl YieldQuoteConvention
impl YieldQuoteConvention
pub fn kernel(self, bond_frequency: Frequency) -> YieldKernel
pub fn kernel(self, bond_frequency: Frequency) -> YieldKernel
The kernel this convention evaluates through, for a bond paying at
bond_frequency.
pub fn basis(self, bond_frequency: Frequency) -> Option<YieldBasis>
pub fn basis(self, bond_frequency: Frequency) -> Option<YieldBasis>
The single compounding basis this convention quotes on, where it has
one. None for Ise and
JapaneseSimple, whose arithmetic is not one
basis: a reading that needs a basis — a duration, a convexity — refuses
them by name rather than picking one for the caller.
pub fn kernel_on(
self,
bond_frequency: Frequency,
day_count: Option<DayCountFraction>,
) -> YieldKernel
pub fn kernel_on( self, bond_frequency: Frequency, day_count: Option<DayCountFraction>, ) -> YieldKernel
The kernel this convention names on a bond of bond_frequency, with a
discounted kernel re-based on day_count where one is given. The
resolution a bond’s price and yield_ take their convention
through, on both surfaces; a kernel that is not a single discounting
(ISE, JGB) carries no basis to re-base and is returned as it is.
pub fn basis_on(
self,
bond_frequency: Frequency,
day_count: Option<DayCountFraction>,
) -> Result<YieldBasis, NoSingleBasis>
pub fn basis_on( self, bond_frequency: Frequency, day_count: Option<DayCountFraction>, ) -> Result<YieldBasis, NoSingleBasis>
The single compounding basis this convention resolves to, re-based on
day_count where one is given — what a yield moment needs, since a
duration is a derivative under one discounting.
§Errors
NoSingleBasis for a convention whose kernel is not one discounting
(ISE, JGB), naming the convention and the ones that would serve.
Trait Implementations§
§impl Clone for YieldQuoteConvention
impl Clone for YieldQuoteConvention
§fn clone(&self) -> YieldQuoteConvention
fn clone(&self) -> YieldQuoteConvention
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for YieldQuoteConvention
§impl Debug for YieldQuoteConvention
impl Debug for YieldQuoteConvention
impl Eq for YieldQuoteConvention
§impl FromStr for YieldQuoteConvention
impl FromStr for YieldQuoteConvention
§impl Hash for YieldQuoteConvention
impl Hash for YieldQuoteConvention
§impl PartialEq for YieldQuoteConvention
impl PartialEq for YieldQuoteConvention
§fn eq(&self, other: &YieldQuoteConvention) -> bool
fn eq(&self, other: &YieldQuoteConvention) -> bool
self and other values to be equal, and is used by ==.