Today I will show how to apply the MC technique in a portfolio consisting of 10 ETFs using R and calculate Walk Forward statistics with monthly rebalance using a different set of evaluation metrics. So we have the following set of ETF:




Now we will move to calculate walk forward tests maximizing the following metrics:
PnL;
PnL × R², (R-squared is the coefficient of determination);
PnL × R² / MaxDD;
Sharpe Ratio,
rolling on different intervals: 6, 12, 24, 36 months rebalancing monthly.
Using C++ functionality in R allows you to speed up your calculations. Rolling calculations on 10k different portfolios with 4 different intervals take seconds.
So here we got our unbiased performance using walk forward optimization:


This result also implies that from the point of view of productivity, the Sharpe Ratio optimization and small In-Sample windows (6 and 12 months) construct portfolios that by far the least productive.
Walk Forward Portfolio Optimization and the Monte Carlo method for generating asset weights shows the most accurate and unbiased performance results that an investor can get using certain risk and return preferences.
It also says that the result of choosing best portfolio generated by Monte Carlo simulation (presented in ‘ETF Portfolio Universe Dynamic’ chart) is not achievable and will give unsuccessful portfolio performance evaluations.
All code in order to replicate results can be found here.