Download Stock Data

## Loading stock data from local file /cloud/project/stockdata_from_2019-01-01_to_2023-05-31_(0f9cf120d38e5ba793ee9b2a12c3efc1).RData

Optimization

In this section we assign our riskParity & max_sharpe_ratio portfolio functions. The functions will get passed into out optimization to find the weights at each period.

## Backtesting 2 portfolios over 1 datasets (periodicity = monthly data)...
## Backtesting benchmarks...

Table of Stats

Get rebalanced dates along with the table of stats for each portfolio.

## 
## Rebalanced:
##  [1] "Jun 2019" "Jul 2019" "Aug 2019" "Sep 2019" "Oct 2019" "Nov 2019"
##  [7] "Dec 2019" "Jan 2020" "Feb 2020" "Mar 2020" "Apr 2020" "May 2020"
## [13] "Jun 2020" "Jul 2020" "Aug 2020" "Sep 2020" "Oct 2020" "Nov 2020"
## [19] "Dec 2020" "Jan 2021" "Feb 2021" "Mar 2021" "Apr 2021" "May 2021"
## [25] "Jun 2021" "Jul 2021" "Aug 2021" "Sep 2021" "Oct 2021" "Nov 2021"
## [31] "Dec 2021" "Jan 2022" "Feb 2022" "Mar 2022" "Apr 2022" "May 2022"
## [37] "Jun 2022" "Jul 2022" "Aug 2022" "Sep 2022" "Oct 2022" "Nov 2022"
## [43] "Dec 2022" "Jan 2023" "Feb 2023" "Mar 2023"
##                    risk parity portfolio tangency portfolio       1/N
## Sharpe ratio                      5.1805             4.9795    5.8403
## max drawdown                      0.2098             0.2226    0.2057
## annual return                     5.0913             5.1154    5.4966
## annual volatility                 0.9828             1.0273    0.9411
## Sortino ratio                     8.9534             9.2195   10.9557
## downside deviation                0.5686             0.5548    0.5017
## Sterling ratio                   24.2708            22.9820   26.7218
## Omega ratio                       2.1958             2.1866    2.3825
## VaR (0.95)                        0.0846             0.0918    0.0782
## CVaR (0.95)                       0.1087             0.0984    0.0827
## rebalancing period                1.0217             1.0217    1.0217
## turnover                          0.2899             0.5199    0.0530
## ROT (bps)                       688.6823           376.1237 4072.5261
## cpu time                          0.0050             0.0258    0.0039
## failure rate                      0.0000             0.0000    0.0000

Returns + Drawdown Charts

Plot the returns for all the portfolios.

Weight Alloc through time

Plots the weigjt changes at each interval.