About
The policy rate is the rate a central bank steers; it drives the carry of a currency pair and is the backdrop of most macro trades. The Bank for International Settlements collects the daily policy rates of central banks in one dataset, WS_CBPOL.
Before a run, the plugin downloads the rates of ten central banks and writes three feeds per currency: cbrate_usd (the rate in percent), cbrate_usd_days (days since the last change became known) and cbrate_usd_dir (1 when that change was a hike, -1 a cut). The currencies are usd (Fed), eur (ECB), gbp (Bank of England), jpy (Bank of Japan), chf (SNB), cad (Bank of Canada), aud (RBA), nzd (RBNZ), nok (Norges Bank) and sek (Riksbank).
When the run's instrument is a pair of two of these currencies, it also writes cbrate_gap_ plus the pair, for example cbrate_gap_audjpy: the base currency's rate minus the quote currency's, in percentage points. Positive means a long position in the pair earns the interest difference, before your broker's costs.
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. |
Use it in a strategy
pythonbars = ctx.bars(1)
if bars:
gap = ctx.data("cbrate_gap_audjpy", bars[-1].ts) # AUD rate minus JPY rate, in points
if gap is not None and gap < 0:
ctx.signal("EXIT") # no carry left for a long AUDJPYThe gap feed exists for the pair of the run (here an AUDJPY run). 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
cbrate_<ccy>Feed | The policy rate in percent per year for usd, eur, gbp, jpy, chf, cad, aud, nzd, nok and sek (cbrate_usd, cbrate_eur, ...), three business days after the day it applies. |
cbrate_<ccy>_daysFeed | Calendar days since the last change of that rate became known; starts at the first change in the data. |
cbrate_<ccy>_dirFeed | The direction of that last change: 1 for a hike, -1 for a cut. |
cbrate_gap_<base><quote>Feed | Only for a run on a pair of two covered currencies (AUDJPY gives cbrate_gap_audjpy): the base rate minus the quote rate in percentage points, on days both are known. |
Data source and terms
| Publisher | Bank for International Settlements, central bank policy rates (WS_CBPOL) |
|---|---|
| Terms | Read the terms |
| API key | None needed |
| Attribution | Source: BIS |
| Rate limit | One download of about 4 MB per refresh; the BIS publishes no limit. |
Hosts it may reach: stats.bis.org
When values are known
The BIS dates a rate by the day it applies. Most changes are announced days earlier, but some took effect the morning they were announced (Bank of England on 11 March 2020, Bank of Canada on 4 March 2020), and the early history of some series is a market rate published the next business day. So each value is stored three business days after the day it applies and carried forward for at most 45 days: a change shows up a few days late, never early.
Limits
- Not for trading the decision itself: a change appears days after the announcement. For the event, use the economic calendar (ctx.news_window).
- The policy rate is not the swap or rollover your broker charges; the gap shows the direction and size of carry, not what a position would have earned.
- Before a bank set a fixed policy rate, the BIS lists a market rate for some areas (the US effective federal funds rate in the early decades, for example); there it moves daily and the days and direction feeds mean little.
- The BIS updates the dataset about weekly and some areas lag behind; a rate changed since the last update shows the old value until the BIS has it. The data stays on your machine; the BIS asks to be named as the source.