Main Content

Backtest Framework

Define investment strategies, run backtests, analyze strategy performance

Define a backtest strategy using a backtestStrategy object. backtestStrategy objects contain properties specific to a trading strategy, such as the rebalance frequency, transaction costs, management and performance fees, and a rebalance function. The rebalance function implements the core logic of the strategy and is used by backtestEngine during the backtest to allow the strategy to change its asset allocation and to make trades.

Objects

backtestStrategyCreate backtestStrategy object to define portfolio allocation strategy (Since R2020b)
backtestEngineCreate backtestEngine object to backtest strategies and analyze results (Since R2020b)

Functions

runBacktestRun backtest on one or more strategies (Since R2020b)
equityCurvePlot equity curves of strategies (Since R2021a)
summaryGenerate summary table of backtest results (Since R2020b)

Topics