Leveraging LLMs for Stock Research and Cycle Strategy Validation
This article explores how to effectively use large language models (LLMs) to assist in stock research and cycle strategy validation. Rather than treating LLMs as price predictors, the article emphasizes their role in organizing evidence and generating testable hypotheses. It outlines a structured research workflow covering data governance, deterministic rule calculation, candidate screening, and model analysis, along with best practices for prompt design, rigorous historical backtesting, and engineering implementation to ensure traceability and risk control.
I. Defining the Goal: Assisting Research, Not Predicting Price Movements
“Can LLMs trade stocks?” is not a precise enough question. A more worthwhile discussion is: during the stock research process, which tasks are suitable for LLMs, and which must be handled by data systems, computational programs, and human researchers?
Stock research typically involves market data aggregation, financial analysis, announcement reading, industry comparison, trading rule formulation, and risk management. These tasks have different natures. LLMs are well-suited for processing natural language materials, summarizing research logic, explaining indicator meanings, and generating testable hypotheses. For price calculations, yield statistics, and trading feasibility checks, deterministic computational programs should be prioritized.
Therefore, a reasonable division of labor is:
Data systems provide facts, computational programs execute rules, LLMs organize evidence, and researchers bear decision-making responsibility.
The fast response and fluent language of an LLM do not mean its conclusions have predictive advantages. Analysis that has not undergone out-of-sample validation, even if it looks highly professional, can only serve as a research lead and should not be interpreted as a deterministic trading signal.
This article discusses research methodologies and system design. It does not constitute buy or sell recommendations for any securities, nor does it guarantee returns.
II. Why You Shouldn’t Ask Models to Pick “Stocks That Will Rise Tomorrow”
Directly inputting a set of stock tickers and asking the model to pick the best-performing assets over the next few trading days usually presents four categories of problems.
1. A Stock Ticker Does Not Equal Complete Research Material
A ticker is merely an identifier; it does not contain the latest prices, trading activity, financial changes, announcement events, or trading restrictions. Without reliable data integration, the model may use outdated information or even confuse securities names, reporting periods, and event timelines.
Even if the system has external retrieval capabilities, you still need to verify the publication time, coverage scope, and source quality of the materials. The ability to retrieve information does not mean you have obtained complete, accurate data suitable for current decision-making.
2. Short-Term Prices Are Highly Uncertain
Price changes over a few trading days may be simultaneously influenced by market sentiment, breaking news, capital flows, and overall risk appetite. Language models excel at explaining existing materials, but explanatory ability cannot be directly equated with short-term return prediction capability.
3. Fluent Expression Easily Masks Insufficient Evidence
The model might string together phenomena like “active trading,” “improving trend,” and “rising industry attention” into a seemingly complete story without providing verifiable data foundations.
You should be particularly wary of statements like “smart money is quietly accumulating” or “large capital is exiting.” Based solely on price and volume, it is usually impossible to reliably identify specific participants and their true intentions. Such content can at best be treated as a hypothesis to be tested, not stated as a fact.
4. Without Evaluation Criteria, You Cannot Judge Usefulness
If observation periods, comparison benchmarks, trading costs, and failure conditions are not defined in advance, it is easy to remember only a few successful cases retrospectively.
The correct research question should shift from “Which stock will definitely rise?” to:
“Based on the data available before a specified date, which assets meet the established trend conditions? Do these conditions hold stable research value in out-of-sample historical data?”
III. Translating “Market Seasons” into Testable State Classifications
Using seasons as a metaphor for stock movements lowers the barrier to understanding, but it is not an accepted natural law, nor does it mean prices will cycle in a fixed order.
A more robust approach is to rewrite the season concept as “market state labels” and define the observation conditions corresponding to each label.
| State Label | Observable Phenomena | Main Research Risks |
|---|---|---|
| Sustained Weakness | Price center shifting down, weak trend indicators | Downward trend continues |
| Low-level Consolidation | Volatility converging, price oscillating | Another drop after consolidation |
| Trend Attempt | Breaking historical range, increased trading activity | False breakout |
| Trend Continuation | Mid-term upward direction, orderly pullbacks | Sudden trend reversal |
| Accelerated Volatility | Gains and volatility expanding together | Pullbacks and trading crowding |
| Trend Weakening | Key support breached, price structure deteriorating | Liquidity and gap risks |
These labels are merely descriptions of historical and current data, not guarantees of future trends. Different stocks, industries, and market environments may exhibit entirely different state transition paths.
How to Make Classification Rules Reproducible
Taking “Trend Attempt” as an example, you can construct a set of research conditions:
- The latest closing price is higher than the highest closing price over a previous period;
- The short-term moving average is higher than the mid-term moving average;
- Current volume has increased relative to the historical average volume;
- Recent volatility and liquidity meet pre-set limits.
The most important thing here is not to find a set of seemingly magical parameters, but to achieve four things:
- Clear condition definitions;
- Consistent data calibers;
- Repeatable calculation results;
- Parameters selected through out-of-sample testing.
Any window length, volume threshold, or risk limit should be treated as a research setting to be validated, not packaged as a universally effective rule of thumb.
IV. Building a Complete Workflow: Compute First, Explain Later
A practical smart investment research process can be divided into six steps:
Research Scope Definition → Data Governance → Rule Calculation → Candidate Screening → Model Analysis → Manual Review and Historical Validation.
Step 1: Determine the Stock Pool and Research Time Point
First, clarify the research objects, such as only studying common stocks with a certain historical length and relatively sufficient liquidity. Define in advance how to handle suspensions, delisting periods, and short listing times.
Simultaneously, record the data cutoff point. Post-market research can use data completed and available that day; intraday research cannot use information determined only after the market closes.
The stock pool should also be restored to historical time points as much as possible. If you backtest the past using only stocks that still exist today, you may omit delisted samples, creating survivorship bias.
Step 2: Prepare Validated Data
It is recommended to manage at least the following data:
- Market data: Trading date, open, high, low, close, volume, and turnover;
- Corporate action data: Dividends, splits, rights issues, and corresponding price adjustment information;
- Fundamental data: Financial reporting periods, actual disclosure dates, and key indicators;
- Event data: Announcement time, event category, and raw content;
- Trading status data: Suspension/resumption, price limits, and other applicable trading constraints.
Price adjustment calibers must be consistent. Mixing different calibers when calculating price changes, breakouts, and volatility may generate false signals. When calculating simulated execution prices, they must match the actual executable prices at that time.
The data system should also check for duplicate records, missing dates, abnormal prices, and unit inconsistencies. Whether volume is recorded in shares, lots, or other units must be clearly stated in the data dictionary.
Step 3: Generate Candidate Sets via Deterministic Programs
Batch calculations should be handled by programs, rather than asking an LLM to read market data tables one by one and perform mental math.
Below is a schematic pseudo-code independent of specific technical products:
For each historical trading day:Read data available up to that pointBuild the valid stock pool for that dayFor each stock in the pool:Skip if historical length is insufficientSkip if trading status does not meet rulesHistorical high = Highest closing price in the prior windowHistorical average volume = Average volume in the prior windowTrend condition = Short-term MA > Mid-term MABreakout condition = Current closing price > Historical highActivity condition = Current volume meets threshold relative to historical average volumeRisk condition = Volatility and liquidity meet preset limitsIf all above conditions are met:Output candidate record and indicator snapshot
The “prior window” should exclude the current observation value to prevent the breakout baseline from being self-contained. If a signal relies on the day’s closing data, backtesting usually cannot assume prior knowledge of that signal and frictionless execution at the same closing price. The execution time point must match the time point when the information is truly available.
Step 4: Provide a Research Material Package to the Model
Do not submit only stock tickers. Each candidate should be equipped with structured materials, including:
- Anonymized or internal security identifiers;
- Data cutoff time;
- Key indicators and calculation calibers;
- Recently disclosed events;
- Material source IDs;
- Missing fields;
- Specific reasons triggering the screening rule.
The model’s task is to compare evidence, discover contradictions, and list risks, not to fabricate materials.
V. Designing More Reliable Research Prompts
Prompts should clearly define role boundaries, evidence scopes, and output structures. Below is a generic template:
You are a securities research assistant. Please analyze strictly based on the provided materials.Tasks:1. Explain which screening conditions each candidate meets.2. Differentiate between confirmed facts, reasonable inferences, and unknown items.3. Check for conflicts between trend indicators, fundamental information, and event information.4. List conditions that could invalidate the research hypothesis.5. Provide questions that require manual verification.Constraints:- Do not supplement prices, announcements, or financial figures not present in the materials.- Do not promise future returns or use deterministic language like "will definitely rise."- Do not assert the intentions of specific capital entities based solely on price and volume phenomena.- Cite material IDs for each key judgment.- Explicitly state inability to judge when information is insufficient.Output Fields:Candidate ID, Supporting Evidence, Counter-evidence, Main Risks,Missing Information, Verification Items, Evidence Sufficiency.
“Evidence Sufficiency” should also not be misunderstood as the probability of a price increase. To output a probability, you must establish clear event definitions and verify their calibration through independent data testing. Otherwise, a seemingly precise number will only increase misleading effects.
VI. Historical Validation: Testing Rules, Not Cherry-Picking Cases
After candidate screening is complete, the truly important work begins: validating whether this set of rules still holds research value after considering costs and trading constraints.
1. Divide Samples by Time
Historical data can be sequentially divided into a rule development interval, a parameter validation interval, and a final testing interval. The last segment of data should be kept as independent as possible to avoid continued parameter tuning after repeated observation.
A rolling approach can also be used, setting rules in an earlier stage and testing them in subsequent time periods to observe the rule’s stability across different market environments.
2. Incorporate Real-World Constraints
Backtesting should at least consider commissions, applicable taxes, slippage, suspensions, price limits, and actual execution capacity. A signal appearing does not mean a trade can definitely be executed, especially when prices change rapidly or liquidity is insufficient.
For markets and security types subject to restrictions like not being able to sell on the same day after buying (e.g., T+1 rules), these must be reflected in the execution rules. Trading paths impossible in reality cannot be used.
3. Don’t Just Look at Win Rates
A strategy might frequently make small profits and occasionally incur large losses. Therefore, evaluation should simultaneously focus on cumulative returns, maximum drawdown, volatility, return-to-risk ratio, turnover rate, single profit/loss distribution, and performance relative to a benchmark.
You should also check whether returns rely excessively on a few stocks, a specific industry, or a short market rally. If the effect disappears noticeably when these samples are removed, the rule cannot easily be considered universal.
4. Independently Validate the Incremental Value of the Model
If the rule itself has already screened out stocks with strong trends, subsequent returns cannot be entirely attributed to the model.
Control groups can be set up: one group uses the rule candidate set directly, and the other adds model analysis under the same conditions. Comparing the risk, coverage, and stability of both in independent samples allows you to determine whether the model truly provides incremental value, rather than just generating better-looking reports.
VII. Engineering Implementation: Traceability Over Automation
For individual researchers, the process can start with small-scale offline experiments; for teams, version and permission management should be further established.
It is recommended to save the following for each research iteration:
- Data snapshots and cutoff times;
- Stock pool and screening rule versions;
- Indicator parameters;
- Input materials and sources;
- Prompts and model configurations;
- Raw outputs, manual modifications, and review records;
- Subsequent validation results.
This ensures you can answer a key question: What information was this conclusion based on at that time?
In terms of system design, the research module and the trading execution module should maintain permission isolation. Unvalidated natural language outputs should not directly translate into order instructions. Even if automation is added later, independent risk limits, exception interception, manual confirmation, and stop mechanisms are still required.
Text from external announcements or web pages should be treated as materials to be analyzed, not as system instructions. Even if content like “ignore original rules” appears in the materials, it should not alter the research process or permission boundaries.
VIII. Conclusion: Building a Research Closed Loop
The practical value of LLMs in stock research is not turning an uncertain market into deterministic answers, but helping researchers organize information, check arguments, expose missing evidence, and form more standardized research records.
The so-called cycle model should also not be viewed as a navigator that directly locates the best buy and sell points. It only forms the basis for discussing practical value when it is translated into explicit rules, uses data matching historical time points, and passes tests for trading costs, out-of-sample performance, and risk constraints.
A reliable closed loop should be: propose a hypothesis, define rules, prepare data, generate candidates, verify evidence, conduct backtesting, record deviations, and then decide whether to continue research. Using LLMs within this closed loop provides more technical value and better controls cognitive and operational risks than directly asking “what to buy tomorrow.”
