Backtest Results
Each simulation produces summary metrics, charts, a message log and the full data of the run. The Portfolio and Algo Trading tools show the same results, and both let you download them as JSON.
Summary:
- Initial / Final: the portfolio value at the start and at the end, and the profit (realized plus unrealized).
- Min / Max: the lowest and highest portfolio value during the run.
- Var / Annual Var: the total and annualized return. Deposits are not counted as return.
- Volatility: the annualized standard deviation of the daily returns.
- Max Drawdown: the largest drop from a previous peak.
- Sharpe: the return above the Risk Free Rate setting, divided by the volatility.
- Alpha / Beta: the excess return and the volatility relative to the Market Benchmark setting (^SPX by default).
- #Trades: the number of filled orders, including the orders that close all positions after the last date.
Change the Risk Free Rate and the Market Benchmark in Settings.
Tabs:
- Messages: the log of the run, such as orders, deposits, rebalancing and the messages printed by the algorithm.
- Warnings: data issues (e.g., a ticker without data for part of the range, or in another currency) and errors that stop the simulation.
- Performance: the portfolio balance and profit over time.
- Drawdown: the drop from the previous peak over time.
- Positions: the value of each position over time.
- Quantities: the quantity of each asset held over time.
- Prices: the price of each asset over time.
- Time Series: a table of the daily position of each asset, which you can download as JSON.
When you compare portfolios, a comparison view shows the main metrics side by side with a combined performance chart. Click View Results to see the full results of one portfolio.
Result data (AlgoResult):
This is the object passed to the end event in Algo Trading and saved by the download buttons:
- inputs: AlgoInputs - The inputs of the run.
- code: string - The algorithm source code.
- summary: AlgoResultSummary - The summary metrics:
- initCash, finalCash, profit: number
- low, high: number (lowest and highest portfolio value)
- totalVar, annualVar: number (returns as decimals)
- annualStdDev: number (volatility as a decimal)
- maxDrawdown: number (negative decimal)
- sharpe: number
- alpha, beta: Promise<number> (resolved after the run, undefined without a benchmark)
- nTrades: number
- performance: AlgoResultPerformance[] - One item per date:
- date: Date
- value: number (portfolio value)
- prevVariation: number (return since the previous date as a decimal, deposits excluded)
- drawdown: number (drop from the previous peak as a negative decimal)
- portfolio: AssetPortfolio - The final state of the portfolio, with cash and positions.
- portfolioHist: AssetPortfolio[] - The state of the portfolio on each date.
- assetHist: Record<string, AssetPortfolioItem & { date }[]> - The daily position of each asset (quantity, avgPrice, value, currency), keyed by ticker.
- tradeHist: Record<string, AssetTrade[]> - The orders of each date, keyed by date.