Backtesting Strategy Framework in Financial Toolbox
Learn how backtesting can help you compare how investment strategies perform over historical or simulated market data. You’ll see an overview of the backtesting feature in Financial Toolbox™ and a walk-through of the workflow to develop and run a backtest.
A backtesting strategy framework, first introduced in R2020b of Financial Toolbox, lets you define investment strategies, run backtests and generate performance metrics for your strategies from historical or simulated market data. The backesting framework, consists of MATLAB objects such as backteststrategy and backtestengine that simplify the workflow associated with developing and testing investment strategies. The framework is a perfect middle ground between black box backtesting tools that don’t let you specify custom backtest conditions and writing a long code to test each of your strategies. With this framework, you can easily build custom investment strategies and assess their performance. You can use object properties to plot the equity curves of the strategies to visualize their performance over the year, compare the strategies turnover, and check the transaction costs of each method. Here’s an example of using the backtesting framework:
First, you define a backtest strategy object which specifies the logic used to make asset allocation decisions while a backtest is running. For example, equal-weighting, maximization of Sharpe ratio, or inverse variance…You can also specify other strategy parameters such as a transaction cost model, rebalance frequency to determine how often the backtesting engine rebalances and reallocates the portfolio, and a rolling lookback window. Once the strategy is defined, create a backtestengine object that specifies the parameters of the backtest which are the strategies defined earlier, the risk-free rate, the cash borrow rate, and the Initial Portfolio value. Then use the runbacktest method to run the backtest against historical asset price data and optionally any trading signal data such as sentiment analysis, text corpuses, or any technical indicator. The backtest is run over the timetable of dividend-adjusted asset price data. After the backtest is complete, you can generate a summary table of the backtest and visualize the results.
For more information on the backtesting workflow, please check the documentation page where you can find more examples on backtesting investment strategies. Thank you for watching.
Featured Product
MATLAB
Up Next:
Related Videos:
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other bat365 country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)