Welcome to the first post! In this first instance I wanted to lay out some key concepts and analyse how reliable the most popular strategy among financial advisors was by investigating how it has done in the past and what results could come out by implementing it on the US markets. This strategy typically reflects the effect of a widespread bias among investors, called "Mental Accounting", whose main display consists in isolating parts of the portfolio. Who suffers from this bias typically fails to have a general view of a portfolio.
The strategy consists in using the percentage of your portfolio invested in bond when the stock market index you are invested in, has a drawdown for more than 30% from the latest All-Time high. Being a form of market timing, which has been largely proved not to be effective for a mere retail investor, we should be able to quickly prove why it doesn’t work. The problem is, there is no such index we can compare something like this, because in this strategy we are just willingly exposing ourselves to more risk for an unknown period of time to reduce how long it would take to re-establish the value our portfolio before the crash occurred.
Rebalancing the Splits
First, when we define our splits, from a 100% stock to a 40% Stocks and 60% Bond, we need to track the daily returns of the S&P by analyzing the percentage change from one day to another on the index price.
Instead, we can gather yield to maturity for treasury bonds, and turn every yearly return into daily one, by using (365√1+YTM)-1
If you were to calculate a portfolio with a selected starting sum, you would just compound 1+daily return and get the latest value, multiplying it with the sum you chose, will get the final value of the portfolio. Keeping in mind our split, we can then just multiply the sum, by the percentage of the split by the compounded return.
Now the hardest part: we need to rebalance the portfolio every year to match the change in value that occurs because obviously stocks and bond grow at different rates.
The process starts by defining the period it takes to rebalance the portfolio, in this case I chose to do it every year, but you could do it every quarter by changing the iteration in the cycle. Every first day of the period, we must start the calculation of compounding returns, because it’s as if we changed the starting sum every year, based on a percentage of the total reached value of the portfolio at that time.
We then place 0 as daily return on every day we do the rebalance, so the return is considered only one time, and the values follow the normal course of the index as if we tried to just passively invest the 100% of our portfolio on the S&P. With Matplotlib we can then plot every different split course into a graph and confront them to have a better visual representation of our investments.
The cycle here is used to automatically name and divide data into each column and improve efficiency of the script. The dictionary used contains stock percentage as keys and bond percentage as the values. The results are visually pleasing this way and we can have a brief idea of the differences between portfolio composition, which is substantially the risk exposure we decide to get.
Risk Exposure
What we can do with data is to see how many days we would be exposed to riskier assets such as S&P stocks rather than US debt. There’s no consensus on the right way to measure risk, so I’ll go over the most common of them.
Probably the most important one is volatility, defined as standard deviation of returns, which I decided to calculate over 1 year, as its common online, which is a one-line matter in python.
If we instead tried to use Sharpe Ratio, using the US Bonds to select Risk-Free Rate and S&P itself to find Excess returns, we get similar values for every split of Stocks/Bond that we choose.
Sharpe ratio is defined as the mean of excess return divided by its standard deviation. Here I chose to calculate it over the last 10 years as its more usual to do so.
Defined what metrics we use to outline the riskier factor in every different split configuration, we can run the code and look at the different outcome we get:
So, if we were to perform a strategy where we rotate our portfolio to a 100% stock composition, the only useful data that is worth analyzing is how many days we would get exposed to the excess risk.
The time in days is calculated between the first -30% of the S&P and the time the whole portfolio takes to return to the latest all time high before the crash. To do this, we need to make sure that the crash, comes first the next all-time high, before keeping it as our measure to find the number of days it takes to regain value.
This is where we can put it in practice one the Active Strategy. After defining every timestamp for our signal to convert our bond value into stocks, we just track the daily returns for the S&P until it returns to the latest all time high again.
As shown above, the results indicate that in the most stock comprehensive configuration, the difference in time is probably not enough to justify the excess risk we get exposed to. In fact, for an 80/20 split historically, the longest we would have saved by implementing strategy would have been 180 days, but we would have had to take on 4% of more volatility on our whole portfolio for about 4 years.
These results depend on the fact that we are trying to time the market. By arbitrarily selecting a drawdown amount, we cannot make sure that this will be near the bottom of the market and how or if stock index will eventually go up in a short period of time . This leads to an undefined period where, while the bond return keeps going up, the stocks might continue to go down. On top of that, just by observing few examples coming from the past there is no way to gather useful and meaningful info of what will happen in the future. This is because the price today is already reflecting every information available to the public, which include the past prices and what could look like a pattern in the so called “random walk”.
In conclusion, this strategy doesn't essentially work. The objective is to reduce the time that it takes for our portfolio to go back to the all-time high value but the unrealsonable market timing component makes it so that the excessive exposure to a riskier asset offsets the benefit of reducing this time.
here is the complete code: