Use Your Computer to Make Informed Decisions in Stock Trading: Practical Introduction — Part 12: All Weather Portfolio (of ETFs) with Crypto

Ivan Brigida
13 min readAug 25, 2023


Fisherman boat on a sunny day

[HINT] You can read my previous articles on Medium or on the website PythonInvest (which features more dynamic content). The complete Python code (Colab notebooks) can be found on Github.


During periods of financial uncertainty, preserving capital becomes a key focus. Ray Dalio’s All Weather Portfolio, renowned for its approach to portfolio optimization, is designed around asset classes that have shown resilience in various economic conditions. Its construction aims for diversification, enabling steady growth with minimal drawdowns. In the following article, we will reconstruct the All Weather Portfolio and examine it alongside alternative methods of weight allocation.

There is a related introductory article on Practical Portfolio Optimisation — please read it carefully to understand the ‘philosophy’ of Portfolio Optimisation and major underlying principles.

Summary of Results

01. The All Weather Portfolio Remains a Viable Option
A testament to its enduring strength, the All Weather Portfolio proves that classics are never out of fashion, delivering 5–6% in average return over 10–20 years.

02. Unveiling Better Returns with Sharpe-Optimized Portfolio
This analysis showcases superior returns and an optimised risk-reward balance compared to the All Weather Portfolio, utilising the Sharpe Ratio optimisation approach based on the last 5 years of data.

03. Bitcoin Integration: Elevating Performance in Sharpe-Optimised Portfolio
By adding Bitcoin to a Sharpe-Optimised Portfolio, returns have been notably improved.

04.Bitcoin’s Indicator Role in the Crypto Landscape
Bitcoin’s dominance in the cryptocurrency market makes it a symbol for the entire sector of crypto, but an investor may want to mix in other cryptocurrencies for a better performance when risk tolerance is high.

05. The Ongoing Quest for Optimal Asset Allocation
Determining the most effective asset allocation for a portfolio remains a complex and evolving puzzle. Despite employing advanced techniques such as Sharpe optimization and exploring new avenues like Bitcoin, the pursuit of the perfect allocation persists as a multifaceted challenge.

The All Weather Portfolio and Its Evolution: Diversification, Allocation, and Crypto Integration

The All Weather Portfolio, developed by Ray Dalio’s Bridgewater Associates, is designed to perform well in any economic condition, including inflation, deflation, or stagflation. It emphasizes diversification and correlation, containing various asset classes to avoid putting all investments in one basket. The portfolio consists of 55% bonds, 30% US stocks, and 15% hard assets and commodities. The aim is to use diversification to smooth returns and lower drawdowns, making it a balanced option for investors. This structure allows the All Weather Portfolio to mitigate risk and provide stability for investors.

We start with designing the All Weather Portfolio with the help of with the following ETFs (the detailed analysis can be found here) :

Fig. 1 Classic composition of the ‘All Weather Portfolio’

It is important to mention that the original “All Weather Portfolio” doesn’t include crypto assets as a class. Crypto is a relatively new investment opportunity, and not all conservative investors consider putting money into it.

Given that the weights for the All Weather Portfolio have been previously determined, we proceed directly to test the portfolio performance within the specified timeline, ranging from ‘2022–07–15’ to ‘2023–07–15’.

For a comparative analysis, we are employing the classic Mean-Variance approach, utilizing Sharpe optimization. We use a timeline from ‘2018–01–01’ to ‘2022–07–15’ to determine the weights for the Shape-optimized portfolio and test the results on the same timeline (from ‘2022–07–15’ to ‘2023–07–15’). The grand idea is that we could potentially find ‘more optimal’ portfolios, when choosing a different time frame (e.g. last 5 years) and different risk appetite.

Furthermore, to augment and potentially bolster the strategy, we are incorporating cryptocurrencies into the portfolio. This innovative addition aims to explore new dimensions of investment possibilities, considering the dynamic nature of the cryptocurrency market.

Visualizing the All Weather Portfolio: Asset Allocation and Performance Statistics Over the Last Year

As previously stated the analysis begins by setting the start and end dates, specifically from ‘2022–07–15’ to ‘2023–07–15’. Next, we download the data from Yahoo Finance with the focus on the ‘Adj Close’ prices for the following assets:

  • Gold (GLD)
  • The iShares S&P GSCI Commodity-Indexed Trust (GSG)
  • The iShares 3–7 Year Treasury Bond ETF (IEI)
  • The iShares 20+ Year Treasury Bond ETF (TLT)
  • The Vanguard Total Stock Market ETF (VTI).

A pie chart of the portfolio’s composition is created using the rp.plot_pie function from Riskfolio-lib, providing a visual representation of the investment allocation among the different asset classes. This visualisation aids in understanding how the portfolio is balanced.

Fig. 2 Donut visualisation for the Classic “All Weather Portfolio”

Finally, we use vectorbt library to assess the portfolio’s performance. The year frequency is set to 252 business days (commonly used to represent trading days in a year), and the portfolio’s returns are analysed using the vbt.returns method. Various statistical measures can be obtained from this function, helping investors understand the risk and reward profile of the All Weather Portfolio.

Fig 3. Last year’s (mid-2022 — mid-2023) ‘All Weather Portfolio’ performance metrics

Sharpe optimisation

Before diving in Sharpe optimisation, we strongly recommend you to get yourself familiar with the Practical Portfolio Optimisation concepts that are covered in the following article here.

Now we continue with a classic Mean-Variance approach. To calculate the optimal portfolio, the code employs different methods to estimate expected returns and the covariance matrix based on historical data. Then, it proceeds to optimise the portfolio using the classic model and Mean-Variance (MV) approach. The objective function is set to maximise the Sharpe ratio, and the risk-free rate is defined as zero.

We calculate the new weights based on the historical data of our five assets (GLD, GSG, IEI, TLT, VTI) from ‘2018–01–01’ to ‘2022–07–15’:

Fig. 4 “All Weather Portfolio” with Sharpe-optimised weights (2018–2022 years)

Surprisingly, we have observed a significant shift in our new portfolio allocation. The largest portion of our portfolio is now dedicated to IEI (iShares 3–7 Year Treasury Bond ETF), comprising approximately 68.1% (compared to the previous 15%). VTI (Vanguard Total Stock Market ETF) has undergone a notable reduction to 15.4%, down from the previous 30%. Gold has experienced a value increase, now accounting for 11.5% of the portfolio (up from the original 7.5%). GSG (iShares S&P GSCI Commodity-Indexed Trust) has nearly maintained its previous allocation, standing at 5.0% (compared to the prior 7.5%).

The most intriguing aspect of these changes is the absence of TLT (iShares 20+ Year Treasury Bond ETF) from our adjusted portfolio. This decision can be attributed to a straightforward rationale: TLT has exhibited low returns and high volatility due to its longer duration, making it more sensitive to fluctuations in the Fed interest rates. This sensitivity was evident in the Fed rate decrease of 2019 and the subsequent increase in 2022.

Fig. 5 Return vs. Volatility trade-off between different asset classes (estimation on 2018–2022)

We can evaluate the performance of this new Sharpe-optimized portfolio over the time frame from July 15, 2022, to July 14, 2023:

Fig. 6 Last year’s (mid-2022 — mid-2023) Sharpe-optimised ‘All Weather Portfolio’ performance metrics

Efficient Frontier Construction

When we construct an efficient frontier (read more about it here), which represents the set of optimal portfolios that offer the highest expected return for a given level of risk — we can closely see the combination of assets with associated return and volatility. Moving along the frontier from left to right — gives us the best combination of assets according to the desired return while minimising the volatility.

The first graph illustrates the portfolio with the maximum risk-adjusted return. It highlights the specific point on the efficient frontier that offers the best return in relation to the assumed level of risk (this maximises the Sharpe ratio — symbolised by ⭐). The second graph serves the purpose of comprehending the composition of the efficient frontier itself. This graph showcases the manner in which asset weights shift as we traverse the frontier. This visualization offers insights into the adjustments of different risk levels achieved through varying asset allocations. Each ‘optimal’ point ranging from 1 to 50 on the first graph corresponds to a vertical ‘cross-section’ on the second graph, indicating the optimal asset allocation for that particular point.”

Fig. 7 Efficient frontier construction for various levels of risk (between 2.5% and 22% std. dev.) — 50 points for an optimal <return, risk> combinations
Fig. 8 Assets structure (vertical axis) for each point 1–50 (horizontal axis) of an Efficient Frontier

In the world of investments, the idea that higher exposure to stocks heightens risk is a well-established concept. Stocks, due to their inherent volatility, are susceptible to market shifts, economic changes, and company-specific problems. While stocks historically offer greater returns, their volatility can lead to significant losses during market declines. This can be seen in the Efficient Frontier’s Assets Structure, where an increased risk is associated with a higher fraction of VTI in our Portfolio.

Integrating Bitcoin into Portfolio Optimisation

Without a doubt, cryptocurrencies have emerged as a notable addition to the financial landscape, becoming an essential component in many people’s lives. As proof, we can observe a rise in the quantity of cryptocurrency exchange-traded funds (ETFs), particularly in the European market. Consequently, when considering the construction of an optimized portfolio, it is necessary to evaluate the potential inclusion of this new asset class. However, questions arise: Could the addition of cryptocurrencies enhance the overall performance of the portfolio? Or might their known volatility undermine the benefits typically gained through diversification?

To address these questions, our research focuses on a selection of eight leading cryptocurrencies, ranked by market capitalisation. This approach excludes both newly launched coins and stablecoins, concentrating on a more stable and proven segment of the cryptocurrency market.

The cryptocurrencies selected for our study include ‘ADA’, ‘BNB’, ‘BTC’, ‘DOGE’, ‘ETH’, ‘LTC’, ‘TRX’, and ‘XRP’. These choices reflect a range of market capitalisations and are representative of diverse approaches within the cryptocurrency space. In the accompanying graph, it becomes evident that ‘BTC’, ‘ETH’, and ‘XRP’ stand out as having substantially higher market capitalisations compared to the other selected cryptocurrencies.

This distinction in market capitalisation highlights the varying degrees of acceptance, investment, and utilisation across these cryptocurrencies. ‘BTC’, as the pioneering cryptocurrency, along with ‘ETH’ and ‘XRP’, have established themselves as dominant players in the market. This contrasts sharply with the remaining cryptocurrencies in our selection, which, while significant, have not reached the same level of market penetration.

Fig. 9 Volume of trade for 8 cryptocurrencies (last day of study — 2023–07–15)

Further correlation analysis between Bitcoin (‘BTC’) and other selected cryptocurrencies reveals a significant positive relationship, with correlation coefficients ranging from 0.56 with ‘XRP’ to 0.92 with ‘ETH’.

Fig. 10 Correlation between Bitcoin (BTC) and other 7 cryptocurrencies
Fig. 11 Log-Normalised price dynamics (0=100% in 2018, -1=exp(-1)=0.36 or 36% of 2018 price, +1=exp(1)=2.7 or 270% of 2018 price

This high correlation and relatively synchronised movement (normalised) indicate a shared response to market events and similar investor behavior across these cryptocurrencies. It may also reflect unique characteristics of each cryptocurrency, influencing the degree of correlation with Bitcoin (in this article we skip for now cointegration relations and casualty for simplicity).

The evidence detailed above supports the rationale for updating our Sharpe Portfolio to incorporate Bitcoin as a representative of the broader cryptocurrency sector. Recognising the correlations and behaviours associated with Bitcoin in relation to other cryptocurrencies, its inclusion serves as a strategic adjustment to capture the dynamics of this growing asset class.

So now in addition to our Sharpe MV optimisation assets (GLD, GSG, IEI, TLT, VTI) we include Bitcoin. And same as before — we calculate the new weights based on the historical data of our six assets (GLD, GSG, IEI, TLT, VTI, BTC) from ‘2018–01–01’ to ‘2022–07–15’:

Fig. 11 Sharpe-optimised ‘All Weather Portfolio’ with Bitcoin (BTC-USD)

In the updated Sharpe-optimised extended All Weather Portfolio, the allocation to Bitcoin doesn’t exceed 3%, while the other assets remain in similar allocation ranges as before. This modest inclusion of Bitcoin reflects a cautious approach, balancing the potential benefits of this cryptocurrency with the existing diversification strategy.

Let’s once again construct an efficient frontier composed of 50 ‘points’. Each point corresponds to a different portfolio along the risk spectrum, ranging from a smallest standard deviation of <5% (point 1) to the largest at +75% (point 50). Each point represents the optimal portfolio with the highest expected return for a given level of risk. As previously, the ⭐ marker designates the point on the efficient frontier with the highest Sharpe ratio. We extract the asset weights from this specific asset combination.

It’s important to note that both axes now have larger values. The maximum expected return has increased to 35%, in contrast to the classic All Weather Portfolio’s 11%, while the highest expected standard deviation is now 75%, previously 21%. It’s evident that the deviation grows more rapidly than expected returns. Consequently, the portfolio with the optimal Sharpe ratio (where we optimize the expected return/deviation ratio) is positioned towards the beginning, especially when the allocation to cryptocurrencies is relatively small. This precaution prevents an undue inflation of the risk metrics.

Fig.12 Efficient Frontier for ‘All Weather Portfolio’ with Bitcoin

Full assets’ allocation among the efficient frontier can be found on this graph below. As we can see a higher return associated with a higher volatility and as a result the bigger portion of BTC in our updated Sharpe Portfolio.

Fig. 13 ‘All Weather Portfolio’ with Bitcoin: assets structure (vertical axis) for each point 1–50 (horizontal axis) of an Efficient Frontier

In contrast to our earlier findings, the asset carrying the highest risk in this scenario is now a cryptocurrency (BTC-USD), shifting from stocks (VTI) as observed previously. This shift explains the notable allocation towards cryptocurrency when risk escalates (moving from 0 to point 50) on the graph. However, it’s important to note that this increased cryptocurrency exposure doesn’t necessarily lead to substantial returns, as indicated by the ‘optimal’ Sharpe-optimised point (⭐) which doesn’t feature a significant cryptocurrency weight.

Integrating other Cryptocurrencies into Portfolio Optimization

Lastly, we will incorporate all 8 cryptocurrencies into the portfolio optimisation to observe the impact on an All Weather Portfolio (i.e. we add 8 cryptocurrencies to the original 5 asset classes and find the star point “Max Risk Adjusted Return Portfolio” using Mean-Variance optimization).

To begin, we will create familiar graphs depicting the efficient frontier and asset allocation:

Fig. 14 Efficient Frontier for ‘All Weather Portfolio’ with 8 cryptocurrencies
Fig. 15 ‘All Weather Portfolio’ with 8 cryptocurrencies: assets allocation for all points of an Efficient Frontier

Both the expected risk and volatility experience a significant surge, potentially resulting in an anticipated return as high as 180%. However, this heightened return comes hand in hand with a substantial standard deviation of 220% in the extreme scenario (point 50).

Curiously, the ETF with stocks (VTI) is now perceived as a comparatively secure investment within points 1–15. Conversely, commodities (GSG) play a more extended role, persisting until point 25. The riskiest combinations from points 25 to 50 are exclusively comprised of cryptoassets such as DOGE-USD and BNB-USD.

It remains noteworthy that the optimally Sharpe-optimised portfolio remains situated quite close to the leftmost lower-variance points, where the crypto allocation is still limited. However, this allocation is larger than the previous case (“All Weather + BTC-USD”) where only 3% was allocated to Bitcoin. In this iteration, BNB-USD constitutes 5.9%, and DOGE-USD accounts for 1.6%, totalling 7.5% of the portfolio allocated on crypto.

Fig. 16 Sharpe-optimised weights for the ‘All Weather Portfolio’ with 8 cryptocurrencies

Overall Comparison

Now, let’s delve into the comprehensive performance analysis of the four portfolios we’ve constructed over the timeline spanning from July 15, 2022, to July 14, 2023: the All Weather Portfolio with static weights, the Sharpe-optimized portfolio, the updated Sharpe-optimized portfolio that includes Bitcoin, and the enhanced Sharpe-optimized portfolio that encompasses 8 cryptocurrencies.

As depicted in the graph below, it’s evident that all three Sharpe-optimized portfolios consistently outperform the All Weather Portfolio. The Sharpe-optimized portfolio with BTC (which holds a conservative crypto allocation of 3% of the total portfolio) demonstrates superior returns on any given day. On the other hand, the riskier Sharpe-optimized portfolio with 8 cryptocurrencies (comprising a more aggressive mix of multiple cryptos, accounting for 7.5% of the portfolio) led the portfolios for the majority of days in the past year, though it lost its dominant position in June.

Fig. 17 Price dynamics (returns in July-2022 prices) for 4 portfolios

The table below provides detailed information regarding the performance of all four portfolios:

Fig. 18 Performance statistics for 4 portfolios

As evident from the daily graph above, the clear frontrunner appears to be the ‘Sharpe-optimised All Weather portfolio with BTC.’ This assumption holds true: the portfolio boasts a superior annualised return of 4.24%, significantly surpassing the closest alternative at 3.43% among the other three options. Furthermore, it achieves the highest Sharpe and Sortino ratios.

However, while both Sharpe-optimised portfolios outshine the All Weather Portfolio in terms of performance, it’s important to recognise that this trend may not persist over a more extended timeline.

Sharpe-optimized portfolios are designed to automatically allocate weights that maximize the Sharpe ratio, favoring assets with either substantial excess returns or low volatility. Conversely, the All Weather Portfolio is strategically designed to ensure steady growth by meticulously selecting assets that excel across diverse economic cycles and inflation scenarios.

Hence, the underperformance of the All Weather Portfolio within this specific timeframe could be somewhat deceiving. A more comprehensive testing period becomes imperative to accurately evaluate the strengths and weaknesses of this strategy


This study has explored various investment strategies, focusing on the All Weather Portfolio, Sharpe-optimised portfolios, and a modified Sharpe-optimised portfolio including cryptocurrencies.

The All Weather Portfolio is tailored to perform consistently in diverse economic scenarios, resulting in conservative returns.

The Sharpe-optimised portfolios aimed to strike a balance between risk and reward, yielding higher returns, especially when Bitcoin was integrated. However, these strategies might be more susceptible to unforeseen market shifts.

The addition of Bitcoin proved an intriguing experiment, boosting returns without introducing excessive unpredictability, underscoring the potential of cryptocurrency inclusion in investment strategies.

In summary, the All Weather Portfolio remains a sound strategy in 2023, ideal for those seeking measured and stable growth. It offers a balanced option, shielding investors from potential economic disruptions. Alternatively, for those open to adaptability and keen on leveraging current market trends, Sharpe-optimized portfolios, with or without cryptocurrency, present an appealing alternative, showcasing superior performance over the analyzed period. The ultimate choice should align with an investor’s risk tolerance, goals, and economic perspective, as the optimal strategy hinges on these personalised factors.



Ivan Brigida

Data and Product Analyst at Google. I run a website on Python programming, analytics, and stock investing.