It is my second version of the algorithm.
Purpose:
(1) Reduce the risk, which I could afford. Here the risk for myself is called “myDD”,
and I want it to be no more than 15%.
(2) Maximum Drawdown shall be no more than 20%.
(3) Annual return shall be no less than 3% on average.
Risk measure:
“myDD” is variation from maximum drawdown from my own experience.
The main motivation is that,
(1) I will be fine if I had 50% maximum drawdown after 100% return
(2) But I will be scared if I had 20% maximum drawdown after 10% return.
The formula is given as follows: My current DD is the current loss relative to inflation,
given by
myCurDD(t) = 1 - X_t * exp(- rt)/X_0
and myDD is given by
myDD(t) = max{ myCurDD(s): s <= t }
where X_t is the portfolio value at time t, and r is fixed number to mimics inflation rate.
Strategy:
(1) At t = 0, the account is divided to
Stock (at portion slev = 30%)
Cash (at portion clev = 20%)
Bond (at portion blev = 50%)
(2) Every week we rebalance with
Stock (at portion slev) + Cash (at portion clev) + Bond (at portion blev)
with updated portions by the formula below:
slev(t) = min{max{slev(0) - myCurDD(t), SlevMin}, SlevMax}
clev(t) = min{1 - slev, clev(0)}
blev(t) = 1 - slev - clev
The main idea is to increase the portion to stock as I gains more profit, vice versa.
Conclusion.
In the code, I used SPY throughout the period March 2007 - March 2017.
Total Returns: 60.8%
Benchmark Returns: 107.5%
Alpha: 0.02
Beta: 0.27
Sharpe: 0.77
Sortino: 1.09
Volatility: 0.07
Max Drawdown: -17.9%
MyDD: 15.6% (defined earlier)
Obviously the choice of the stock may be optimized by various factors.
As expected, the return is underperformed by SPY, but satisfactory to my own.
At least, I am not holding 80% cash doing nothing as of the earlier version.
Any comment is appreciated.