QuantCode Model: Specializing Language Models for Executable Algorithmic Trading Code
Continued pretraining and SFT specialize Qwen models for executable Backtrader trading code, raising Judge Pass to 58.2%.
The paper specializes language models for executable algorithmic trading via continued pretraining on framework code and supervised fine-tuning on agent-validated request-to-code pairs. On the 400-task QuantCode-Bench for Backtrader, continued pretraining raises Judge Pass from 41.5% to 47.5% for Qwen3.5-397B-A17B and from 27.8% to 33.0% for Qwen3.6-35B-A3B. SFT then lifts the smaller model to 58.2% Judge Pass, 83.5% successful backtests, and 79.5% final agentic success, while domain specialization can degrade tool-call formatting.