Quantitative Research Agent for China A-Shares: Announcement Sentiment Factors and Research Reporting

    A reproducible quantitative research pipeline combines rule-based processing and large language models to evaluate announcement sentiment factors and generate traceable research reports. This article covers seven-node orchestration, six-table data lineage, deterministic numerical validation, and an ablation test that found no incremental contribution from the sentiment factor in the tested dataset and split.

    1. Define the Problem First

    Many quantitative research projects fail not because their models are too simple, but because their objectives are unclear. This project, focused on China’s A-share equity market, narrows the task to four questions:

    1. How can a manual research workflow become a repeatable system, rather than a collection of one-off scripts?
    2. Does an announcement sentiment factor actually change the strategy’s net asset value over the sample period?
    3. How can LLM-generated research reports be made traceable and independently verifiable?
    4. How should negative findings be reported honestly, without dressing them up?

    The implementation combines a general-purpose scripting language, a graph-based workflow orchestration framework, a gradient-boosted tree model, and an interface compatible with widely used LLM API protocols. Together, these support a dual-mode pipeline: rules and LLMs.

    The design deliberately avoids dependence on any particular vendor. Cloud infrastructure uses only general service categories: object storage, message queues, container platforms, logging, and monitoring and alerts.

    2. Seven-Node Orchestration: Turn the Workflow into a State Machine

    The workflow consists of seven nodes connected by an explicit state object. A failed node can be rerun independently.

    1. Ingestion → Cleaning and Alignment → Sentiment Scoring → Factor Construction
    2. → Model Prediction → Portfolio Backtesting → Reporting and Validation
    • Ingestion: Retrieve raw announcements, market data, and financial data, store them in object storage, and register a batch ID.
    • Cleaning and alignment: Standardize trading calendars, price-adjustment conventions, and announcement disclosure timestamps to prevent look-ahead bias.
    • Sentiment scoring: In rule mode, use a lexicon, negation words, and intensity modifiers. In LLM mode, produce structured labels.
    • Factor construction: Neutralize sentiment factors against industry and market capitalization, treat outliers, and standardize values.
    • Model prediction: Run five-fold cross-validation with a gradient-boosted tree model and output cross-sectional ranking scores.
    • Portfolio backtesting: Construct net asset value curves using portfolio grouping or weighting.
    • Reporting and validation: Generate report text and validate its numerical claims.

    Illustrative code:

    1. state = {"batch": bid, "mode": "rule"}
    2. for node in ["ingest","align","sentiment","factor","model","backtest","report"]:
    3. state = NODES[node](state) # Pure-function nodes support unit testing
    4. persist(state) # Persist to six tables for traceability
    5. if state.get("error"):
    6. state["mode"] = "rule" # Fall back to rule mode

    3. Six Tables and a Fact Allowlist

    Traceability requires every number to have an identifiable source. Six tables store:

    1. Original announcements and metadata
    2. Detailed sentiment scores
    3. A wide-format factor table
    4. Model predictions
    5. Backtest net asset values
    6. Reports and validation records

    The tables are linked through batch ID, security code, and date.

    A fact allowlist restricts report numbers to approved fields, such as net asset value, annualized performance, maximum drawdown, information coefficient (IC), area under the ROC curve (AUC), and sample row count. Every numerical claim must carry its source table and primary key. The model is not allowed to calculate metrics on its own.

    4. Build Numerical Validation into the Pipeline

    Generated reports are not published immediately. They first pass a deterministic validation step:

    1. def verify(report, facts):
    2. for claim in extract_numbers(report):
    3. if claim.value != facts[claim.key].value: # Exact comparison, no fuzzy tolerance
    4. return {"pass": False, "diff": claim}
    5. return {"pass": True}

    If validation fails, the pipeline falls back to rule mode to rewrite the report and records the discrepancy details. This blocks hallucinated numbers before publication, rather than relying on people to discover them afterward.

    5. Results: Report Negative Findings Honestly

    For the tested sample and data split:

    • Mean five-fold AUC: 0.5024, close to random performance
    • IC: 0.0086, indicating weak correlation
    • Final net asset value: 0.8456

    In the ablation experiment, removing the sentiment factor produced a row-by-row difference of 0.0 across all 254 net asset value rows. In other words, the factor made no incremental contribution within this sample.

    An honest report presents the metrics first, then the ablation results, and finally states that the conclusion applies only to this dataset and split. It should neither generalize beyond that scope nor substitute a different sample period to make the results look better.

    The value of this negative result is that it demonstrates an operational end-to-end pipeline, effective validation, and a reproducible conclusion.

    6. Limitations and Next Steps

    The current limitations include a single data source, a single temporal split, and no extended transaction-cost sensitivity analysis.

    Next steps include running multiple batches in parallel on a general-purpose container platform, using logging and monitoring alerts to track node failure rates, and expanding the manually labeled sentiment dataset to improve the rule-based baseline.