Get the Current Account Balance to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Current Account Balance to GDP Ratio is the ratio of the sum of the balance of trade (exports minus imports of goods and services), net factor income (such as interest and dividends) and net transfer payments (such as foreign aid) to the Gross Domestic Product (GDP).

Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html

The ratio is expressed as a decimal fraction (-0.0211 for -2.11% of GDP).

Changed in v2.2.0: this used to be returned in percentage points. It is now a decimal fraction, matching every other ratio in the Finance Toolkit.

Also known as: current account to GDP.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Account Balance to GDP for you. Just ask in plain English.

Calculate the Account Balance to GDP in Python

The Account Balance to GDP is available in the Economics module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_current_account_balance_to_gdp_ratio as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2015-01-01')

economics.get_current_account_balance_to_gdp_ratio(countries=[
    'Poland', 'Turkey', 'United Kingdom'])

Which returns:

  Poland Turkey United Kingdom
2015 -0.0129 -0.0246 -0.0495
2016 -0.0102 -0.0255 -0.0545
2017 -0.0116 -0.0409 -0.0349
2018 -0.0193 -0.0183 -0.0393
2019 -0.0025 0.0197 -0.0269
2020 0.0248 -0.0434 -0.0293
2021 -0.0124 -0.008 -0.0044
2022 -0.0244 -0.0506 -0.021
2023 0.0155 -0.0398 -0.0196
2024 0.0085 -0.0216 -0.0279
2025 -0.0002 -0.0207 -0.0283
2026 -0.0043 -0.0201 -0.028

Parameters

get_current_account_balance_to_gdp_ratio 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.
  • growth (bool, optional): Whether to return the growth data or the actual data. Defaults to False.
  • lag (int, optional): The number of periods to lag the growth data. Defaults to 1.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.

The Economics module page introduces the module, and the sidebar lists all of its functions.

Share