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:
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)