## Loading stock data from local file C:/Users/Administrator/OneDrive/Documents/stockdata_from_2019-01-01_to_2025-03-01_(0f9cf120d38e5ba793ee9b2a12c3efc1).RData
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...
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"
## risk parity portfolio tangency portfolio 1/N
## Sharpe ratio 5.1496 5.7672 6.8184
## max drawdown 0.2098 0.2226 0.2057
## annual return 4.4252 5.3466 5.6629
## annual volatility 0.8593 0.9271 0.8305
## Sortino ratio 9.0476 11.3145 13.1506
## downside deviation 0.4891 0.4725 0.4306
## Sterling ratio 21.0951 24.0207 27.5300
## Omega ratio 2.2188 2.5070 2.7814
## VaR (0.95) 0.0788 0.0870 0.0741
## CVaR (0.95) 0.1016 0.0960 0.0812
## rebalancing period 1.0149 1.0149 1.0149
## turnover 0.3404 0.5099 0.0519
## ROT (bps) 512.1396 405.7863 4293.0770
## cpu time 0.0017 0.0013 0.0000
## failure rate 0.0000 0.0000 0.0000
Plot the returns for all the portfolios.
Plots the weigjt changes at each interval.