Exchange rates

Daily exchange rates are available between most major currencies.

Retrieve exchange rate

fx(base, quote, source)

Retrieve the daily exchange rate between the two currencies. The value is the number of units of the quote currency required to buy one unit of the base currency. The currencies are specified using their three-letter ISO codes (ISO 4217).

Parameters:
  • base (str) – the base currency

  • quote (str) – the quote currency

  • source (str) – source of the currency rates, ‘factset’ (default) or ‘quandl’

The ‘quandl’ source provides exchange rates from the ECB that may be exported. The ‘factset’ source has better currency coverage, but is not exportable.

To get the exchange rate from pound sterling to US dollars:

fx('GBP', 'USD')

Currency conversion

Signals support the method signal.convert_currency. This method can be used in two different ways, depending on whether the original time series has a known currency or not.

Each data point is converted using the exchange rate of the corresponding date.

signal.convert_currency(currency)

Convert a signal to the given currency. This only works if the original time series has a known currency.

Parameters:

currency – The currency. Must be specified as a three-letter ISO code (ISO 4217).

signal.convert_currency(base, quote)

Convert a signal from one currency to another. This can be used for signals where the original time series does not have a known currency. In this case, you should specify the time series’ currency as the base currency.

For signals that are evaluated for a company, a company-relative identifier may be specified. The supported company-relative identifiers are:

  • factset_estimate: Represents the currency of factset estimates and actuals for the company.

  • factset_fundamental: Represents the currency of factset fundamental data for the company.

  • factset_price: Represents the currency of factset price data for the company.

Parameters:
  • base – The base currency. Must be specified either as a three-letter ISO code (ISO 4217) or as one of the company-relative currency identifiers.

  • quote – The quote currency. Must be specified either as a three-letter ISO code (ISO 4217) or as one of the company-relative currency identifiers.

To convert a time series whose currency is known, to GBP:

signal.convert_currency("GBP")

To convert the close price to NOK:

close_price.convert_currency("factset_price", "NOK")

To convert sales actual to EUR:

actual("sales").convert_currency("factset_estimate", "EUR")