qis.FxAssetReturnsRequest¶
- class qis.FxAssetReturnsRequest(prices, local_ccys, return_type, coordinate, reference_ccy=None, hedge_ratios=0.0, frequency='ME', cash_policy=<factory>, zero_return_to_nan=False, embedded_hedge_policy='prices_include_existing_hedges; ratios_are_additional', currency_changes='reject', diagnostics=False, normalization=None)[source]¶
Bases:
objectAsset-panel request with one economic kind and one coordinate.
- Variables:
prices (pandas.DataFrame) – Native price levels, with unique dates and asset columns.
local_ccys (str | pandas.Series | pandas.DataFrame) – Currency ID, asset Series, or dated currency-spell DataFrame.
return_type (qis.fx.fx_returns.FxReturnType) – Local/reference total/excess or LOCAL_EXCESS_TRANSLATED.
coordinate (qis.fx.fx_returns.FxReturnCoordinate) – SIMPLE, LOG, or excess-only CASH_RELATIVE_SIMPLE; P&L requires SIMPLE.
reference_ccy (str | None) – Required for reference returns and translated P&L; absent for local.
hedge_ratios (float | pandas.Series | pandas.DataFrame) – Additional principal hedge; scalar, asset Series or dated DataFrame. Must be zero or missing for local returns and LOCAL_EXCESS_TRANSLATED; missing means no additional hedge on these kinds. Reference-currency assets have no FX exposure: their effective opening hedge is zero, also in opening_hedge_ratios. Missing foreign-asset hedges still mask reference-return observations.
frequency (str | pandas.Series) – Reset/return cadence, scalar or per-asset Series.
cash_policy (qis.fx.fx_returns.FxCashPolicy) – Cash quote timing, day count and provenance.
zero_return_to_nan (bool) – Explicit observation filter, applied after all calculations.
embedded_hedge_policy (Literal['prices_include_existing_hedges; ratios_are_additional']) – Prices include existing hedges; supplied hedges are additional.
currency_changes (Literal['reject', 'mask_boundary']) – Reject currency changes or explicitly mask crossing intervals.
diagnostics (bool) – Include compact currency-level cash, spot and hedge-cost legs.
normalization (qis.fx.fx_returns.FxIndexNormalization | None) – Optional synthetic index specification; absent by default.
- Parameters:
prices (DataFrame)
return_type (FxReturnType)
coordinate (FxReturnCoordinate)
reference_ccy (str | None)
cash_policy (FxCashPolicy)
zero_return_to_nan (bool)
embedded_hedge_policy (Literal['prices_include_existing_hedges; ratios_are_additional'])
currency_changes (Literal['reject', 'mask_boundary'])
diagnostics (bool)
normalization (FxIndexNormalization | None)
- __init__(prices, local_ccys, return_type, coordinate, reference_ccy=None, hedge_ratios=0.0, frequency='ME', cash_policy=<factory>, zero_return_to_nan=False, embedded_hedge_policy='prices_include_existing_hedges; ratios_are_additional', currency_changes='reject', diagnostics=False, normalization=None)¶
- Parameters:
prices (DataFrame)
return_type (FxReturnType)
coordinate (FxReturnCoordinate)
reference_ccy (str | None)
cash_policy (FxCashPolicy)
zero_return_to_nan (bool)
embedded_hedge_policy (Literal['prices_include_existing_hedges; ratios_are_additional'])
currency_changes (Literal['reject', 'mask_boundary'])
diagnostics (bool)
normalization (FxIndexNormalization | None)
- Return type:
None
Methods
__init__(prices, local_ccys, return_type, ...)Attributes
- return_type: FxReturnType¶
- coordinate: FxReturnCoordinate¶
- cash_policy: FxCashPolicy¶
- embedded_hedge_policy: Literal['prices_include_existing_hedges; ratios_are_additional'] = 'prices_include_existing_hedges; ratios_are_additional'¶
- normalization: FxIndexNormalization | None = None¶