Download Stock Data

## Loading stock data from local file /cloud/project/stockdata_from_2019-01-01_to_2025-04-01_(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" "Apr 2023" "May 2023"
## [49] "Jun 2023" "Jul 2023" "Aug 2023" "Sep 2023" "Oct 2023" "Nov 2023"
## [55] "Dec 2023" "Jan 2024" "Feb 2024" "Mar 2024" "Apr 2024" "May 2024"
## [61] "Jun 2024" "Jul 2024" "Aug 2024" "Sep 2024" "Oct 2024" "Nov 2024"
## [67] "Dec 2024" "Jan 2025"
##                    risk parity portfolio tangency portfolio       1/N
## Sharpe ratio                      4.6400             5.1281    6.4123
## max drawdown                      0.2098             0.2226    0.2057
## annual return                     4.0561             4.8797    5.3731
## annual volatility                 0.8742             0.9516    0.8379
## Sortino ratio                     7.9451             9.5569   12.1924
## downside deviation                0.5105             0.5106    0.4407
## Sterling ratio                   19.3359            21.9229   26.1213
## Omega ratio                       2.0451             2.2563    2.6094
## VaR (0.95)                        0.0815             0.0913    0.0736
## CVaR (0.95)                       0.1020             0.1000    0.0812
## rebalancing period                1.0147             1.0147    1.0147
## turnover                          0.3367             0.5033    0.0524
## ROT (bps)                       474.9962           374.9186 4036.0392
## cpu time                          0.0033             0.0249    0.0011
## 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.