Turnover
Calculate the turnover of the portfolio, the value traded as a share of the value held: how much of the portfolio the transactions replace.
A turnover of 0.1 on a day means that a tenth of the portfolio’s value was bought or sold.
- Traded Value = Σ |volume × price| of the day’s transactions
- Gross Value = Σ |value of every position|
- Turnover = Traded Value / ((Gross Value_t + Gross Value_t-1) / 2)
The traded value can also be divided by the net value of the positions that day instead. Over weeks, months, quarters or years the traded values and the daily turnovers are added up and the value is that at the end of the period.
Also known as: portfolio turnover, turnover rate, trading activity.
Example
Install the Finance Toolkit with pip install financetoolkit -U, then call get_turnover:
from financetoolkit import Portfolio
portfolio = Portfolio(example=True, api_key="FINANCIAL_MODELING_PREP_KEY")
portfolio.get_turnover(period="yearly")
Which returns:
| Date | Traded Value | Gross Value | Turnover |
|---|---|---|---|
| 2000 | 3,657.080 | 2,392.28 | 4.1243 |
| 2001 | 1,569.550 | 4,798.28 | 0.4154 |
| 2002 | 1,693.630 | 5,422.30 | 0.3135 |
| 2003 | 1,456.490 | 8,204.56 | 0.2284 |
| 2004 | 1,518.380 | 10,365.30 | 0.1683 |
| 2005 | 1,918.150 | 13,539.30 | 0.1678 |
| 2006 | 2,377.660 | 16,209.00 | 0.1559 |
| 2007 | 3,585.340 | 19,071.40 | 0.2099 |
| 2008 | 1,123.910 | 12,108.20 | 0.0745 |
| 2009 | 3,013.990 | 20,985.50 | 0.1933 |
| 2010 | 2,621.670 | 25,801.10 | 0.1206 |
| 2011 | 3,174.610 | 26,933.10 | 0.1253 |
| 2012 | 5,141.610 | 34,851.30 | 0.1546 |
| 2013 | 522.848 | 49,217.50 | 0.0121 |
| 2014 | 3,364.750 | 54,772.70 | 0.0674 |
| 2015 | 2,003.660 | 61,747.10 | 0.0349 |
| 2016 | 2,364.380 | 78,378.20 | 0.0384 |
| 2017 | 7,271.190 | 117,708.00 | 0.0743 |
| 2018 | 6,702.230 | 125,233.00 | 0.0507 |
| 2019 | 7,866.050 | 206,431.00 | 0.0445 |
| 2020 | 15,353.600 | 328,089.00 | 0.0631 |
| 2021 | 5,121.040 | 435,818.00 | 0.0137 |
| 2022 | 18,121.500 | 337,393.00 | 0.0569 |
| 2023 | 6,215.220 | 547,989.00 | 0.0142 |
| 2024 | 35,203.600 | 739,785.00 | 0.0510 |
| 2025 | 0.000 | 908,218.00 | 0.0000 |
| 2026 | 0.000 | 892,993.00 | 0.0000 |
27 rows
Parameters
get_turnover accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
denominator | str | Options are: “gross_value” (pyfolio’s “AGB”, the average of the gross value of the day and the day before), “net_value” (pyfolio’s “portfolio_value”). Defaults to “gross_value”. | "gross_value" |
period | str | The period over which the traded values and turnovers are added up. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “daily”. | "weekly" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the Portfolio’s rounding. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Bacon, C. R. (2008). “Practical Portfolio Performance Measurement and Attribution.” 2nd edition, Wiley.
- Library Shares similar logic as pyfolio’s get_turnover