FXIndex#
- class rateslib.data.fixings.FXIndex(pair, calendar, settle, isda_mtm_calendar=NoInput.blank, isda_mtm_settle=NoInput.blank, allow_cross=NoInput.blank)#
Bases:
objectDefine the parameters of a specific FX pair and fixing index.
This object acts as a container to store market conventions for different FX pairs. This allows the determination of dates under different methodologies, e.g. ISDA MTM fixings or spot settlement dates.
Examples
In [1]: fxi = FXIndex( ...: pair="eurusd", ...: calendar="tgt|fed", # <- Spot FX measures settlement dates according to this calendar ...: settle=2, ...: isda_mtm_calendar="ldn", # <- MTM XCS FX fixing dates are determined according to this calendar ...: isda_mtm_settle=-2, ...: ) ...: In [2]: fxi.delivery(dt(2025, 7, 3)) Out[2]: datetime.datetime(2025, 7, 7, 0, 0) In [3]: fxi.isda_fixing_date(dt(2025, 7, 3)) Out[3]: datetime.datetime(2025, 7, 1, 0, 0)
- Parameters:
pair (str, required) – The currency pair of the FX fixing. 6-digit iso code.
calendar (Calendar, str, required) – The calendar associated with the FX settlement date determination.
settle (Adjuster, int, str optional (set by ‘defaults’)) – The delivery lag applied to any FX quotation to adjust ‘today’ to a delivery date, under the given
calendar. If int is assumed to be settleable business days.isda_mtm_calendar (Calendar, str, optional) – The calendar associated with the MTM fixing date determination.
isda_mtm_settle (Adjuster, str, int, optional,) – The adjustment applied to determine the MTM fixing date.
allow_cross (bool, optional (set as True)) – This allows sub-division of the fixing into its majors as defined by WMR benchmark methodology. For an example of using a cross see the documentation for an
FXFixing.
Attributes Summary
Whether to allow FXFixings which sub-divide into USD or EUR crosses.
The calendar associated with the settlement delivery date determination.
The calendar associated with the MTM fixing date determination.
The
Adjusterassociated with the MTM fixing date determination.The currency pair of the FX fixing.
The
Adjusterassociated with determining the settlement delivery date.Methods Summary
delivery(date)Return the settlement delivery date associated with the publication date.
isda_fixing_date(delivery)Return the MTM FX fixing date under ISDA conventions.
publications(delivery)Return the potential publication dates that result in a given settlement delivery date.
Attributes Documentation
- allow_cross#
Whether to allow FXFixings which sub-divide into USD or EUR crosses.
- calendar#
The calendar associated with the settlement delivery date determination.
- isda_mtm_calendar#
The calendar associated with the MTM fixing date determination.
- pair#
The currency pair of the FX fixing.
Methods Documentation
- delivery(date)#
Return the settlement delivery date associated with the publication date.
- Parameters:
date (datetime) – The publication date of the quotation.
- Return type:
datetime
- isda_fixing_date(delivery)#
Return the MTM FX fixing date under ISDA conventions.
- Parameters:
delivery (datetime) – The delivery date of the notional exchange.
- Return type:
datetime
Notes
If
isdaattributes are not fully qualified on the object then uses thereversemethod to reverse engineer the FX quotation date as a proxy.
- publications(delivery)#
Return the potential publication dates that result in a given settlement delivery date.
- Parameters:
delivery (datetime) – The settlement delivery date of the publication.
- Return type:
list[datetime]