ForwardPointMarket#
-
class sigtech.framework.infra.analytics.fx.fx_market.ForwardPointMarket
Baseclasses:
BaseFXMarket
Class calculating yield curves used for forward rate calculation. It should only be used for USD-based FX forwards and implies forwards directly from the curves:
\[FX_t = FX_0 + {FXPoint}_t\]where the points are interpolated from the market quoted ones, and converted from quoting convention to the values compatible with FX spot.
Given that there is no default discounting associated with the FX forward points, the class also provides alternative ways of discounting the FX forward instrument, depending on the
FORWARD_DISCOUNTING_INSTRUMENT
configuration setting, either via discount curve (provided as discounting instrument inconfig
), or via a cash rate (using the latest fixing as a flat rate):\[P(0,t) = e^{-rt}\]-
calculate_forward_rate(over, under, quote_date, maturity, mode='mid', transaction_type=None, spot_date=None, data_point=None)
Calculate the forward rate for a given currency pair and maturity.
- Parameters:
over – Over currency.
under – Under currency.
quote_date – Quote date.
maturity – Maturity date.
mode –
'bid'
,'ask'
or'mid'
('mid'
is default).transaction_type – String identifier to indicate type of transaction, e.g.
'outright'
,'roll'
(optional).spot_date – Spot date (optional).
data_point – Data point (optional).
- Returns:
Forward rate.
-
calculate_forward_rate_batch(over, under, quote_dates, maturities, mode='mid', transaction_type=None, spot_dates=None, data_point=None)
Calculate the forward rates for a given currency pair and list of maturity dates.
- Parameters:
over – Over currency.
under – Under currency.
quote_dates – Quote dates.
maturities – Maturity dates.
mode –
'bid'
,'ask'
or'mid'
('mid'
is default).transaction_type – String identifier to indicate type of transaction, e.g.
'outright'
,'roll'
(optional).spot_dates – Spot dates (optional).
data_point – Data point (optional).
- Returns:
list.
-
day_count(currency, curve_day_count=None)
Return the day count given the currency.
- Parameters:
currency – Input currency.
curve_day_count – Curve day count (optional).
- Returns:
str.
-
dependencies(over: str, under: str, time: ~datetime.time, tz: <module 'pytz.tzinfo' from '/github/home/.cache/pypoetry/virtualenvs/sigtech-framework-GMC81NYz-py3.11/lib/python3.11/site-packages/pytz/tzinfo.py'>, start_dt: ~datetime.datetime, end_dt: ~datetime.datetime) list[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency]
Dependencies
-
discount_factor(currency, quote_date, start_date, end_date, mode='mid', data_point=None)
Calculate a discount factor.
- Parameters:
currency – Input currency.
quote_date – Quote date.
start_date – Period start date.
end_date – Period end date.
mode –
'bid'
,'ask'
or'mid'
('mid'
is default).data_point – Data point (optional).
- Returns:
Discount factor.
-
discount_factor_batch(currency, quote_dates, start_dates, end_dates, mode='mid', data_point=None)
Calculate a batch of discount factors.
- Parameters:
currency – Input currency.
quote_dates – List of quote dates.
start_dates – List of period start dates.
end_dates – List of period end dates.
mode –
'bid'
,'ask'
or'mid'
('mid'
is default).data_point – Data point (optional).
- Returns:
list.
-
implied_depo(currency, quote_date, tenor, spot_date=None, data_point=None)
Compute the implied depo rate given quote date and tenor.
- Parameters:
currency – Input currency.
quote_date – Quote date.
tenor – Tenor identifier.
spot_date – Spot date (optional).
data_point – Data point (optional).
- Returns:
float.
-
implied_depo_batch(currency, quote_dates, tenor, spot_dates=None, data_point=None)
Compute the implied depo rate batch given a list of quote dates and tenor.
- Parameters:
currency – Input currency.
quote_dates – Quote dates.
tenor – Tenor identifier.
spot_dates – Spot dates (optional).
data_point – Data point (optional).
- Returns:
list.