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
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다: .
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)