Calculates and collects all performance metrics.

All Performance Metrics in Python

collect_all_metrics is part of the Performance module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call collect_all_metrics as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.performance.collect_all_metrics().xs("AAPL", level=1, axis=1)

Which returns:

  Win Rate Upside Capture Ratio Downside Capture Ratio M2 Ratio Tracking Error
2021 0.5253 1.4003 1.1039 0.0065 0.0108
2022 0.4781 1.3096 1.3186 -0.1669 0.0115
2023 0.576 1.1815 0.9655 0.3293 0.009
2024 0.5 1.117 1.0492 0.1905 0.0121
2025 0.472 1.0324 1.1132 0.0709 0.0139
2026 0.5099 0.678 0.5418 0.0919 0.0169

Parameters

collect_all_metrics accepts the following parameters:

  • period (str, optional): The period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”.
  • rounding (int, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the ratios. Defaults to False.
  • lag (int | str, optional): The lag to use for the growth calculation. 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.
Share