qis.compute_cash_fx_adjusted_returns¶
- qis.compute_cash_fx_adjusted_returns(prices, fx_spots, periods=1, is_log_returns=False)[source]¶
returns of a cash position in a foreign currency, converted to the quote currency.
For a cash instrument the whole notional sits in the foreign currency, so the FX move applies to the notional as well as to the return:
r = r_fx + r_local + r_local * r_fx. The extrar_fxterm is the difference fromcompute_futures_fx_adjusted_returns(), and it is the whole of the unhedged currency exposure.- Parameters:
prices (DataFrame) – instrument prices in local currency
fx_spots (DataFrame) – spot per instrument, aligned with
prices; seeget_aligned_fx_spots()periods (int) – return horizon in index steps
is_log_returns (bool) – return log returns rather than arithmetic ones
- Returns:
quote-currency returns in the shape of
prices- Return type: