Portfolio Backtest
Compare portfolios over the same historical window. Inspect returns, drawdowns, cash flows, and the assumptions behind them.
On this page
First run
Compare a portfolio of 60% SPY and 40% AGG with a portfolio holding only SPY. This is the historical comparison shown on the homepage.
Open this exampleThe example runs without an account. Sign in to save it.
| Portfolio | Ending value | Annualized growth | Max drawdown |
|---|---|---|---|
| Classic 60/40 | $49,332 | 7.90% | 35.56% |
| S&P 500 only | $83,562 | 10.64% | 55.19% |
Annualized growth summarizes the full period. Maximum drawdown measures the largest decline from a prior peak. Read both measures alongside the full path and its assumptions. These are historical results, not forecasts.
- Open the example. Compare the portfolio value and drawdown charts with the figures above.
- Change one input. Adjust a weight or the date window. Supported allocation edits update the chart immediately.
- Run and compare. Run the current inputs for the full analysis, then compare growth and drawdown together.
Exact example setup
Both portfolios start with $10,000 over 2005-01-03–2025-12-31. Total return, nominal dollars, monthly rebalancing, no cash flows, and no tax-aware accounting.
How-to
Editing a portfolio
- Add or remove allocations at the portfolio level.
- Edit each allocation's weight and linked strategy.
- Open Edit for holdings and cash flows. Use Allocation rule for conditions and strategy-level rebalancing. Allocation rule also contains Add sleeve. Trades to reach leverage sizes the trades for a target leverage.
- Load a Library strategy or Library portfolio when you need to reuse an existing building block.
See Strategy Leaderboard and Signals for the reusable rule and indicator model used inside the editor.
Cash flows
- Open the portfolio you want to change and choose Add cash flow.
- Choose Periodic for recurring cash flows or One-time for a dated event.
- Enter the amount and timing. For a monthly dollar contribution, choose $ Dollar and Monthly.
- Run the backtest again. Inspect the cash flow events alongside the value chart.
- Recurring cash flows: scheduled contributions or withdrawals.
- One-time cash flows: dated events applied once inside the backtest window.
- Sign convention: positive values contribute capital and negative values withdraw capital.
The Cash flows result section shows each contribution and withdrawal with its date and amount, plus a running total chart.
Compare two portfolios
- Open Portfolio Backtest.
- Add and configure the portfolios you want to compare.
- In the relative-analysis result, use Compare and With to choose one portfolio on each side.
- Run the backtest. The comparison view shows the selected portfolio's growth relative to the other portfolio.
- Change either selection to compare a different pair. This selection does not assign a permanent benchmark.
Saved analyses and share links
Sign in to save an analysis. If you edit inputs after a run, the result still belongs to the last completed scenario. Run again before comparing or saving the changes. Older saved output is withheld until a refresh or rerun produces a current result. Use a share link to send the setup to someone else.
Reference
Configuration guide
Treat these fields as modeling assumptions. Change one at a time when you want to understand what drives a result.
| Configuration | What it means | Why it matters |
|---|---|---|
| Portfolio allocations | The target asset mix or strategy definition that the backtest replays. | This is the portfolio hypothesis. Changing weights changes both expected return exposure and drawdown behavior. |
| Date range | The historical window used for prices, returns, and events. | A short window can make a strategy look better or worse because it samples only one market regime. |
| Price Mode | Total return includes dividends and distributions. Raw prices keep them separate for dividend accounting. | Use Total return for return comparisons. Use Raw only when you need explicit dividend tracking. |
| Initial value and cash flows | Starting capital plus any recurring or one-time additions and withdrawals. | Cash flows make results path-dependent because deposits and withdrawals happen at specific market levels. |
| Rebalancing | The rule that decides when the backtest trades holdings back toward target weights. | More frequent rebalancing can reduce drift, but it can increase turnover, taxes, and implementation cost. |
| Benchmark | The reference series used for comparison metrics. | Benchmark choice changes relative metrics such as alpha, beta, tracking error, and up/down capture. |
| Tax-aware mode | Adds account type, filing status, income, state, lot selection, and loss assumptions. | After-tax results are not comparable to pre-tax results unless the tax profile is explicit. |
Main inputs
- Starting principal: initial portfolio value.
- Date range: historical sample used in the run.
- Price mode: total-return or raw-price return construction.
- Allocations and strategies: the holdings and rules under test.
- Portfolio rebalancing: how the engine maintains the top-level allocation split.
- Cash flows: recurring or one-time contributions and withdrawals.
- Saved in-sample / out-of-sample holdout: older saved analyses can retain a split date and show separate metrics for each period. The Backtest settings disclose the active split and let you return to full history.
Rebalancing
Portfolio Backtest has two separate rebalance layers:
- Strategy-level rebalancing: restores weights within the active positions of a strategy.
- Portfolio-level rebalancing: restores the top-level split between allocations.
Both layers can use time-based or threshold-based policies. See the Rebalancing guide for the detailed mode descriptions.
Glidepath portfolios
A glidepath portfolio changes its target allocation over time. This models the common practice of shifting from growth-oriented to income-oriented holdings as the investment horizon shortens (for example, a target-date retirement fund).
- Static vs glidepath: open Allocation rule and enable Glidepath when a portfolio has two or more allocations.
- Milestones: each milestone specifies a date and the target weight for every allocation. The engine uses stepwise resolution: the most recent milestone on or before the current date determines the target weights.
- Dates must be strictly increasing. The milestone weights for each date must sum to 100%.
- Initial allocation rule: before the first milestone, the backtest uses the initial sleeve weights. A milestone on or before the start date overrides those weights.
Example: a portfolio with two allocations (SPY, AGG) and two milestones shifts from 80/20 on 2010-01-01 to 40/60 on 2020-01-01. In a 2005-2025 backtest the initial weights would be 80/20 (first milestone applies from 2010), then 40/60 from 2020 onward.
Saved in-sample / out-of-sample holdout
An older saved Portfolio Backtest can include an in-sample / out-of-sample split. When active, the settings show its end date. Results show separate metric tables for the in-sample and later out-of-sample windows for each portfolio. Choose Use full history to clear the split. New backtests use the full selected date range.
- The split uses the realized backtest path. It does not change trades, cash flows, tax-lot events, or rebalancing decisions.
- The requested date snaps to the nearest prior trading day. Both sides need enough history. Otherwise, the result shows a warning instead of partial metrics.
- Metric tables use the same metric catalog as the full-period result. The slice does not replay tax-aware and dividend-income metrics, and the result shows them as unavailable with a warning.
Tax diagnostics
When you enable tax-aware mode, the After tax result section includes tax diagnostics. It summarizes total drag, current-year tax drivers, estimated embedded liquidation drag, high-impact trades, concentrated unrealized gains, and assumptions or confidence flags.
Use it to find the main tax drivers before inspecting trade or lot details.
Dividend income
The Income result section shows annual dividend income as a bar chart. It also shows per-portfolio summary metrics: total income, qualified vs ordinary breakdown, and payout count. A sortable table lists individual dividend events (ex-date, ticker, shares, per-share amount, income, qualified/ordinary type).
Dividend tracking requires the raw price mode. Total return (adjusted prices) already bakes dividends into the price series, so using it with dividend tracking would double-count income.
The annual breakdown classifies each dividend as qualified or ordinary. Qualified dividends fall under the preferential long-term capital gains rates, while ordinary dividends fall under regular income rates.
Matched spending
Both portfolios reinvest distributions, then sell holdings to fund the same dated spending target. The selected portfolio's original recorded distributions fix the target. This is not a cash-dividend election. Common fixed-dollar cash flows stay in place.
The comparison requires matching dates, complete distribution histories, and fully funded withdrawals. Taxes use the same profile and existing lot rules. Remaining wealth reflects tax already paid, and estimated tax if sold appears separately. Historical distributions are not a forecast.
Rolling metrics
The Rolling returns result section shows windowed calculations for CAGR, volatility, Sharpe, Sortino, and other risk metrics over time. This reveals whether full-period averages mask regime changes. A portfolio with a stable 10% CAGR may have experienced stretches of 20% gains and 5% losses.
The window length is configurable. Shorter windows capture more variation but have more noise. Longer windows smooth the series but can obscure transitions.
Risk vs return
The Risk and return result section plots a scatter chart of annualized return against annualized volatility for each portfolio. Point annotations show Sharpe ratio and max drawdown for comparing risk-adjusted performance across portfolios.
Seasonality
The Seasonality result section shows average monthly return by calendar month. This can help identify seasonal patterns in portfolio returns. Sample sizes per month are small, so patterns may not be statistically significant over shorter backtest windows.
Correlations
The Correlation of daily returns result section displays a pairwise daily return correlation heatmap. It requires two or more portfolios and uses daily returns over the backtest window.
Relative analysis
The Portfolio comparison result section shows the selected portfolio's value divided by the other selected portfolio's value over time. Choose the pair using Compare and With within that section. Relative metrics include tracking error, information ratio, and up/down capture ratios. This requires two or more portfolios.
Historical withdrawal rates
Open Historical withdrawal rates in the Portfolio result group, choose a horizon, and select Run. The table reports the lowest and median historical safe withdrawal rate (SWR) and the worst cohort start date. The chart compares SWR with the perpetual withdrawal rate (PWR) for each complete monthly-start cohort. A shorter history produces no shortened cohorts.
Each cohort withdraws a fixed real amount at month-end after growth. SWR avoids depletion through the horizon. PWR also preserves the starting purchasing power. PWR is unavailable when even zero spending cannot preserve it. Historical CPI applies independently of the primary chart's dollar basis.
The analysis is pre-tax, excludes your cash flows and withdrawal rules, and slices the realized strategy path without restarting its signals or allocation schedule. Overlapping cohorts are not independent, and historical rates are not forecasts.
Lump sum vs DCA
The Lump sum vs DCA result section runs a separate dollar-cost averaging simulation using the same portfolio configuration. You can configure the DCA frequency (weekly or monthly), deployment duration, and cash yield during the deployment phase.
This compares immediate investment with phased entry over the selected historical window. The result depends on that window.
Allocations
The Allocations section shows a pie-chart grid of target weights for each portfolio. It uses the strategy positions and allocation weights you configured.
Tax-aware engine
Tax-aware engine runs the same portfolio settings through a lot-level tax engine. The tax profile controls filing status, income, state, account type, lot selection, and optional loss-harvesting settings.
See Tax-Aware Backtesting for the accounting assumptions and output interpretation.
Ticker modifiers
Positions can use ticker modifiers when the backtest should use a transformed series instead of the base ticker.
Regression analysis
The Pairwise regression result section runs an OLS regression of one selected portfolio's returns against another selected portfolio's returns. The diagnostics show how closely their returns move together.
- Alpha: the intercept of the OLS regression, representing return generated beyond what beta exposure explains. Reported as both a per-period value and an annualized value.
- Beta: the slope coefficient that measures sensitivity to the selected comparison portfolio. A beta of 1.0 means the portfolio moves one-for-one on average. Higher values indicate greater sensitivity.
- R-squared: the fraction of portfolio return variance explained by the selected comparison portfolio.
- Correlation: the Pearson correlation coefficient between the selected portfolios' returns.
- Tracking error: the annualized standard deviation of the return difference between the selected portfolios. Lower values mean their returns are closer together.
- Information ratio: the annualized excess return divided by the tracking error. A higher value indicates better risk-adjusted outperformance.
Select daily or monthly frequency to change the regression interval. Monthly aggregation compounds daily returns geometrically. The scatter plot shows the fitted line. The residual chart shows deviations.
Glossary
Glossary
- CAGR
- Compound annual growth rate. The constant yearly return that would produce the same ending value as the actual path.
- Volatility
- Annualized standard deviation of periodic returns. A measure of how much returns swing around their average.
- Drawdown
- A peak-to-trough percentage decline. Max drawdown is the worst observed.
- Sharpe ratio
- Excess return divided by total volatility. Reward per unit of swing. Does not distinguish upside from downside.
- Sortino ratio
- Like Sharpe, but the denominator is downside volatility only. Penalizes losses but not gains.
- Tracking error
- Annualized standard deviation of the return difference between the portfolio and its benchmark.
- In-sample vs out-of-sample
- In-sample is the period that you used to tune a strategy. Out-of-sample is later, unseen data. Strong in-sample-only results often do not generalize.
- Glidepath
- A schedule changes target weights over time. For example, it can shift from stocks to bonds as a target date approaches.
Explanation
When to use it
Use Portfolio Optimizer to search portfolio weights. Use Monte Carlo for outcome distributions and failure rates across simulated paths. See Historical Backtest vs Monte Carlo for a comparison.
Portfolio model
| Level | What it stores | Where it rebalances |
|---|---|---|
| Portfolio | One or more allocations, portfolio-level cash flows, and portfolio-level rebalancing settings. | Between allocations when portfolio rebalancing is on. |
| Allocation | One strategy and its target portfolio weight. | Inside the strategy when the strategy itself holds multiple positions. |
| Strategy | Conditions, positions, signals, and strategy-level rebalance rules. | Within the active condition. |
Historical backtest vs Monte Carlo
| Dimension | Portfolio Backtest | Monte Carlo |
|---|---|---|
| Input | One historical return path | Many simulated return paths |
| Output | Single time series, metrics, and charts | Distributional outcomes, percentile bands, and success rates |
| Best for | Exact historical behavior of a specific configuration | Range of possible outcomes and failure-rate analysis |
| Limitation | One path is one sample. Different date ranges can give different conclusions. | Simulated paths depend on the return model and its assumptions. |
Use Portfolio Backtest when you need detailed historical attribution, tax-aware accounting, or strategy-level diagnostics. Use Monte Carlo when you need to evaluate withdrawal sustainability, outcome distributions, or tail risk across many scenarios.
Common pitfalls
- Picking too short a date range
A short sample can miss the conditions you want to inspect. Include relevant drawdown periods when comparing historical behavior.
- Mixing Raw prices with dividend tracking off
Raw keeps dividends and distributions separate, so returns read low. Choose Total return unless you specifically want to inspect dividends.
- Comparing a pre-tax run to an after-tax run
Tax-aware mode adds drag and lot-level events. Either run both portfolios with tax-aware on, or both with it off.
- Treating one path as predictive
A single historical replay is one sample. For probability ranges, run the same plan in Monte Carlo.