Currency Crisis
Get the Currency Crisis dummy for a variety of countries over time from the Global Macro Database (GMDB). Unlike the other indicators in this module, this is a binary (0 = no crisis, 1 = crisis) Reinhart & Rogoff style crisis-dating series rather than a continuous economic series: a value of 1 marks a year in which a country was undergoing a currency crisis (e.g. a sharp, disorderly depreciation or collapse of the exchange rate), and 0 marks a year in which it was not.
The crisis dating stops well short of the present – the series currently ends in 2017 – so recent years are NaN rather than 0.
Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html
Also known as: currency collapse, exchange rate crisis dummy.
Currency Crisis in Python
get_currency_crisis is part of the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_currency_crisis as shown below.
from financetoolkit import Economics
economics = Economics(start_date='1990-01-01')
economics.get_currency_crisis(countries='Turkey')
Which returns:
| Turkey | |
|---|---|
| 2015 | 0 |
| 2016 | 0 |
| 2017 | 0 |
| 2018 | nan |
| 2019 | nan |
Parameters
get_currency_crisis accepts the following parameters:
- countries (list[str] | str | None, optional): A list of countries or a single country to include in the results. Defaults to None.
- rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
- trailing (int, optional): The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.
- rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.