Share Prices
Share price indices are calculated from the prices of common shares of companies traded on national or foreign stock exchanges. They are usually determined by the stock exchange, using the closing daily values for the monthly data, and normally expressed as simple arithmetic averages of the daily data.
A share price index measures how the value of the stocks in the index is changing, a share return index tells the investor what their “return” is, meaning how much money they would make as a result of investing in that basket of shares.
A price index measures changes in the market capitalisation of the basket of shares in the index whereas a return index adds on to the price index the value of dividend payments, assuming they are re-invested in the same stocks. Occasionally agencies such as central banks will compile share indices.
This uses 2015 as the base year (= 100)
See definition: https://data.oecd.org/price/share-prices.htm
Also known as: stock market index, equity index, market performance.
Share Prices in Python
get_share_prices is part of the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_share_prices as shown below.
from financetoolkit import Economics
economics = Economics(start_date="2013-01-01")
economics.get_share_prices(countries=['Turkey', 'Belgium', 'Australia'])
Which returns:
| Turkey | Belgium | Australia | |
|---|---|---|---|
| 2013 | 96.6029 | 74.3936 | 92.3054 |
| 2014 | 93.2354 | 87.8382 | 98.611 |
| 2015 | 100 | 100 | 100 |
| 2016 | 95.6644 | 95.2324 | 96.0699 |
| 2017 | 122.746 | 101.514 | 105.648 |
| 2018 | 126.263 | 96.5515 | 109.205 |
| 2019 | 123.056 | 92.6847 | 117.326 |
| 2020 | 140.511 | 77.8758 | 111.188 |
| 2021 | 187.146 | 91.6789 | 130.475 |
| 2022 | 369.298 | 93.0484 | 128.367 |
| 2023 | 785.903 | 97.9468 | 131.286 |
| 2024 | 1190.71 | 106.289 | 143.996 |
Parameters
get_share_prices accepts the following parameters:
- countries (list[str] | str | None, optional): The countries to include in the data. Defaults to None.
- period (str | None, optional): Whether to return the monthly, quarterly or the annual data.
- 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.
- lag (int, optional): The number of periods to lag the data by.
- 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.