Exchange rates
Daily exchange rates from FactSet are available between most major currencies.
Retrieve exchange rates
- 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
To get the exchange rate from pound sterling to US dollars (
GBPUSD
pair):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 currency set 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 set a currency.
- Parameters:
currency – The currency. Must be specified as a three-letter ISO code (ISO 4217).
To convert a currency-aware time series to Pound Sterling:
signal.convert_currency("GBP")
- 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 currency set, but you nevertheless know which currency it has. In this case, you should specify the time series’ currency as the base currency.
If the time series does have a known currency, it is recommended to use the one-argument version of this signal.
For signals that are evaluated for a company, a company-relative identifier may be specified. The supported company-relative identifiers are:
Identifier
Meaning
factset_estimate
The currency of FactSet estimates and actuals for the company.
factset_fundamental
The currency of FactSet fundamentals data for the company.
factset_price
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 which does not have a currency set, but where you know that the currency is the same as the currency of the FactSet estimates:
signal.convert_currency("factset_price", "EUR")