Description of the backtesting process
- Prepare backtest data: Ensure market data has been downloaded
- Choose a dropout strategy: e.g. TopkDropoutStrategy
- Set backtest parameters: start/end time, number of stocks to select, etc.
sample code (computing)
from qlib.contrib.strategy import TopkDropoutStrategy
from qlib.backtest import backtest
strategy = TopkDropoutStrategy(topk=10, drop=2)
report = backtest(strategy=strategy, start_time="2024-01-01", end_time="2025-03-25")
Parameter description
The topk indicates the number of top performing stocks selected, the drop indicates the number of stocks eliminated on a daily basis, and the backtesting report displays return and risk metrics.
This answer comes from the articleQlib: an AI quantitative investment research tool developed by MicrosoftThe




























