LLM-Assisted Development Reliability: Lessons from a Trading Review Project
A personal trading review project provides a practical way to assess whether LLM-assisted development is accurate, recoverable, and reproducible. This article examines data ingestion, market data collection, database traceability, account reconciliation, testing, and reporting, showing how explicit acceptance criteria and verifiable evidence matter more than fluent explanations or a successful demonstration.
1. Evaluate LLMs Through Engineering Tasks with Clear Acceptance Criteria
Two common mistakes undermine assessments of an LLM’s coding ability: treating a fluent explanation as a correct implementation, and treating one successful run as evidence of system reliability.
Real projects often combine file parsing, external data access, database writes, business calculations, and report generation. A model’s success with one component does not establish that the entire workflow is accurate, stable, and repeatable.
Reviewing personal stock trades is a useful setting for examining these capabilities. The business objective is clear: organize historical transactions, connect them to market data, calculate account performance, analyze trading behavior, and produce an evidence-based report. Yet the workflow also involves easily overlooked details, including security identifier formats, transaction fees, price adjustments, missing data, and cash inflows and outflows.
Rather than reviewing a particular model, this article addresses a broader question: how can a trading review project reveal whether LLM-assisted development is genuinely reliable?
Start by separating requirements into three categories:
- Data facts: Which transactions occurred, which market data was retrieved, and which fields remain missing.
- Calculation rules: How positions, costs, returns, and drawdowns are calculated.
- Interpretive conclusions: Which trading behaviors are associated with losses, and which judgments lack sufficient evidence.
These categories must remain distinct. Data facts require source records, calculation rules require explicit conventions, and interpretations must rest on both.
2. Distinguish Trading Review from Strategy Backtesting
Analyzing brokerage transaction records alongside historical prices is not automatically strategy backtesting.
Trading Review Asks What Actually Happened
A trading review uses actual execution records to reconstruct positions and cash movements. It answers questions such as:
- Which securities contributed most to gains or losses?
- How did holding periods relate to trading outcomes?
- Did transaction fees materially reduce returns?
- During which periods did account drawdowns occur?
- Was there frequent position switching or excessive concentration in a single security?
These are primarily descriptive questions. They do not require inventing additional trades.
Strategy Backtesting Asks What Would Happen Under Defined Rules
A backtest requires predefined trading rules, including signal conditions, execution timing, position limits, and exit mechanisms. Those rules are then simulated against historical data.
Observing that a stock rose after an actual sale and concluding that “holding it a few more days would have produced a profit” is not a complete backtest. That judgment ignores other trades, capital tied up in the position, risk exposure, and whether the proposed rule could be applied consistently.
The first project phase should therefore prioritize a reliable reconstruction of actual trading activity. Repeatable strategy experiments should come only after the data and accounting results have been validated.
3. Preparing Transaction Statements: Readable Does Not Mean Complete
Spreadsheets exported from trading software are a useful starting point, but they should not be treated as clean data sources.
Common problems include:
- Headers appearing in different rows, with account information above them.
- Separate worksheets for executions, cash movements, and fees.
- Leading zeros disappearing from security identifiers during conversion.
- Mixed date formats and missing execution times.
- Purchases, sales, cancellations, dividends, and transfers appearing in the same table.
- Amount fields containing thousands separators, spaces, or inconsistent sign conventions.
- Multiple fee-detail rows associated with one transaction.
Converting a spreadsheet into structured text can help a model understand its fields. It cannot replace parsing the original file. A presentation layer may omit worksheets, truncate records, or alter numeric formats.
A more reliable approach uses two separate paths:
- Presentation path: Produce field descriptions, a small set of examples, and an anomaly summary for the model.
- Calculation path: Read every original record directly, then perform type conversion, cleaning, and validation.
Treat security identifiers as strings and represent monetary amounts and fees with fixed-point precision. Missing values, unrecognized transaction types, and suspected duplicates should be recorded in an exception list rather than silently skipped.
At a minimum, the import stage should report:
- Original record count, successfully imported count, and exception count.
- Counts and total amounts by transaction type.
- Total executed quantity, transaction value, and fees.
- The securities involved and the transaction date range.
- Duplicate records and the criteria used to identify them.
Proceed to market data collection only when these checks reconcile reasonably with the original statement.
4. Break Requirements into Bounded Deliverables
Asking a model to “build the entire trading review system” in one step invites scope drift. It may choose data sources without approval, change accounting conventions, or generate conclusions before obtaining the necessary data.
A staged delivery process provides clearer boundaries.
Stage 1: Identify the Inputs
The model analyzes fields, identifies securities, establishes date ranges, and lists uncertainties. It does not access external APIs or produce performance conclusions.
Stage 2: Define the Data Plan
Specify the required market data fields, collection period, access permissions, storage structure, and exception-handling policy.
Daily prices are usually sufficient for basic position valuation. Whether minute-level data is necessary depends on the analysis objective. If transaction records contain dates but no execution times, minute-level prices cannot precisely establish market conditions at execution.
Stage 3: Complete a Small End-to-End Workflow
Select a few securities and a short date range. Complete the full collection, storage, query, and accounting workflow, checking data types, uniqueness constraints, and return calculation conventions.
Stage 4: Expand and Generate Reports
Expand the data scope only after the small sample passes acceptance checks. The final report must cite only data that has been stored and validated.
Each stage needs explicit inputs, outputs, and acceptance criteria. The model’s role is to perform inspectable work within defined constraints, not to improvise freely.
5. Market Data Collection: Prioritize Coverage and Recoverability
Before collecting historical prices, verify what the data source actually supports: historical depth, security coverage, minute-level access permissions, rate limits, and field definitions.
Access to daily data does not imply access to all historical minute-level data. Likewise, an empty API response does not necessarily mean that a security did not trade.
Empty results may reflect a market holiday, trading suspension, later listing date, insufficient permissions, invalid parameters, or a service failure. The system must distinguish these cases.
Split Tasks by Security and Time Range
Divide requests into independent batches. For each batch, record:
- Security identifier and target period.
- Current status.
- Request count and error type.
- Number of records returned.
- Date range of saved data.
- Earliest permitted retry time.
Statuses can include pending, running, successful, failed, and awaiting manual review. After a restart, execution should resume from recorded task states instead of repeating collection from the beginning.
Set Timeouts and Bounded Retries
Temporary network failures may justify retries with progressively longer waits. Permission errors and invalid parameters generally do not; record them and request corrective action instead.
A long period without visible response during LLM-assisted development should not automatically be blamed on the model. Possible causes include an external request without a timeout, a blocked database write, an active background task, or a coding environment that does not display tool status.
Log model responses, tool execution, and external service access separately so that problems can be located.
Tie Progress Reports to Actual Task State
“Working hard on the request” is not useful engineering progress. More meaningful information includes:
- Total task count and completed count.
- Current security and time range.
- Time of the most recent successful write.
- Number of failed tasks.
- Classification of recoverable and nonrecoverable errors.
Progress logs must not expose credentials, full account numbers, or sensitive paths.
6. Database Design: Preserve Facts and Calculation Evidence
A local database need not be complex, but it must support traceability. At minimum, separate the following data objects:
- Import batches: File hash, import time, parsing-rule version, and import statistics.
- Raw transaction records: Original statement fields preserved as fully as possible.
- Normalized transactions: Standardized dates, securities, transaction direction, quantities, prices, amounts, and fees.
- Security reference data: Identifiers, names, and necessary historical mappings.
- Market data: Timestamps, prices, volume, source, and price-adjustment convention.
- Collection tasks: Status, retry count, and error summary.
- Analysis results: References to input batches, calculation versions, and report timestamps.
Market data tables need appropriate uniqueness constraints. For example, a record might be uniquely identified by security, time granularity, timestamp, data source, and price-adjustment convention. This prevents retries from creating duplicate records.
Do not combine multiple data sources without validation. Sources may differ in timestamp conventions, volume units, adjustment methods, and update schedules. Preserve source information and define how primary and fallback sources are selected.
The goal is not merely to store data. It is to answer which file, market data batch, and calculation rules produced a particular result.
7. Reconcile the Account Before Adding Intelligent Analysis
The most important part of a trading review is reconstructing the accounts, not generating a natural-language summary.
A basic cash relationship is:
End-of-day cash balance = Previous day’s cash balance + Cash inflows − Cash outflows + Net sale proceeds − Total purchase outlays + Other cash movements
Purchase outlays generally include transaction value and applicable fees. Net sale proceeds deduct applicable fees. The implementation must follow the statement’s field definitions, avoid double-counting fees, and not assume identical rules across all periods and transaction types.
Account equity can be expressed as:
Account equity = Cash balance + Total market value of holdings
However, this requires the starting cash balance, initial positions, and complete cash movement records. A partial set of executions is not enough to claim that the entire account has been reconstructed.
The accounting rules must also specify:
- How position costs are allocated when only part of a holding is sold.
- How dividends, stock distributions, and other corporate actions are handled.
- Which prices are used during trading suspensions.
- Whether missing prices halt calculations or trigger use of the most recent available price.
- How actual execution prices remain consistent with adjusted historical market data.
For accounts with external cash flows, a return calculation based simply on ending versus beginning equity can be misleading. Time-weighted returns primarily reduce the effect of external cash-flow timing, while money-weighted returns reflect how the timing of invested capital affects outcomes. Choose the method according to the analysis objective and data completeness, and disclose it in the report.
8. Define Metrics and Their Limits
A basic report can include net profit or loss, transaction fees, holding-period distributions, per-trade profit and loss, return contributions, and maximum account drawdown.
Each metric needs a defined unit of analysis. Does “one trade” mean an individual execution, a matched set of purchases and sales, or a complete position cycle from opening to closing? Different definitions can produce very different win rates.
Maximum drawdown generally measures the largest decline in an equity curve from a previous peak. It cannot be calculated reliably from discontinuous transaction records without complete position valuations and cash movement information.
Return contribution analysis must also avoid confusing association with causation. Higher losses within a category of trades show an association in the current sample; they do not prove that the behavior causes losses in every market environment.
Statistical findings should not become absolute judgments about a person, such as declaring that a trader is “bound to fail.” Technical reports should assess observable behavior and risk exposure, not label individuals.
9. Testing and Security Are Part of Reliability
LLM-generated programs need business-level tests, not just syntax checks.
Create small test datasets covering:
- A single purchase followed by a complete sale.
- Multiple purchases followed by a partial sale.
- An open position with purchases but no sales.
- Fees listed separately from executions.
- Multiple executions on the same day.
- Reimporting the same file.
- Restarting after a collection failure.
- Missing prices, market holidays, and trading suspensions.
- Positions already held at the start of the analysis.
- Cash transfers into or out of the account during the period.
Each test should have manually calculated expected results. Tests must verify not only the numbers but also whether the system correctly identifies cases where calculation prerequisites are missing.
Credential management needs its own design. Access tokens should not be written directly into documents shown to the model, and must not enter repositories or logs. Inject them through controlled configuration or credential-management mechanisms, following the principle of least privilege.
Transaction statements contain personal financial information. Remove unnecessary names, account numbers, and contact details before submitting data to a model. For sensitive information, prefer field descriptions, anonymized samples, or aggregate results over indiscriminate uploads of original files.
10. Build a Meaningful Capability Assessment
A trading review project can evaluate LLM-assisted development across five dimensions:
- Requirements understanding: Can the model distinguish trading review, strategy backtesting, and investment prediction, and identify missing inputs?
- Engineering implementation: Can it produce appropriate data structures, exception handling, and recoverable workflows?
- Business accuracy: Can it maintain consistent treatment of fees, cash flows, and valuations?
- Verifiability: Can it produce tests, reconciliation summaries, and evidence for conclusions?
- Controllable collaboration: Can it work within explicit boundaries and request confirmation when uncertainty arises?
Response speed and code length may be observations, but they should not be the primary evaluation criteria. A successful demonstration does not justify broad claims about capability. A stronger assessment uses fixed tasks, explicit acceptance criteria, and repeated validation.
A reliable LLM-assisted development workflow forms a closed loop:
Requirements clarification → Data validation → Small-sample implementation → Human acceptance review → Expanded execution → Metric calculation → Report review
LLMs can help developers organize requirements, draft implementations, explain anomalies, and write reports. Critical data, business conventions, and final conclusions must still be inspectable, traceable, and reproducible.
For a trading review, the valuable outcome is not a startling judgment. It is a system that can consistently reconcile accounts, reveal risk, and acknowledge the limits of its analysis.
