qis.get_aligned_fx_spots

qis.get_aligned_fx_spots(prices, asset_ccy_map, fx_prices, quote_currency='USD', bfill_fx=False)[source]

The FX spot series belonging to each instrument, on the index of its prices.

An instrument panel is quoted in mixed currencies, and converting it needs a spot series per instrument rather than per currency. This maps each column of prices through its currency to the matching spot column, reindexes onto the price dates, and masks where the price is missing. By default, a spot remains missing until its first observation is available. Quotes are aligned as-of, retaining off-grid updates and using no future observation. Explicit bfill_fx=True fills leading gaps from a later aligned quote: this introduces look-ahead and is for descriptive historical replay only, not historical trading decisions. Previously backfilled input values cannot be distinguished from observed quotes here.

Parameters:
  • prices (DataFrame) – instrument prices, one column per instrument

  • asset_ccy_map (Series | Dict) – instrument to currency, as a Series indexed by instrument or a dict

  • fx_prices (DataFrame) – FX spots, one column per currency

  • quote_currency (str) – the numeraire, whose spot column is set to one

  • bfill_fx (bool) – default False; True fills leading gaps using a later quote (look-ahead)

Returns:

spots with the same index, columns, shape, and row order as prices

Return type:

DataFrame