Struct FxIndex
pub struct FxIndex {
pub name: String,
pub base: Currency,
pub quote: Currency,
pub fixing_calendar: Arc<dyn Calendar>,
pub settlement_calendar: Option<Arc<dyn Calendar>>,
pub fixing_lag_days: u8,
}Expand description
An FX fixing index: the pair it observes and its settlement (spot)
conventions — fixing_calendar / fixing_lag_days, dating when a spot or
forward trade’s cash moves, the lag between a fixing and its value date.
Fields§
§name: StringIndex identifier — the fixing-store key (canonically "FX-EURUSD").
base: CurrencyBase currency of the pair (fixings are quote per 1 base).
quote: CurrencyQuote currency of the pair.
fixing_calendar: Arc<dyn Calendar>The calendar the fixing lag is counted on.
settlement_calendar: Option<Arc<dyn Calendar>>A second calendar the value date must also be a business day of (the
USD spot rule: count on the pair’s centres, settle on a New York
business day). None settles on fixing_calendar alone.
fixing_lag_days: u8Settlement (spot) lag in business days between fixing date and value date.
Implementations§
§impl FxIndex
impl FxIndex
pub fn canonical_name(base: &Currency, quote: &Currency) -> String
pub fn canonical_name(base: &Currency, quote: &Currency) -> String
The canonical index identifier for a pair: "FX-{BASE}{QUOTE}".
pub fn new(
base: Currency,
quote: Currency,
fixing_calendar: Arc<dyn Calendar>,
fixing_lag_days: u8,
) -> Self
pub fn new( base: Currency, quote: Currency, fixing_calendar: Arc<dyn Calendar>, fixing_lag_days: u8, ) -> Self
An index with explicit settlement conventions and the canonical name.
pub fn with_settlement_calendar(self, settlement: Arc<dyn Calendar>) -> Self
pub fn with_settlement_calendar(self, settlement: Arc<dyn Calendar>) -> Self
The same index, its value dates also good on settlement.
pub fn value_date(&self, fixing_date: NaiveDate) -> NaiveDate
pub fn value_date(&self, fixing_date: NaiveDate) -> NaiveDate
The value (settlement) date for a fixing observed on fixing_date: the
fixing lag counted in business days on the fixing calendar, rolled
following onto a business day of that calendar and, when one is set, of
the settlement calendar.
pub fn spot_fixing_date(&self, value_date: NaiveDate) -> NaiveDate
pub fn spot_fixing_date(&self, value_date: NaiveDate) -> NaiveDate
The settlement-convention fixing date for a settlement on
value_date: the value date (adjusted preceding onto the fixing
calendar if needed) rolled back the spot lag in business days. Inverse
of value_date up to that roll.
This dates a settlement fixing (an NDF’s netting observation).