Comunicazione di marketingEducational content. No personalized investment advice before the OCF registration is published.
Comunicazione di marketingEducational content. No personalized investment advice before the OCF registration is published.

ETF Portfolio Simulator: Methodological and Mathematical Guide

✍️ Editorial Team12 min read

ETF Portfolio Simulator: Methodological and Mathematical Guide

This guide provides a comprehensive review of the results generated by AlphaFrame’s Quantitative Portfolio Simulator after updating the code and contribution inputs. Unlike the previous version, the simulator now clearly separates metrics computed on the portfolio index (performance without cash flows) from those computed on the investor’s wealth (which includes periodic deposits). We use an initial capital of 10,000 USD, a 20-year horizon and, for PAC scenarios, a monthly deposit of 1,000 USD. PIC scenarios have no monthly deposits. To try the simulator, visit the Tools page (English) and watch the YouTube tutorial showing how to configure scenarios and interpret the outputs.

1. Methodology and formulas

Historical backtest

EoM alignment – ETF prices are aligned to the last day of each month (End-of-Month) to ensure comparability across time series.

Logarithmic returns – Each ETF’s monthly log-return is:

rt  =  ln ⁣(ptpt1)r_t \;=\; \ln\!\left(\frac{p_t}{p_{t-1}}\right)

The portfolio’s log-return is the weighted average of the ETFs’ log-returns (implicit monthly rebalancing).

Portfolio index – Starting from 1, the index evolves as:

It  =  It1exp ⁣(rt(p)),I0=1I_t \;=\; I_{t-1}\,\exp\!\big(r^{(p)}_t\big), \quad I_0 = 1

representing performance without cash flows.

Wealth with contributions – The investor’s wealth series evolves as:

Wt  =  (Wt1+D)exp ⁣(rt(p)),W0=initial capitalW_t \;=\; \big(W_{t-1} + D\big)\,\exp\!\big(r^{(p)}_t\big), \quad W_0 = \text{initial capital}

where DD is the monthly deposit (0 for PIC, 1,000 USD for PAC). After 20 years, total invested capital is 10,000+20×12×1,000=250,000 USD10{,}000 + 20\times 12\times 1{,}000 = 250{,}000\ \text{USD} for PAC and 10,000 USD for PIC.

Index (portfolio) metrics

  • CAGR of the portfolio.
  • Sharpe and Sortino ratios (risk-adjusted returns):
    Sharpeann  =  μmσm12,Sortinoann  =  μmσm,down12\text{Sharpe}_\text{ann} \;=\; \frac{\mu_m}{\sigma_m}\,\sqrt{12}, \qquad \text{Sortino}_\text{ann} \;=\; \frac{\mu_m}{\sigma_{m,\text{down}}}\,\sqrt{12}
  • Maximum Drawdown (MDD), Ulcer Index and time under water (average and maximum months below the previous high).

Investor (wealth) metrics

  • Invested capital (initial plus deposits).
  • Final capital (wealth at the end of the backtest).
  • MDD, Ulcer Index and underwater durations on WtW_t (periodic deposits reduce the depth and length of drawdowns).

Monte Carlo simulation

To capture future uncertainty, monthly returns are drawn from a multivariate normal distribution parameterised by means, standard deviations and the correlation matrix of historical log-returns. Each simulation spans 240 months (20 years); we compute:

  • Index: median, 5th and 95th percentiles of the final index; CAGR, Sharpe, Sortino, MDD and Ulcer Index on the median path.
  • Investor: invested capital (10,000 USD + 20×12×1,000 USD = 250,000 USD for PAC, 10,000 USD for PIC), median final wealth, CAGR, MDD on the median path and 5th/95th percentiles of final wealth.

Interpreting the metrics

CAGR – geometric average growth, implicitly penalising volatility; in MC we also measure CAGR on median wealth relative to total contributions.

Sharpe – return per unit of total risk; values >1 are excellent, ~0.5 moderate, <0.2 weak.

Sortino – focuses on downside deviation; a Sortino > Sharpe suggests upside-skewed volatility.

MDD – deepest cumulative loss from a peak; warns about the severity of interim declines.

Ulcer Index – square root of the mean of squared percentage drawdowns; sensitive to duration of stress.

Time under water – average and maximum consecutive months below the previous high.

Risk-adjusted return – we use CAGR/MDD\text{CAGR} / \text{MDD} (akin to Calmar) to compare portfolios.

2. Scenarios and weights

We analyse six allocation and contribution combinations:

ScenarioSelected ETF(s)Monthly depositType
Tech PACOnly Global Tech1,000 USDsector-concentrated with deposits
Tech PICOnly Global Tech0 USDlump-sum technology
Utilities PACOnly Global Utilities1,000 USDdefensive with deposits
Utilities PICOnly Global Utilities0 USDdefensive lump-sum
Equal PACTen equally weighted ETFs1,000 USDdiversified with deposits
Equal PICSame ten equally weighted ETFs0 USDdiversified lump-sum

3. Backtest results

3.1 Portfolio (index without flows)

ScenarioCAGRSharpeSortinoMDDUlcer IdxAvg TUWMax TUWCAGR/MDD
Tech PAC13.93 %0.6720.62352.53 %13.82 %5.1520.29
Tech PIC13.93 %0.6720.62352.53 %13.82 %5.1520.46
Utilities PAC5.19 %0.3440.30243.85 %16.21 %10.81020.12
Utilities PIC5.19 %0.3440.30243.85 %16.21 %10.81020.16
Equal PAC6.80 %0.4180.37551.73 %13.27 %5.7650.18
Equal PIC6.80 %0.4180.37551.73 %13.27 %5.7650.13

3.2 Investor (wealth with contributions)

ScenarioInvested capitalFinal capitalMDD (wealth)Ulcer IdxAvg TUWMax TUWCAGR/MDD
Tech PAC233,000 USD1,539,124 USD33.55 %7.69 %2.74180.20
Tech PIC10,000 USD112,898 USD52.53 %13.82 %5.1520.46
Utilities PAC233,000 USD495,284 USD20.29 %4.36 %3.06120.09
Utilities PIC10,000 USD25,602 USD43.85 %16.21 %10.81020.16
Equal PAC233,000 USD578,743 USD25.87 %5.22 %2.81150.16
Equal PIC10,000 USD36,364 USD51.73 %13.27 %5.7650.13

4. Monte Carlo simulation results

4.1 Portfolio (index without flows)

ScenarioMedian final indexCAGRSharpeSortinoMDDUlcer Idx5th perc.95th perc.CAGR/MDD
Tech PAC12.0113.23 %0.640.6745.33 %16.60 %2.4849.830.29
Tech PIC14.5814.34 %0.730.8631.31 %10.18 %2.7052.850.46
Utilities PAC2.725.13 %0.340.3341.13 %18.22 %0.998.880.12
Utilities PIC2.795.27 %0.330.3432.86 %11.75 %1.118.720.16
Equal PAC4.297.56 %0.460.5041.93 %15.82 %1.3411.670.18
Equal PIC3.646.67 %0.430.4350.17 %17.82 %1.1510.620.13

4.2 Investor (wealth with contributions)

ScenarioInvested capitalMedian final wealthCAGRMDD (wealth)5th perc.95th perc.CAGR/MDD
Tech PAC250,000 USD1,255,019 USD8.40 %42.11 %462,437 USD3,696,600 USD0.20
Tech PIC10,000 USD145,824 USD14.34 %31.31 %26,983 USD528,456 USD0.46
Utilities PAC250,000 USD449,264 USD2.97 %31.58 %226,127 USD1,001,630 USD0.09
Utilities PIC10,000 USD27,938 USD5.27 %32.86 %11,061 USD87,241 USD0.16
Equal PAC250,000 USD574,446 USD4.25 %26.28 %275,875 USD1,377,700 USD0.16
Equal PIC10,000 USD36,364 USD6.67 %50.17 %11,453 USD106,204 USD0.13

5. Comparative insights

  • Concentrated vs defensive – 100 % Tech maximises returns but increases drawdowns and outcome dispersion; Utilities lowers volatility but with modest CAGR; Equal-weight is a middle ground.
  • PIC vs PAC – Monthly deposits reduce drawdowns and underwater durations, yet dilute wealth CAGR; PIC harnesses compounding more but requires patience through longer drawdowns.

6. Conclusions

By separating index and wealth metrics, the AlphaFrame simulator clarifies the risk/return trade-off. Monte Carlo results emphasise the breadth of plausible outcomes (5th–95th percentiles). Allocation and contribution choices should align with objectives, risk tolerance and the ability to withstand extended drawdowns.

Source

Try it now: open the Tools page and watch the tutorial video to see how to set up PIC/PAC scenarios and read the outputs step by step.