回测流程说明
- 准备回测数据: 确保已经下载市场数据
- 选择回测策略: 例如TopkDropoutStrategy
- 设置回测参数: 包括开始/结束时间、股票选择数量等
Beispielcode (Rechnen)
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")
Beschreibung der Parameter
topk表示选择表现最好的股票数量,drop表示每日淘汰的股票数量,回测报告会显示收益和风险指标。
Diese Antwort stammt aus dem ArtikelQlib: ein von Microsoft entwickeltes KI-Tool für quantitative InvestitionsforschungDie