ChatPaper.aiChatPaper

QuantCode-Bench: Een benchmark voor het evalueren van het vermogen van grote taalmodellen om uitvoerbare algoritmische handelsstrategieën te genereren

QuantCode-Bench: A Benchmark for Evaluating the Ability of Large Language Models to Generate Executable Algorithmic Trading Strategies

April 16, 2026
Auteurs: Alexey Khoroshilov, Alexey Chernysh, Orkhan Ekhtibarov, Nini Kamkia, Dmitry Zmitrovich
cs.AI

Samenvatting

Grote taalmodellen hebben sterke prestaties getoond bij algemene programmeertaken, maar hun vermogen om uitvoerbare algoritmische handelsstrategieën te genereren is nog onvoldoende onderzocht. In tegenstelling tot standaard codebenchmarks vereist het genereren van handelsstrategieën een gelijktijdige beheersing van domeinspecifieke financiële logica, kennis van een gespecialiseerde API en het vermogen om code te produceren die niet alleen syntactisch correct is, maar ook daadwerkelijke transacties oplevert op historische data. In dit werk presenteren we QuantCode-Bench, een benchmark voor de systematische evaluatie van moderne LLM's bij het genereren van strategieën voor het Backtrader-framework op basis van tekstuele beschrijvingen in het Engels. De benchmark omvat 400 taken van uiteenlopende moeilijkheidsgraad, verzameld van Reddit, TradingView, StackExchange, GitHub en synthetische bronnen. Evaluatie vindt plaats via een meerfasenpijplijn die de syntactische correctheid, succesvolle uitvoering van backtests, de aanwezigheid van transacties en semantische afstemming met de taakbeschrijving controleert met behulp van een LLM-beoordelaar. We vergelijken state-of-the-art modellen in twee settings: single-turn, waarbij de strategie in één poging correct gegenereerd moet worden, en agent-gebaseerd multi-turn, waarbij het model iteratieve feedback ontvangt en zijn fouten kan herstellen. We analyseren de faalmodi in verschillende fasen van de pijplijn en tonen aan dat de belangrijkste beperkingen van huidige modellen niet gerelateerd zijn aan syntaxis, maar eerder aan de correcte operationalisering van handelslogica, correct API-gebruik en naleving van taaksemantiek. Deze bevindingen suggereren dat het genereren van handelsstrategieën een aparte klasse van domeinspecifieke codegeneratietaken vormt waarin succes niet alleen technische correctheid vereist, maar ook afstemming tussen natuurlijke-taalbeschrijvingen, financiële logica en het waarneembare gedrag van de strategie op data.
English
Large language models have demonstrated strong performance on general-purpose programming tasks, yet their ability to generate executable algorithmic trading strategies remains underexplored. Unlike standard code benchmarks, trading-strategy generation requires simultaneous mastery of domain-specific financial 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 the Backtrader framework from 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, and semantic alignment with the task description using an LLM 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, proper API usage, and adherence to task semantics. These findings suggest that trading strategy generation constitutes a distinct class of domain-specific code generation tasks 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.
PDF51April 21, 2026