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
backtestEngineCreate backtestEngine object to backtest strategies and analyze results

Functions

runBacktestRun backtest on one or more strategies
equityCurvePlot equity curves of strategies
summaryGenerate summary table of backtest results

Topics