Featured image of post Does Harry Browne's permanent portfolio withstand the test of time?

Does Harry Browne's permanent portfolio withstand the test of time?

A look a Harry Browne's Permanent Portfolio and performance over nearly four decades.

Introduction

Harry Browne was an influencial politician, financial advisor, and author who lived from 1933 to 2006 and published 12 books. Wikipedia has an in-depth biography on him.

Within the world of finance and investing, one of his best known works is Fail-Safe Investing: Lifelong Financial Security in 30 Minutes. In it, he introduces the idea of the “Permanent Portfolio”, an investment strategy that uses only four assets and is very simple to implement.

In this post, we will investigate Browne’s suggested portfolio, including performance across various market cycles and economic regimes.

Browne’s Portfolio Requirements

In Fail-Safe Investing, under rule #11, Browne lays out the requirements for a “bulletproof portfolio” that will “assure that your wealth will survive any event - including events that would be devastating to any one investment. In other words, this portfolio should protect you no matter what the future brings.

His requirements for the portfolio consist of the followng:

  1. Safety: Protection again any economic future, including “inflation, recession, or even depression”
  2. Stability: Performance should be consistent so that you will not need to make any changes and will not experience significant drawdowns
  3. Simplicity: Easy to implement and take very little time to maintain

He then describes the four “broad movements” of the economy:

  1. Prosperity: The economy is growing, business is doing well, interest rates are usually low
  2. Inflation: The cost of goods and services is rising
  3. Tight money or recession: The money supply is shrinking, economic activity is slowing
  4. Deflation: Prices are declining and the value of money is increasing

The Permanent Portfolio

Browne then matches an asset class to each of the economic conditions above:

  1. Prosperity -> Stocks (due to prosperity) and long term bonds (when interest rates fall)
  2. Inflation -> Gold
  3. Deflation -> Long term bonds (when interest rates fall)
  4. Tight money -> Cash

He completes the Permanent Portfolio by stipulating the following:

  • Start with a base allocation of 25% to each of the asset classes (stocks, bonds, gold, cash)
  • Rebalance back to the base allocation annually, or when “any of the four investments has become worth less than 15%, or more than 35%, of the portfolio’s overall value”
    Note: Browne does not specify when the portfolio should be rebalanced; therefore, we will make an assumption of a January 1st rebalance.

Data

For this exercise, we will use the following asset classes:

  1. Stocks: S&P 500 (SPXT_S&P 500 Total Return Index)
  2. Bonds: 10 Year US Treasuries (SPBDU10T_S&P US Treasury Bond 7-10 Year Total Return Index)
  3. Gold: Gold Spot Price (XAU_Gold USD Spot)
  4. Cash: USD

With the exception of cash, all data is sourced from Bloomberg.

We could use ETFs, but the available price history for the ETFs is much shorter than the indices above. If we wanted to use ETFs, the following would work:

  1. Stocks: IVV - iShares Core S&P 500 ETF
  2. Bonds: IEF - iShares 7-10 Year Treasury Bond ETF
  3. Gold: IAU - iShares Gold Trust
  4. Cash: USD

Python Functions

Here are the functions needed for this project:

  • bb_clean_data: Takes an Excel export from Bloomberg, removes the miscellaneous headings/rows, and returns a DataFrame.
  • df_info: A simple function to display the information about a DataFrame and the first five rows and last five rows.
  • df_info_markdown: Similar to the df_info function above, except that it coverts the output to markdown.
  • export_track_md_deps: Exports various text outputs to markdown files, which are included in the index.md file created when building the site with Hugo.
  • load_data: Load data from a CSV, Excel, or Pickle file into a pandas DataFrame.
  • pandas_set_decimal_places: Set the number of decimal places displayed for floating-point numbers in pandas.
  • strategy_harry_brown_perm_port: Execute the strategy for the Harry Brown permanent portfolio.
  • summary_stats: Generate summary statistics for a series of returns.

Data Overview

Load Data

As previously mentioned, the data for this exercise comes primarily from Bloomberg. We’ll start with loading the data first for bonds:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Set decimal places
pandas_set_decimal_places(3)

# Bonds dataframe
bb_clean_data(
    base_directory=DATA_DIR,
    fund_ticker_name="SPBDU10T_S&P US Treasury Bond 7-10 Year Total Return Index",
    source="Bloomberg",
    asset_class="Indices",
    excel_export=True,
    pickle_export=True,
    output_confirmation=True,
)

bonds_data = load_data(
    base_directory=DATA_DIR,
    ticker="SPBDU10T_S&P US Treasury Bond 7-10 Year Total Return Index_Clean",
    source="Bloomberg",
    asset_class="Indices",
    timeframe="Daily",
)

bonds_data['Date'] = pd.to_datetime(bonds_data['Date'])
bonds_data.set_index('Date', inplace = True)
bonds_data = bonds_data[(bonds_data.index >= '1990-01-01') & (bonds_data.index <= '2023-12-31')]
bonds_data.rename(columns={'Close':'Bonds_Close'}, inplace=True)
bonds_data['Bonds_Daily_Return'] = bonds_data['Bonds_Close'].pct_change()
bonds_data['Bonds_Total_Return'] = (1 + bonds_data['Bonds_Daily_Return']).cumprod()
display(bonds_data.head())

The following is the output:

DateBonds_CloseBonds_Daily_ReturnBonds_Total_Return
1990-01-02 00:00:0099.972nannan
1990-01-03 00:00:0099.733-0.0020.998
1990-01-04 00:00:0099.8130.0010.998
1990-01-05 00:00:0099.769-0.0000.998
1990-01-08 00:00:0099.681-0.0010.997

Then for stocks:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Stocks dataframe
bb_clean_data(
    base_directory=DATA_DIR,
    fund_ticker_name="SPXT_S&P 500 Total Return Index",
    source="Bloomberg",
    asset_class="Indices",
    excel_export=True,
    pickle_export=True,
    output_confirmation=True,
)

stocks_data = load_data(
    base_directory=DATA_DIR,
    ticker="SPXT_S&P 500 Total Return Index_Clean",
    source="Bloomberg",
    asset_class="Indices",
    timeframe="Daily",
)

stocks_data['Date'] = pd.to_datetime(stocks_data['Date'])
stocks_data.set_index('Date', inplace = True)
stocks_data = stocks_data[(stocks_data.index >= '1990-01-01') & (stocks_data.index <= '2023-12-31')]
stocks_data.rename(columns={'Close':'Stocks_Close'}, inplace=True)
stocks_data['Stocks_Daily_Return'] = stocks_data['Stocks_Close'].pct_change()
stocks_data['Stocks_Total_Return'] = (1 + stocks_data['Stocks_Daily_Return']).cumprod()
display(stocks_data.head())

The following is the output:

DateStocks_CloseStocks_Daily_ReturnStocks_Total_Return
1990-01-01 00:00:00nannannan
1990-01-02 00:00:00386.160nannan
1990-01-03 00:00:00385.170-0.0030.997
1990-01-04 00:00:00382.020-0.0080.989
1990-01-05 00:00:00378.300-0.0100.980

And finally, gold:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Gold dataframe
bb_clean_data(
    base_directory=DATA_DIR,
    fund_ticker_name="XAU_Gold USD Spot",
    source="Bloomberg",
    asset_class="Commodities",
    excel_export=True,
    pickle_export=True,
    output_confirmation=True,
)

gold_data = load_data(
    base_directory=DATA_DIR,
    ticker="XAU_Gold USD Spot_Clean",
    source="Bloomberg",
    asset_class="Commodities",
    timeframe="Daily",
)

gold_data['Date'] = pd.to_datetime(gold_data['Date'])
gold_data.set_index('Date', inplace = True)
gold_data = gold_data[(gold_data.index >= '1990-01-01') & (gold_data.index <= '2023-12-31')]
gold_data.rename(columns={'Close':'Gold_Close'}, inplace=True)
gold_data['Gold_Daily_Return'] = gold_data['Gold_Close'].pct_change()
gold_data['Gold_Total_Return'] = (1 + gold_data['Gold_Daily_Return']).cumprod()
display(gold_data.head())

The following is the output:

DateGold_CloseGold_Daily_ReturnGold_Total_Return
1990-01-02 00:00:00399.000nannan
1990-01-03 00:00:00395.000-0.0100.990
1990-01-04 00:00:00396.5000.0040.994
1990-01-05 00:00:00405.0000.0211.015
1990-01-08 00:00:00404.600-0.0011.014

Combine Data

We’ll now combine the dataframes for the timeseries data from each of the asset classes, as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Merge the stock data and bond data into a single DataFrame using their indices (dates)
perm_port = pd.merge(stocks_data['Stocks_Close'], bonds_data['Bonds_Close'], left_index=True, right_index=True)

# Add gold data to the portfolio DataFrame by merging it with the existing data on indices (dates)
perm_port = pd.merge(perm_port, gold_data['Gold_Close'], left_index=True, right_index=True)

# Add a column for cash with a constant value of 1 (assumes the value of cash remains constant at $1 over time)
perm_port['Cash_Close'] = 1

# Remove any rows with missing values (NaN) to ensure clean data for further analysis
perm_port.dropna(inplace=True)

# Display the finalized portfolio DataFrame
display(perm_port)

Check For Missing Values

We can check for any missing (NaN) values in each column:

1
2
# Check for any missing values in each column
perm_port.isnull().any()

DataFrame Info

Now, running:

1
df_info(perm_port)

Gives us the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
The columns, shape, and data types are:

<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 8479 entries, 1990-01-02 to 2023-12-29
Data columns (total 4 columns):
 #   Column        Non-Null Count  Dtype  
---  ------        --------------  -----  
 0   Stocks_Close  8479 non-null   float64
 1   Bonds_Close   8479 non-null   float64
 2   Gold_Close    8479 non-null   float64
 3   Cash_Close    8479 non-null   int64  
dtypes: float64(3), int64(1)
memory usage: 331.2 KB

The first 5 rows are:

DateStocks_CloseBonds_CloseGold_CloseCash_Close
1990-01-02 00:00:00386.1699.97399.001.00
1990-01-03 00:00:00385.1799.73395.001.00
1990-01-04 00:00:00382.0299.81396.501.00
1990-01-05 00:00:00378.3099.77405.001.00
1990-01-08 00:00:00380.0499.68404.601.00

The last 5 rows are:

DateStocks_CloseBonds_CloseGold_CloseCash_Close
2023-12-22 00:00:0010292.37604.172053.081.00
2023-12-26 00:00:0010335.98604.552067.811.00
2023-12-27 00:00:0010351.60609.362077.491.00
2023-12-28 00:00:0010356.59606.832065.611.00
2023-12-29 00:00:0010327.83606.182062.981.00

We can see that we have daily close price data for all 4 asset classes from the beginning of 1990 to the end of 2023.

Execute Strategy

Using an annual rebalance date of January 1, we’ll now execute the strategy with the following code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# List of funds to be used
fund_list = ['Stocks', 'Bonds', 'Gold', 'Cash']

# Starting cash contribution
starting_cash = 10000

# Monthly cash contribution
cash_contrib = 0

strat = strategy_harry_brown_perm_port(
    fund_list=fund_list, 
    starting_cash=starting_cash, 
    cash_contrib=cash_contrib, 
    close_prices_df=perm_port, 
    rebal_month=1, 
    rebal_day=1, 
    rebal_per_high=0.35, 
    rebal_per_low=0.15,
    excel_export=True,
    pickle_export=True,
    output_confirmation=True,
)

strat = strat.set_index('Date')

This returns a dataframe with the entire strategy.

Running:

1
df_info(strat)

Gives us:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
The columns, shape, and data types are:

<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 8479 entries, 1990-01-02 to 2023-12-29
Data columns (total 34 columns):
 #   Column                Non-Null Count  Dtype  
---  ------                --------------  -----  
 0   Stocks_Close          8479 non-null   float64
 1   Bonds_Close           8479 non-null   float64
 2   Gold_Close            8479 non-null   float64
 3   Cash_Close            8479 non-null   int64  
 4   Stocks_BA_Shares      8479 non-null   float64
 5   Stocks_BA_$_Invested  8479 non-null   float64
 6   Stocks_BA_Port_%      8479 non-null   float64
 7   Bonds_BA_Shares       8479 non-null   float64
 8   Bonds_BA_$_Invested   8479 non-null   float64
 9   Bonds_BA_Port_%       8479 non-null   float64
 10  Gold_BA_Shares        8479 non-null   float64
 11  Gold_BA_$_Invested    8479 non-null   float64
 12  Gold_BA_Port_%        8479 non-null   float64
 13  Cash_BA_Shares        8479 non-null   float64
 14  Cash_BA_$_Invested    8479 non-null   float64
 15  Cash_BA_Port_%        8479 non-null   float64
 16  Total_BA_$_Invested   8479 non-null   float64
 17  Contribution          8479 non-null   int64  
 18  Rebalance             8479 non-null   object 
 19  Stocks_AA_Shares      8479 non-null   float64
 20  Stocks_AA_$_Invested  8479 non-null   float64
 21  Stocks_AA_Port_%      8479 non-null   float64
 22  Bonds_AA_Shares       8479 non-null   float64
 23  Bonds_AA_$_Invested   8479 non-null   float64
 24  Bonds_AA_Port_%       8479 non-null   float64
 25  Gold_AA_Shares        8479 non-null   float64
 26  Gold_AA_$_Invested    8479 non-null   float64
 27  Gold_AA_Port_%        8479 non-null   float64
 28  Cash_AA_Shares        8479 non-null   float64
 29  Cash_AA_$_Invested    8479 non-null   float64
 30  Cash_AA_Port_%        8479 non-null   float64
 31  Total_AA_$_Invested   8479 non-null   float64
 32  Return                8478 non-null   float64
 33  Cumulative_Return     8478 non-null   float64
dtypes: float64(31), int64(2), object(1)
memory usage: 2.3+ MB

The first 5 rows are:

DateStocks_CloseBonds_CloseGold_CloseCash_CloseStocks_BA_SharesStocks_BA_$_InvestedStocks_BA_Port_%Bonds_BA_SharesBonds_BA_$_InvestedBonds_BA_Port_%Gold_BA_SharesGold_BA_$_InvestedGold_BA_Port_%Cash_BA_SharesCash_BA_$_InvestedCash_BA_Port_%Total_BA_$_InvestedContributionRebalanceStocks_AA_SharesStocks_AA_$_InvestedStocks_AA_Port_%Bonds_AA_SharesBonds_AA_$_InvestedBonds_AA_Port_%Gold_AA_SharesGold_AA_$_InvestedGold_AA_Port_%Cash_AA_SharesCash_AA_$_InvestedCash_AA_Port_%Total_AA_$_InvestedReturnCumulative_Return
1990-01-02 00:00:00386.1699.97399.0016.472500.000.2525.012500.000.256.272500.000.252500.002500.000.2510000.000No6.472500.000.2525.012500.000.256.272500.000.252500.002500.000.2510000.00nannan
1990-01-03 00:00:00385.1799.73395.0016.472493.590.2525.012494.020.256.272474.940.252500.002500.000.259962.550No6.472493.590.2525.012494.020.256.272474.940.252500.002500.000.259962.55-0.001.00
1990-01-04 00:00:00382.0299.81396.5016.472473.200.2525.012496.020.256.272484.340.252500.002500.000.259953.560No6.472473.200.2525.012496.020.256.272484.340.252500.002500.000.259953.56-0.001.00
1990-01-05 00:00:00378.3099.77405.0016.472449.110.2525.012494.920.256.272537.590.252500.002500.000.259981.630No6.472449.110.2525.012494.920.256.272537.590.252500.002500.000.259981.630.001.00
1990-01-08 00:00:00380.0499.68404.6016.472460.380.2525.012492.720.256.272535.090.252500.002500.000.259988.190No6.472460.380.2525.012492.720.256.272535.090.252500.002500.000.259988.190.001.00

The last 5 rows are:

DateStocks_CloseBonds_CloseGold_CloseCash_CloseStocks_BA_SharesStocks_BA_$_InvestedStocks_BA_Port_%Bonds_BA_SharesBonds_BA_$_InvestedBonds_BA_Port_%Gold_BA_SharesGold_BA_$_InvestedGold_BA_Port_%Cash_BA_SharesCash_BA_$_InvestedCash_BA_Port_%Total_BA_$_InvestedContributionRebalanceStocks_AA_SharesStocks_AA_$_InvestedStocks_AA_Port_%Bonds_AA_SharesBonds_AA_$_InvestedBonds_AA_Port_%Gold_AA_SharesGold_AA_$_InvestedGold_AA_Port_%Cash_AA_SharesCash_AA_$_InvestedCash_AA_Port_%Total_AA_$_InvestedReturnCumulative_Return
2023-12-22 00:00:0010292.37604.172053.0811.8118595.870.2925.0315124.460.238.0016426.120.2514717.1714717.170.2364863.620No1.8118595.870.2925.0315124.460.238.0016426.120.2514717.1714717.170.2364863.620.006.49
2023-12-26 00:00:0010335.98604.552067.8111.8118674.660.2925.0315134.200.238.0016543.970.2514717.1714717.170.2365070.010No1.8118674.660.2925.0315134.200.238.0016543.970.2514717.1714717.170.2365070.010.006.51
2023-12-27 00:00:0010351.60609.362077.4911.8118702.890.2925.0315254.360.238.0016621.420.2514717.1714717.170.2365295.840No1.8118702.890.2925.0315254.360.238.0016621.420.2514717.1714717.170.2365295.840.006.53
2023-12-28 00:00:0010356.59606.832065.6111.8118711.900.2925.0315191.100.238.0016526.370.2514717.1714717.170.2365146.540No1.8118711.900.2925.0315191.100.238.0016526.370.2514717.1714717.170.2365146.54-0.006.51
2023-12-29 00:00:0010327.83606.182062.9811.8118659.940.2925.0315175.010.238.0016505.330.2514717.1714717.170.2365057.440No1.8118659.940.2925.0315175.010.238.0016505.330.2514717.1714717.170.2365057.44-0.006.51

From the above, we can see that there are all columns for before/after re-balancing, including the shares, asset values, percentages, etc. for the four different asset classes.

Strategy Statistics

Let’s look at the summary statistics for the entire timeframe, as well as several different ranges:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sum_stats = summary_stats(
    fund_list=fund_list,
    df=strat[['Return']],
    period="Daily",
    excel_export=True,
    pickle_export=True,
    output_confirmation=True,
)

strat_pre_1999 = strat[strat.index < '2000-01-01']
sum_stats_pre_1999 = summary_stats(
    fund_list=fund_list, 
    df=strat_pre_1999[['Return']], 
    period="Daily",
    excel_export=False,
    pickle_export=False,
    output_confirmation=True,
)

strat_post_1999 = strat[strat.index >= '2000-01-01']
sum_stats_post_1999 = summary_stats(
    fund_list=fund_list, 
    df=strat_post_1999[['Return']], 
    period="Daily",
    excel_export=False,
    pickle_export=False,
    output_confirmation=True,
)

strat_post_2009 = strat[strat.index >= '2010-01-01']
sum_stats_post_2009 = summary_stats(
    fund_list=fund_list, 
    df=strat_post_2009[['Return']], 
    period="Daily",
    excel_export=False,
    pickle_export=False,
    output_confirmation=True,
)

And the concat them to make comparing them easier:

1
2
3
4
5
6
7
8
9
all_sum_stats = pd.concat([sum_stats])
all_sum_stats = all_sum_stats.rename(index={'Return': '1990 - 2023'})
all_sum_stats = pd.concat([all_sum_stats, sum_stats_pre_1999])
all_sum_stats = all_sum_stats.rename(index={'Return': 'Pre 1999'})
all_sum_stats = pd.concat([all_sum_stats, sum_stats_post_1999])
all_sum_stats = all_sum_stats.rename(index={'Return': 'Post 1999'})
all_sum_stats = pd.concat([all_sum_stats, sum_stats_post_2009])
all_sum_stats = all_sum_stats.rename(index={'Return': 'Post 2009'})
display(all_sum_stats)

Which gives us:

Annualized MeanAnnualized VolatilityAnnualized Sharpe RatioCAGRDaily Max ReturnDaily Max Return (Date)Daily Min ReturnDaily Min Return (Date)Max DrawdownPeakBottomRecovery Date
1990 - 20230.0570.0600.9570.0570.0292020-03-24 00:00:00-0.0302020-03-12 00:00:00-0.1542008-03-18 00:00:002008-11-12 00:00:002009-10-06 00:00:00
Pre 19990.0600.0501.2070.0610.0221999-09-28 00:00:00-0.0181993-08-05 00:00:00-0.0621998-07-20 00:00:001998-08-31 00:00:001998-11-05 00:00:00
Post 19990.0560.0640.8830.0560.0292020-03-24 00:00:00-0.0302020-03-12 00:00:00-0.1542008-03-18 00:00:002008-11-12 00:00:002009-10-06 00:00:00
Post 20090.0560.0600.9270.0560.0292020-03-24 00:00:00-0.0302020-03-12 00:00:00-0.1272021-12-27 00:00:002022-10-20 00:00:002023-12-01 00:00:00

Annual Returns

Here’s the annual returns:

YearReturn
19910.102
19920.030
19930.099
1994-0.017
19950.153
19960.049
19970.056
19980.102
19990.039
20000.000
2001-0.005
20020.043
20030.121
20040.051
20050.064
20060.104
20070.117
2008-0.033
20090.107
20100.137
20110.070
20120.068
2013-0.006
20140.052
2015-0.018
20160.052
20170.095
2018-0.012
20190.145
20200.134
20210.057
2022-0.082
20230.109

Since the strategy, summary statistics, and annual returns are all exported as excel files, they can be found at the following locations:

Next we will look at some plots to help visualize the data.

Generate Plots

Here are the various functions needed for the plots:

Plot Cumulative Return

Plot cumulative return:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def plot_cumulative_return(strat_df):
    # Generate plot
    plt.figure(figsize=(10, 5), facecolor = '#F5F5F5')

    # Plotting data
    plt.plot(strat_df.index, strat_df['Cumulative_Return'], label = 'Strategy Cumulative Return', linestyle='-', color='green', linewidth=1)
    
    # Set X axis
    # x_tick_spacing = 5  # Specify the interval for x-axis ticks
    # plt.gca().xaxis.set_major_locator(MultipleLocator(x_tick_spacing))
    plt.gca().xaxis.set_major_locator(mdates.YearLocator())
    plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
    plt.xlabel('Year', fontsize = 9)
    plt.xticks(rotation = 45, fontsize = 7)
    # plt.xlim(, )

    # Set Y axis
    y_tick_spacing = 0.5  # Specify the interval for y-axis ticks
    plt.gca().yaxis.set_major_locator(MultipleLocator(y_tick_spacing))
    plt.ylabel('Cumulative Return', fontsize = 9)
    plt.yticks(fontsize = 7)
    plt.ylim(0, 7.5)

    # Set title, etc.
    plt.title('Cumulative Return', fontsize = 12)
    
    # Set the grid & legend
    plt.tight_layout()
    plt.grid(True)
    plt.legend(fontsize=8)

    # Save the figure
    plt.savefig('03_Cumulative_Return.png', dpi=300, bbox_inches='tight')

    # Display the plot
    return plt.show()

Plot Portfolio Values

Plot portfolio values:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def plot_values(strat_df):   
    # Generate plot   
    plt.figure(figsize=(10, 5), facecolor = '#F5F5F5')
    
    # Plotting data
    plt.plot(strat_df.index, strat_df['Total_AA_$_Invested'], label='Total Portfolio Value', linestyle='-', color='black', linewidth=1)
    plt.plot(strat_df.index, strat_df['Stocks_AA_$_Invested'], label='Stocks Position Value', linestyle='-', color='orange', linewidth=1)
    plt.plot(strat_df.index, strat_df['Bonds_AA_$_Invested'], label='Bond Position Value', linestyle='-', color='yellow', linewidth=1)
    plt.plot(strat_df.index, strat_df['Gold_AA_$_Invested'], label='Gold Position Value', linestyle='-', color='blue', linewidth=1)
    plt.plot(strat_df.index, strat_df['Cash_AA_$_Invested'], label='Cash Position Value', linestyle='-', color='brown', linewidth=1)

    # Set X axis
    # x_tick_spacing = 5  # Specify the interval for x-axis ticks
    # plt.gca().xaxis.set_major_locator(MultipleLocator(x_tick_spacing))
    plt.gca().xaxis.set_major_locator(mdates.YearLocator())
    plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
    plt.xlabel('Year', fontsize = 9)
    plt.xticks(rotation = 45, fontsize = 7)
    # plt.xlim(, )


    # Set Y axis
    y_tick_spacing = 5000  # Specify the interval for y-axis ticks
    plt.gca().yaxis.set_major_locator(MultipleLocator(y_tick_spacing))
    plt.gca().yaxis.set_major_formatter(mtick.FuncFormatter(lambda x, pos: '{:,.0f}'.format(x))) # Adding commas to y-axis labels
    plt.ylabel('Total Value ($)', fontsize = 9)
    plt.yticks(fontsize = 7)
    plt.ylim(0, 75000)

    # Set title, etc.
    plt.title('Total Values For Stocks, Bonds, Gold, and Cash Positions and Portfolio', fontsize = 12)
    
    # Set the grid & legend
    plt.tight_layout()
    plt.grid(True)
    plt.legend(fontsize=8)

    # Save the figure
    plt.savefig('04_Portfolio_Values.png', dpi=300, bbox_inches='tight')

    # Display the plot
    return plt.show()

Plot Portfolio Drawdown

Plot portfolio drawdown:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def plot_drawdown(strat_df):
    rolling_max = strat_df['Total_AA_$_Invested'].cummax()
    drawdown = (strat_df['Total_AA_$_Invested'] - rolling_max) / rolling_max * 100

    # Generate plot   
    plt.figure(figsize=(10, 5), facecolor = '#F5F5F5')

    # Plotting data
    plt.plot(strat_df.index, drawdown, label='Drawdown', linestyle='-', color='red', linewidth=1)
    
    # Set X axis
    # x_tick_spacing = 5  # Specify the interval for x-axis ticks
    # plt.gca().xaxis.set_major_locator(MultipleLocator(x_tick_spacing))
    plt.gca().xaxis.set_major_locator(mdates.YearLocator())
    plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
    plt.xlabel('Year', fontsize = 9)
    plt.xticks(rotation = 45, fontsize = 7)
    # plt.xlim(, )

    # Set Y axis
    y_tick_spacing = 1  # Specify the interval for y-axis ticks
    plt.gca().yaxis.set_major_locator(MultipleLocator(y_tick_spacing))
    # plt.gca().yaxis.set_major_formatter(mtick.FuncFormatter(lambda x, pos: '{:,.0f}'.format(x))) # Adding commas to y-axis labels
    plt.gca().yaxis.set_major_formatter(mtick.FuncFormatter(lambda x, pos: '{:.0f}'.format(x))) # Adding 0 decimal places to y-axis labels
    plt.ylabel('Drawdown (%)', fontsize = 9)
    plt.yticks(fontsize = 7)
    plt.ylim(-20, 0)

    # Set title, etc.
    plt.title('Portfolio Drawdown', fontsize = 12)
    
    # Set the grid & legend
    plt.tight_layout()
    plt.grid(True)
    plt.legend(fontsize=8)

    # Save the figure
    plt.savefig('05_Portfolio_Drawdown.png', dpi=300, bbox_inches='tight')

    # Display the plot
    return plt.show()

Plot Portfolio Asset Weights

Plot portfolio asset weights:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def plot_asset_weights(strat_df):
    # Generate plot   
    plt.figure(figsize=(10, 5), facecolor = '#F5F5F5')
    
    # Plotting data
    plt.plot(strat_df.index, strat_df['Stocks_AA_Port_%'] * 100, label='Stocks Portfolio Weight', linestyle='-', color='orange', linewidth=1)
    plt.plot(strat_df.index, strat_df['Bonds_AA_Port_%'] * 100, label='Bonds Portfolio Weight', linestyle='-', color='yellow', linewidth=1)
    plt.plot(strat_df.index, strat_df['Gold_AA_Port_%'] * 100, label='Gold Portfolio Weight', linestyle='-', color='blue', linewidth=1)
    plt.plot(strat_df.index, strat_df['Cash_AA_Port_%'] * 100, label='Cash Portfolio Weight', linestyle='-', color='brown', linewidth=1)

    # Set X axis
    # x_tick_spacing = 5  # Specify the interval for x-axis ticks
    # plt.gca().xaxis.set_major_locator(MultipleLocator(x_tick_spacing))
    plt.gca().xaxis.set_major_locator(mdates.YearLocator())
    plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
    plt.xlabel('Year', fontsize = 9)
    plt.xticks(rotation = 45, fontsize = 7)
    # plt.xlim(, )

    # Set Y axis
    y_tick_spacing = 2  # Specify the interval for y-axis ticks
    plt.gca().yaxis.set_major_locator(MultipleLocator(y_tick_spacing))
    # plt.gca().yaxis.set_major_formatter(mtick.FuncFormatter(lambda x, pos: '{:,.0f}'.format(x))) # Adding commas to y-axis labels
    plt.ylabel('Asset Weight (%)', fontsize = 9)
    plt.yticks(fontsize = 7)
    plt.ylim(14, 36)

    # Set title, etc.
    plt.title('Portfolio Asset Weights For Stocks, Bonds, Gold, and Cash Positions', fontsize = 12)
    
    # Set the grid & legend
    plt.tight_layout()
    plt.grid(True)
    plt.legend(fontsize=8)

    # Save the figure
    plt.savefig('07_Portfolio_Weights.png', dpi=300, bbox_inches='tight')

    # Display the plot
    return plt.show()

Execute plots:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
plot_cumulative_return(strat)
plot_values(strat)
plot_drawdown(strat)
plot_asset_weights(strat)

# Create dataframe for the annual returns
strat_annual_returns = strat['Cumulative_Return'].resample('Y').last().pct_change().dropna()
strat_annual_returns_df = strat_annual_returns.to_frame()
strat_annual_returns_df['Year'] = strat_annual_returns_df.index.year  # Add a 'Year' column with just the year
strat_annual_returns_df.reset_index(drop=True, inplace=True)  # Reset the index to remove the datetime index

# Now the DataFrame will have 'Year' and 'Cumulative_Return' columns
strat_annual_returns_df = strat_annual_returns_df[['Year', 'Cumulative_Return']]  # Keep only 'Year' and 'Cumulative_Return' columns
strat_annual_returns_df.rename(columns = {'Cumulative_Return':'Return'}, inplace=True)
strat_annual_returns_df.set_index('Year', inplace=True)
display(strat_annual_returns_df)

plan_name = '_'.join(fund_list)
file = plan_name + "_Annual_Returns.xlsx"
location = file
strat_annual_returns_df.to_excel(location, sheet_name='data')

plot_annual_returns(strat_annual_returns_df)

Here are several relevant plots:

  1. Cumulative Return

Cumulative Return

  1. Portfolio Values (Total, Stocks, Bonds, Gold, and Cash)

Portfolio Values

Here we can see the annual rebalancing taking effect with the values of the different asset classes. This can also be seen more clearly below.

  1. Portfolio Drawdown

Portfolio Drawdown

From this plot, we can see that the maximum drawdown came during the GFC; the drawdown during COVID was (interestingly) less than 10%.

  1. Portfolio Asset Weights

Portfolio Weights

The annual rebalancing appears to work effectively by selling assets that have increased in value and buying assets that have decreased in value over the previous year. Also note that there is only one instance when the weight of an asset fell to 15%. This occured for stocks during the GFC.

  1. Portfolio Annual Returns

Portfolio Annual Returns

It’s interesting to see that there really aren’t any significant up or down years. Instead, it’s a steady climb without much volatility.

Summary

Overall, this is an interesting case study and Browne’s idea behind the Permanent Portfolio is certainly compelling. There might be more investigation to be done with respect to the following:

  • Investigate the extent to which the rebalancing date effects the portfolio performance
  • Vary the weights of the asset classes to see if there is a meanful change in the results
  • Experiment with leverage (i.e., simulating 1.2x leverage with a portfolio with weights of 30, 30, 30, 10 for stocks, bonds, gold, cash respectively.)
  • Use ETFs instead of Bloomberg index data, and verify the results are similar. ETF data is much more available than the Bloomberg index.

References

  1. Fail-Safe Investing: Lifelong Financial Security in 30 Minutes, by Harry Browne

Code

The jupyter notebook with the functions and all other code is available here.
The html export of the jupyter notebook is available here.
The pdf export of the jupyter notebook is available here.

Built with Hugo
Theme Stack designed by Jimmy