QuantCode-Bench: A Benchmark for Evaluating the Ability of Large Language Models to Generate Executable Algorithmic Trading Strategies
Summary
QuantCode-Bench is a new benchmark of 400 tasks evaluating LLMs on generating executable algorithmic trading strategies for the Backtrader framework, testing syntactic correctness, backtest execution, trade presence, and semantic alignment. The study finds that current models' main limitations lie in correctly operationalizing trading logic and API usage rather than syntax.
View Cached Full Text
Cached at: 04/21/26, 07:21 AM
Paper page - QuantCode-Bench: A Benchmark for Evaluating the Ability of Large Language Models to Generate Executable Algorithmic Trading Strategies
Source: https://huggingface.co/papers/2604.15151
Abstract
QuantCode-Bench evaluates large language models on generating executable trading strategies by testing their ability to translate natural language descriptions into functional code that operates correctly on historical financial data.
Large language modelshave demonstrated strong performance on general-purpose programming tasks, yet their ability to generate executablealgorithmic tradingstrategies remains underexplored. Unlike standard code benchmarks, trading-strategy generation requires simultaneous mastery of domain-specificfinancial logic, knowledge of a specialized API, and the ability to produce code that is not only syntactically correct but also leads to actual trades on historical data. In this work, we present QuantCode-Bench, a benchmark for the systematic evaluation of modern LLMs in generating strategies for theBacktrader frameworkfrom textual descriptions in English. The benchmark contains 400 tasks of varying difficulty collected from Reddit, TradingView, StackExchange, GitHub, and synthetic sources. Evaluation is conducted through a multi-stage pipeline that checks syntactic correctness, successful backtest execution, the presence of trades, andsemantic alignmentwith the task description using anLLM judge. We compare state-of-the-art models in two settings: single-turn, where the strategy must be generated correctly on the first attempt, and agentic multi-turn, where the model receives iterative feedback and may repair its errors. We analyze the failure modes across different stages of the pipeline and show that the main limitations of current models are not related to syntax, but rather to the correct operationalization of trading logic, properAPI usage, and adherence to task semantics. These findings suggest that trading strategy generation constitutes a distinct class of domain-specificcode generationtasks in which success requires not only technical correctness, but also alignment between natural-language descriptions,financial logic, and the observable behavior of the strategy on data.
View arXiv pageView PDFProject pageGitHub3Add to collection
Get this paper in your agent:
hf papers read 2604\.15151
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper0
No model linking this paper
Cite arxiv.org/abs/2604.15151 in a model README.md to link it from this page.
Datasets citing this paper0
No dataset linking this paper
Cite arxiv.org/abs/2604.15151 in a dataset README.md to link it from this page.
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2604.15151 in a Space README.md to link it from this page.
Collections including this paper1
Similar Articles
FindStatBench: Evaluating Large Language Models on Combinatorial Code Synthesis
FindStatBench is a benchmark for evaluating large language models on combinatorial code synthesis tasks, introduced in an arXiv paper.
AI Trading: Evaluating Large Language Models for Technical Market Analysis
This paper evaluates the ability of large language models to perform technical market analysis for trading, using a benchmark approach.
CSTutorBench: Benchmarking Small Language Models as Tutors for Block-Based Programming
CSTutorBench is a benchmark for evaluating small language models as tutors for block-based programming, focusing on pedagogical behaviors. Preliminary results show models struggle with deeper tutoring skills like avoiding answer leakage, and prompt revision improves scores.
FINESSE-Bench: A Hierarchical Benchmark Suite for Financial Domain Knowledge and Technical Analysis in Large Language Models
This paper introduces FINESSE-Bench, a suite of eight specialized benchmarks with 3,993 questions for hierarchical evaluation of financial competencies in large language models, covering professional certification topics and applied trading tasks.
Beyond Agent Architecture: Execution Assumptions and Reproducibility in LLM-Based Trading Systems
This paper reviews and audits execution realism in LLM-based trading research, proposing clearer reporting standards for reproducibility and evaluation comparability.