Backtesting
q.bt is qrt’s planned event-driven backtesting module. It is scaffolded but not implemented yet — q.bt.run currently raises NotImplementedError. The design goal:
trades = q.bt.run(signal, prices)- Input — a model/rule signal plus OHLCV bars in qrt’s canonical layout (see Data schemas).
- Output — a trade log in the canonical trades format: the same schema the bundled demo logs (
q.data.datasets.TRADE_LOGS) use today. That means everything downstream of a backtest already works:q.stats.trade_stats,q.stats.trades_to_returns,q.plot.trades,q.plot.mae_mfe, andq.plot.trade_distribution— see Trade logs. - Additional concerns (transaction cost models, slippage, …) land as further submodules, following the same convention as
q.feature/q.data.
Until q.bt.run lands, the bundled demo trade logs let you exercise the entire trades workflow end to end. Follow progress on the Roadmap.