3 ways to clearly measure your investment skill

August 26, 2023
Facebook logo.
Twitter logo.
LinkedIn logo.
Get this code in Google Colab

3 ways to clearly measure your investment skill

In today's newsletter, we'll explore three ways to use batting average—a statistical method used by professional investors to measure investment skill.

Whether you’re a professional or not, understanding how to calculate and interpret your batting average can provide valuable insight into your investment performance.

Let's get started!

3 ways to clearly measure your investment skill

The batting average measures investment skill—how often an investment manager beats a specific index, like the S&P 500 or Nasdaq.

This index is used as a benchmark that helps evaluate the manager's performance. A higher batting average means the manager often meets or surpasses the benchmark.

This is a sign of investment skill. It means the manager is consistently able to outperform their benchmark.

You can use the batting average to measure your own investment performance against a chosen benchmark. Doing this will help determine if you’re better of just investing in the underlying index.

You can use batting average to gauge your investment skill like the professionals with Python.

Here's how.

Imports and set up

First, import the tools we’ll need including NumPy, pandas, and the OpenBB SDK.

1import numpy as np
2import pandas as pd
3from openbb_terminal.sdk import openbb

Now, download price data and compute returns.

1prices = openbb.economy.index([
2    "META", 
3    "AAPL", 
4    "AMZN", 
5    "NFLX", 
6    "GOOG", 
7    "QQQ"
8])
9
10returns = prices.pct_change().dropna()
11bench_returns = returns.pop("QQQ")
12port_returns = (returns * 0.2).sum(axis=1)

We’ll assume an equal-weighted, non-rebalancing portfolio of the FAANG stocks. We include QQQ in the download, then pop it off to compute the benchmark returns.

Compute the batting average

Create a function that computes the batting average. We’ll walk through the code next.

1def batting_average(port_returns, bench_returns):
2    results = dict(
3        {
4            "batting average": np.nan,
5            "up market": np.nan,
6            "down market": np.nan,
7        }
8    )
9    active_returns = port_returns - bench_returns
10    ba = active_returns > 0
11    up = active_returns[bench_returns >= 0.0] > 0
12    down = active_returns[bench_returns < 0.0] > 0
13
14    if len(ba) > 0:
15        results["batting average"] = ba.mean()
16    if len(up) > 0:
17        results["up market"] = up.mean()
18    if len(down) > 0:
19        results["down market"] = down.mean()
20
21    return pd.Series(results, index=results.keys())

The first step is to create a dictionary with three keys: batting average, up market, and down market. We set these to np.nan as a default.

Next, we compute the active returns which are the returns earned above the benchmark.

From there, we create three variables that use boolean indexing to identify when the active returns are positive. The result of each of these is a pandas Series with the boolean True when the active return is positive, and False when it’s not.

We repeat the process for when the benchmark has positive returns and again for when it has negative returns.

Taking the mean of each of these Series gives us the average number of times the portfolio beat the benchmark.

Interpret the results

In this example, the batting average is 50.5%. When the benchmark is up, the batting average raises to 56% and when it’s down it falls to 43.7%.

This means the portfolio just meets the minimum threshold of a successful strategy.

Investment managers are paid to outperform the benchmark. The batting average is a great way to determine if their strategy is worth the expense.

For individual investors, active portfolio management comes with risk and opportunity cost. If you were trading this portfolio, you might consider investing in the benchmark instead.

Next steps

This example uses an equal-weighted, non-rebalancing portfolio of the FAANG stocks.

As a next step, generate a return series for your own investment strategy. Then compare it to a benchmark that best represents the stocks inside.

Man with glasses and a wristwatch, wearing a white shirt, looking thoughtfully at a laptop with a data screen in the background.