Every TARGET business day the ECB publishes one reference rate per currency against the euro, around 16:00 CET. It is an official daily fixing, used in contracts, accounting and tax, and a neutral yardstick next to your broker's prices.
Before a run, the plugin downloads the rates from the ECB data portal and writes one feed per currency, named ecb_eur plus the currency code in lower case: ecb_eurusd, ecb_eurjpy, ecb_eurgbp. The value is units of that currency per 1 euro, as the ECB quotes it. When the run's instrument is a currency pair without the euro, such as GBPUSD, it also writes the cross ecb_gbpusd (US dollars per pound), computed day by day from the two euro rates.
Other plugins can rely on these names, for example to convert results to euro.
Configuration
Field
Type
Default
Description
cache_daysRefetch after (days)
number
1
Days before the plugin downloads the rates again. Within that time a run reads the cached feeds and needs no network.
currenciesCurrencies (all, or codes such as USD,JPY,GBP)
string
"all"
Which currencies to fetch: all (every currency the ECB publishes, about 15 MB) or a list of codes such as USD,JPY,GBP for a smaller download. The two currencies of the run's pair are always added.
Use it in a strategy
pythonbars = ctx.bars(1)
if bars:
fix = ctx.data("ecb_eurusd", bars[-1].ts) # US dollars per euro, the last fix known
if fix is not None and bars[-1].close > fix * 1.01:
ctx.signal("EXIT")
The feeds are refreshed before a run whose strategy reads ctx.data, or when "Fetch external data (news and plugin feeds)" is ticked. A run on the server never fetches.
What it provides
ecb_eur<ccy>Feed
One feed per currency, the code in lower case (ecb_eurusd, ecb_eurjpy, ecb_eurchf): units of that currency per 1 euro, under each day from the day after the fix.
ecb_<base><quote>Feed
Only when the run's instrument is a currency pair without the euro (GBPUSD gives ecb_gbpusd): quote currency per 1 unit of the base currency, the ratio of the two euro rates, rounded to 6 significant digits.
One download per refresh; the ECB publishes no limit. All currencies over the whole history is about 15 MB.
Hosts it may reach: data-api.ecb.europa.eu
When values are known
The ECB publishes the rates around 16:00 CET on the day they are for, so each rate is stored under the next calendar day and carried forward over weekends and TARGET holidays, for at most 7 days. A bar on Monday reads Friday's fix; a bar during the day of a fix never sees it, not even after 16:00.
Limits
A reference rate is a snapshot at about 14:10 CET for information; it is not a price you could have traded at, and it says nothing about the rest of the day.
Only currencies the ECB quotes, and only on TARGET business days. A currency the ECB stopped quoting (RUB since March 2022, BGN since Bulgaria joined the euro) ends 7 days after its last fix.
Crosses are computed from two euro rates, not quoted by the ECB, so they can differ from market prices in the last digits.
The data is downloaded to your machine and stays there; the ECB asks for the source line "Source: ECB statistics" wherever you show it.