Open-Source LLM Coding Test: A Single-Case Observation of Financial Indicator Reproduction

    This article reports a single-case test in which a large language model converted market-timing indicators from brokerage research reports into Tonghuashun formula code. It covers document parsing, first-pass code generation, platform function compatibility, one-round prompt-based correction, and a second volume-price divergence case. The article summarizes stable and weak areas, provides a practical checklist and prompt template, and discusses limitations for developers and model providers.

    Open-Source LLM Coding Test: A Single-Case Observation of Financial Indicator Reproduction

    1. Conclusion First

    This article is based on a single-case test. The task was to rewrite a market-timing indicator from a brokerage research report into Tonghuashun formula format. The results show that the model could complete the full workflow of “parse the definition, generate code, and revise based on prompts.” However, this only shows that it had usable performance on this type of task. These results cannot be directly generalized to all programming tasks.

    2. Test Case and Scope

    The test had two inputs: a PDF brokerage research report defining a market-timing indicator called the “ICU moving average,” and a sample code snippet in Tonghuashun formula format that specified the output conventions. The model needed to extract the indicator definition from the research report, convert the definition into formula syntax, and record the execution process.

    Three limitations should be kept in mind when reading the results:

    • This article does not disclose the model’s name, version, sampling parameters, or tool permissions, so others cannot precisely reproduce the same conditions.
    • The original research report and the complete generated code are not publicly available; only textual descriptions of key steps are retained.
    • Each task was run through the full workflow only once. There was no repeated averaging, and there was no horizontal comparison with other models.

    Regarding reasoning methods, some models generate a reasoning draft before writing code, and implementations differ across vendors. This article did not verify the model’s internal mechanism, so it does not discuss structural details.

    3. Process and Observations

    3.1 Document Parsing

    The model located the indicator-definition paragraph in the PDF, interpreted the “ICU moving average” as some form of weighted-median processing on sequences related to the highest price and lowest price, and identified period parameters such as 5-day and 10-day. The value of this step lies in filtering out irrelevant paragraphs from a long document. This test did not run multiple times to verify that the model could locate the definition accurately every time.

    3.2 First Generation and Platform Compatibility Issue

    The logic of the first formula version matched the research report’s description, but it called the MEDIAN function. In the platform version used in this test, this function was unavailable, so the code could not execute. The error message pointed to that function, so locating the problem was not difficult.

    This shows that the model had limited knowledge of the specific software’s function library. It could not know which functions the platform supported and could only rely on the prompt.

    3.3 Correction After One Prompt

    The tester’s second prompt was: refer to the comment conventions in the sample file and use a platform-supported function to implement median calculation. Based on this, the model switched to a method using sorting plus quantile-point interpolation and completed the comments according to the sample format. The corrected code compiled successfully in the platform, and the generated indicator curve matched the research report’s illustration.

    The “match” here was the result of visual comparison; no point-by-point numerical validation was performed.

    3.4 Second Case

    The second case was a research report on a volume-price divergence signal. The algorithm included nested conditions, loops, and dynamic variables. In this run, the model’s first output had a correct control-flow structure. The tester recorded a total time of under one hour, but no baseline was set for a human completing the same task, so this article does not use it to estimate efficiency gains.

    4. Capability Performance: Stable and Weak Areas

    Stage Observation in this test Recommended practice
    Document location Could find the indicator-definition paragraph Mark page numbers or paragraphs manually first
    Formula conversion Logic was basically correct Check variables and period parameters line by line
    Platform functions Called a function not supported by the platform List available functions in the prompt
    Error correction Could correct the issue based on a clear error message Include the full original error text
    Design and front-end UI Not tested in this case No judgment

    In this case, the stage that most needed human intervention was platform adaptation. The business logic in the research report could be understood correctly, but the syntax and function library needed to be supplied by a human.

    5. Common Errors and Troubleshooting Checklist

    After generating code, check the following items one by one:

    • Whether the function exists in the target platform version.
    • Whether period parameters match the research report; for example, if the report says 5-day, the code should also use 5.
    • Whether variables are defined before use.
    • Whether the comment format matches the sample file.
    • Whether the output is complete executable code rather than a fragment.
    • Whether the graphical result aligns with the research report’s illustration; checking at least three time points is recommended.

    6. Task Breakdown and Prompt Template

    For complex requirements, it is advisable to split the task into two steps. In the first step, request only the core algorithm. After confirming the logic, handle the platform adaptation layer separately. Below is a prompt template that can be modified and used directly:

    1. Task: Implement the specified indicator based on the research-report excerpt below.
    2. Constraints:
    3. 1. Use only the following functions: [list the functions supported by the platform].
    4. 2. Implement any required statistic (such as the median) yourself, and explain the implementation method.
    5. 3. Follow the comment format in the example file.
    6. 4. Before output, check each item: whether variables are defined, and whether period parameters match the research report.
    7. Output: Complete executable code and a brief implementation note of no more than 100 words.

    7. Advice for Developers

    • Break complex requirements into verifiable modules: generate the core algorithm first, then handle platform adaptation.
    • When reporting an error, include the full error information. Saying only “the result is wrong” often does not help the model locate the problem.
    • For long-document tasks, perform summary extraction first to reduce interference from irrelevant paragraphs.
    • When placing the model into code review or automated repair workflows, retain a human confirmation step.

    8. Advice for Model Providers

    The following are general suggestions. This article’s test did not directly verify these directions:

    • Add specialized training data for function libraries and syntax rules in vertical industries such as finance and healthcare to reduce errors involving calls to nonexistent functions.
    • Support users in connecting custom document parsing or environment validation capabilities through standard interfaces.
    • Allow users to view the reasoning process to facilitate debugging and troubleshooting.

    9. Limitations and Next Steps

    This article covers only two financial indicator tasks. It cannot represent the model’s performance in front-end development, cross-project refactoring, or innovative algorithm design. To determine whether a model fits a team, it is advisable to run at least 20 samples from the team’s own task set, measure the first-pass rate and the number of correction rounds, and then decide whether to promote it.