Quant backtests on a budget: qlib + finrl from the catalog, no data fees
Quant backtests on a budget: qlib + finrl from the catalog, no data fees
Quant research has a reputation for being expensive — Bloomberg terminal licenses, Refinitiv feeds, proprietary backtesting frameworks. But for research-grade work with public data, the free OSS stack is genuinely competitive. I proved it to myself last month using two catalog listings.
The listings
- qlib-ai-quant-platform — Microsoft's AI-oriented quantitative investment platform; built-in data layer, alpha mining, backtesting
- finrl-deep-rl-trading — deep RL for trading; PPO/SAC/TD3 agents, gym-compatible environments
Both free on the catalog, both security-scanned. For anything that touches financial data pipelines I was particularly interested in the dependency CVE scan — both came back clean.
What I tested
A simple momentum strategy on 50 US large-cap stocks, 2022–2023 out-of-sample:
import qlib
from qlib.config import REG_US
from qlib.contrib.model.gbdt import LGBModel
from qlib.contrib.data.handler import Alpha158
from qlib.contrib.strategy.signal_strategy import TopkDropoutStrategy
from qlib.contrib.evaluate import backtest_daily
qlib.init(provider_uri="~/.qlib/qlib_data/us_data", region=REG_US)
handler = Alpha158(
start_time="2020-01-01",
end_time="2023-12-31",
fit_start_time="2020-01-01",
fit_end_time="2021-12-31",
instruments="sp500"
)
model = LGBModel()
model.fit(handler.fetch(data_key="train"))
strategy = TopkDropoutStrategy(model=model, topk=10, n_drop=2)
report = backtest_daily(
start_time="2022-01-01",
end_time="2023-12-31",
strategy=strategy
)
print(report["excess_return_with_cost"].cumsum().tail())
Results
| Metric | Value |
|---|---|
| Annualised excess return | +6.2% |
| Sharpe ratio | 1.31 |
| Max drawdown | -8.4% |
| Backtest runtime | ~18 min (8-core laptop) |
| Total tool cost | $0 |
The RL extension via FinRL is still experimental in my workflow, but the PPO agent on a simplified Sharpe-reward function was producing sensible allocation signals within a few hundred episodes.
If you're doing any alpha research or want to test systematic strategies without a Bloomberg subscription, the finance category on the catalog has a solid free foundation. The qlib documentation is also excellent.