Backtesting guide
How to backtest a portfolio without hiding portfolio risk
To backtest a portfolio, simulate all holdings on one timeline with shared cash, allocation, rebalancing, income, and transaction-cost rules. Running separate single-symbol tests and averaging the results is not a portfolio backtest.
Read the practical guideKey Takeaways
- Portfolio cash, overlapping positions, allocation limits, and rebalancing must be modeled together.
- Dividend portfolio backtests need an explicit income and reinvestment policy rather than an unexplained adjusted-price series.
- Judge the combined equity curve, drawdown, turnover, concentration, and benchmark difference.
- Pineify Finance Agent supports portfolio research, not portfolio backtest execution.
Define the portfolio accounting model first
A portfolio backtest needs a starting value, eligible assets, target weights, cash treatment, maximum concurrent positions, rebalancing schedule, and fee model. It must decide what happens when several signals compete for limited cash. Separate symbol reports cannot reproduce those portfolio-level constraints or show how correlated losses arrive at the same time.
- Use one calendar and one cash ledger for every holding.
- Specify allocation, concentration, and rebalance rules.
- Track combined turnover, fees, drawdown, and recovery.
Handle dividends and corporate actions explicitly
A dividend portfolio backtest must state whether it uses price return or total return, how cash distributions enter the account, and when reinvestment occurs. Splits, mergers, delistings, and membership changes also affect historical results. The goal is not to pick one universally correct dataset, but to make the dataset and accounting treatment visible and consistent with the strategy claim.
Compare the portfolio with a relevant benchmark
Review the portfolio-level equity curve, maximum drawdown, volatility, turnover, concentration, and time under water. Compare the same period and cash-flow assumptions with a benchmark that reflects the investable opportunity. Diversification can reduce some concentration risk, but Investor.gov notes that it cannot guarantee protection during a market decline.
Related Pineify workflow
Research the holdings after defining the portfolio test
AI Finance Agent can help investigate the companies, ETFs, financials, and investment questions behind a proposed portfolio. Use a dedicated portfolio backtesting engine for the historical simulation.
Research holdings and portfolio questions without presenting the research as a completed backtest.
Research portfolio holdingsBoundary: AI Finance Agent does not maintain a portfolio cash ledger, model rebalancing, or calculate a historical portfolio equity curve.
Primary sources
- Investor.gov: Diversify Your InvestmentsVerified 2026-08-07
- TradingView Pine Script documentation: StrategiesVerified 2026-08-07
This page is educational and does not provide investment advice. Backtests are hypothetical, depend on their data and assumptions, and do not guarantee future results. Trading can result in substantial loss.