Today, we added a new feature to pipeline: currency conversion. Pricing, fundamentals, and estimates data all have columns of data that are measured in units of currency. Now, you can use a new method, .fx
, to convert those columns to any supported currency on Quantopian. Additionally, you can see the default currency per asset in each dataset with a special new currency
column.
The following example uses currency
to display the default currency of each asset, and .fx
to convert GB equity prices to Euro (run in Research):
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data import EquityPricing
from quantopian.pipeline.domain import GB_EQUITIES
from quantopian.research import run_pipeline
pipe = Pipeline(
columns={
'close_price_EUR': EquityPricing.close.fx('EUR').latest,
'close_price_default_curr': EquityPricing.currency.latest,
},
domain=GB_EQUITIES
)
df = run_pipeline(pipe, '2015-01-01', '2016-01-01')
With the new support for currency conversion in pipelines, it is now possible to work with markets that have multiple listing currencies (e.g. GB and HK), and also work across multiple domains in the same unit of measurement. Attached to this post is a notebook with a lot more information on currency conversion, the .fx
method, and more. Check it out to learn more about currency conversion, and how it's implemented in Pipeline. The new feature is also documented here.