Multimodal LLM Programming in Practice: Building a Quantitative Trading System
This article evaluates the coding capabilities of a new multimodal Large Language Model (LLM) by using it to build a quantitative trading system. It explores the LLM's performance in frontend development, financial domain knowledge, code quality, engineering workflows, and practical strategy backtesting, providing insights into its strengths, limitations, and best practices for collaboration.
Multimodal LLM Programming in Practice: Building a Quantitative Trading System
1. Why Quantitative Trading Systems Make a Good Benchmark
Evaluating an LLM’s coding ability based solely on benchmark scores is insufficient; real-world projects reveal the most compelling insights. A quantitative trading system serves as an ideal test scenario for three main reasons:
- High Technical Stack Complexity: It involves frontend UI development, backend data processing, factor calculation, model training, and backtesting engines, while also handling financial data specifics like price adjustments and slippage.
- Heavy Reliance on Domain Knowledge: Without a solid background in finance, the model cannot comprehend the requirements, let alone write correct code.
- Quantifiable Validation: Strategy metrics like annualized return and maximum drawdown are objective. The backtesting results clearly show whether the code is correct and the logic is rigorous, eliminating subjective evaluations like “feels well-written.”
Based on these considerations, I decided to test a newly released LLM, advertised for its multimodal programming capabilities, by having it assist in developing a quantitative trading system.
2. Frontend Development: On Target and Generally Reliable
From a web programming perspective, the model’s performance can be described as “hitting the target.” Whether it is rendering data tables, drawing candlestick charts, or laying out backtesting result panels, it generally provides usable UI code in one go as long as the requirements are clearly described.
For routine UI iterations—such as adjusting column widths, adding filter conditions, or modifying color schemes—it quickly grasps the intent and delivers correct modifications. The greatest value here is that writing and styling UIs, which previously consumed a lot of time, can now be entirely delegated to the model with faster delivery speed. For quantitative developers whose core work is strategy research, this strips away the most tedious manual labor.
3. Financial Domain Knowledge: Good Breadth, Depth Requires Guidance
The model offered several surprises regarding its financial knowledge reserves:
1. Familiarity with Mainstream Price-Volume Methods
Mentioning the “Triple Barrier Method” for label generation, it accurately understood the concept and provided implementation ideas. This is a relatively advanced labeling method in machine learning for quant trading, indicating comprehensive coverage of financial content in its training data.
2. Understanding Model Attribution
After completing predictions using a Gradient Boosting Tree model, I wanted to perform attribution analysis on the results. It directly suggested the SHAP method and provided visualization implementation ideas for feature importance.
3. Knowledge of Common Factors and Preprocessing Details
It knows how to construct classic factors like momentum and reversal, and understands the dimensional differences between factors, recognizing the need for normalization. More impressively, when uncertain about details like “the impact of price adjustment methods (forward/backward adjusted) on factor calculation,” it proactively writes test code to verify with actual data rather than guessing.
4. Capability to Mine Localized Factors
During the feature attribution phase, it autonomously calculated localized factors like “limit-up genes” (patterns related to daily price limit hits), which are crucial in specific markets like China’s but absent in standard textbooks. This shows the model has a genuine understanding of specific local trading rules, rather than just copying overseas materials.
4. Code Quality: Not Yet Flawless on the First Try
To pour some cold water on the enthusiasm, the model currently cannot achieve “getting it right the first time.” Various errors occur during development, including missing boundary conditions, index misalignment during data alignment, and unintentionally introducing look-ahead biases in backtesting time series.
However, its reasoning ability is solid, and it “can be reasoned with.” When you point out a logical flaw, it understands your argument, follows the logic to locate the bug, and fixes it, rather than getting stuck in the same loop. This is crucial in practical collaboration: a communicative model, even with initial errors, will converge to the correct result after a few iterations; an unresponsive model will drain your energy.
Compared horizontally with other mainstream coding models in the industry, its level is roughly at the stage where “both can catch each other’s code errors,” with no obvious generational gap.
5. Practical Results: A Profitable Strategy Prototype
Using a Gradient Boosting Tree model combined with two basic factor types (momentum and reversal), the model helped build a complete strategy backtesting workflow. After I manually adjusted a parameter, the backtesting performance was as follows:
- Annualized Return: ~12.55%
- Sharpe Ratio: ~0.58
This result falls into the “profitable but poor holding experience” category: positive returns, but high volatility and low risk-adjusted returns. Considering that no proprietary factors or algorithms were added yet, achieving this level with just two basic factors is a solid starting point, leaving significant room for future optimization.
An interesting aside: during feature attribution, the model identified a strongly performing stock. The strategy indeed bought it before the breakout, but also sold it before the rally—typical “buying in but leaving no profit on the table.” This perfectly exposes the inherent limitation of pure price-volume factor strategies: entry signals exist, but exit logic requires more sophisticated designs involving holding periods, take-profit, and stop-loss rules.
6. Engineering Highlights: Wishlist-Driven Programming
In the past, strategy debugging involved hardcoding factors. Changing factor sets meant rewriting code and restarting the backtest, which was highly inflexible. With the model’s assistance, I implemented a “wishlist-driven programming” workflow:
backtest_config = {"factor_pool": ["momentum", "reversal", "limit_up_gene", ...], # Each factor can be toggled independently"model": "gradient_boosting_tree","labeling_method": "triple_barrier_method","tuning": "grid_search" / "bayesian_optimization"}
Before each backtest, I simply check the desired factors on the UI, and the system automatically assembles the calculation pipeline and executes the backtest. Factor combination experiments shifted from “rewriting code” to “clicking checkboxes,” improving iteration efficiency by an order of magnitude.
Additionally, when tasked with designing a parameter optimization scheme, it provided a complete search space definition, evaluation metric selection, and overfitting prevention measures (like time-based train/validation splits). The structural integrity of the proposal made it ready for direct implementation.
7. Conclusion: Capabilities, Boundaries, and Usage Recommendations
Based on this test, the following conclusions can be drawn:
Strengths: Solid multimodal programming capabilities; frontend development can be safely outsourced to it. Good breadth in financial domain knowledge, covering everything from classic factors to localized features. Strong reasoning and communication skills, able to be guided to correct errors through logical discussion.
Weaknesses: Low first-pass success rate; complex logic still requires multiple iterations. Code correctness requires human supervision and cannot be fully left alone.
Practical Advice: Position the LLM as a “highly efficient junior collaborator” rather than an “automatic programmer.” Delegate deterministic tasks like UIs, scaffolding, and boilerplate code to it, while keeping core algorithmic logic under human review and ensuring robust unit testing as a safety net. As for whether the strategy makes money—that is a factor research issue, not a model issue. But one thing is certain: human effort is indeed saved.
