Automating Weekend A-Share News Roundups and Trading Strategy Briefs

    This article walks through building an end-to-end pipeline that turns fragmented weekend news for the A-share market into a structured, ranked morning brief. It covers a unified event model for normalizing heterogeneous sources, a five-stage pipeline (collection, deduplication, structuring, scoring, generation), an explainable impact-scoring function, and the engineering and compliance practices needed to run it reliably and safely.

    1. Background: Why Weekend News Deserves an Engineered Pipeline

    For A-share investors, the weekend is a window of high-density information release. In one typical weekend, you might face four heterogeneous categories of news in a single evening:

    1. Industrial policy: a government department issues a guidance document on AI, laying out systematic arrangements around an “AI+” initiative, a tiered industrial layout across eastern, central, and western regions, new occupation development, and financial support for enterprises;
    2. Commodities: the international benchmark crude oil price touches above $117 intraday, up more than 6% in a single week, with geopolitical risk premium and low inventories reinforcing each other; some institutions offer tail estimates of $150 under an escalation scenario;
    3. Overseas central banks: a major central bank meeting is approaching, with rate futures implying a probability above 90% of holding rates steady, while more distant meetings still leave room for resuming hikes;
    4. Macro data: Q3 GDP year-over-year growth lands at the lower edge of the market’s expected range, with the structural divergence of “strong production and exports, weak domestic demand and investment” continuing.

    These four categories differ completely in source format, information granularity, and transmission path: policy documents are multi-thousand-word texts, commodity quotes are time series plus drivers, central bank expectations are probability distributions, and macro data are “actual vs. expected” comparison tables. The pain of manual work is obvious — sources are scattered, standards differ, the digestion window is a single night, and key details are easily buried by emotional headlines.

    The approach in this article is to treat “weekend news roundup + next-day trading strategy” as a data pipeline, broken into five stages: collection → deduplication → structuring → impact scoring → brief generation, each of which can be tested and evolved independently.

    2. Step One: Normalizing Heterogeneous News with a Unified Event Model

    The foundation of the pipeline is a unified event model. Whether the input is a full policy text or a one-line oil price alert, it must be normalized into a homogeneous structure before entering the analysis stage:

    1. from dataclasses import dataclass, field
    2. from datetime import datetime
    3. from enum import Enum
    4. from typing import List
    5. class EventCategory(Enum):
    6. POLICY = "policy" # Industrial policy
    7. COMMODITY = "commodity" # Commodities
    8. CB_MEETING = "cb_meeting" # Overseas central banks and rate expectations
    9. MACRO_DATA = "macro_data" # Macroeconomic data
    10. @dataclass
    11. class MarketEvent:
    12. event_id: str # Globally unique ID, for idempotency and deduplication
    13. source: str # Source channel code (anonymized)
    14. category: EventCategory
    15. published_at: datetime # Publish time, used for time decay
    16. title: str
    17. key_facts: List[str] = field(default_factory=list) # Short key fact sentences
    18. related_industries: List[str] = field(default_factory=list) # Industry mapping
    19. certainty: float = 0.0 # Certainty: 0 to 1
    20. sentiment: float = 0.0 # Direction and strength: -1 to 1

    Three design points are worth expanding on:

    • key_facts enforces compression. Each fact must be rewritten as a sentence of no more than 40 characters, forcing the extraction stage to distill information rather than copy the source. For example, a policy document line about “guiding central and western regions to take on upstream and downstream industries such as data annotation and intelligent terminal manufacturing” should be compressed into “policy guides AI upstream and downstream industries to shift westward in a tiered manner.”
    • certainty distinguishes facts from expectations. A policy already issued or data already published has certainty 1; meeting outcomes and geopolitical trajectories are future events, and their certainty should be converted from market-implied probability. For example, if rate futures imply a 90.6% probability of holding steady, that scenario’s certainty is 0.906, and the remaining ~9.4% hike scenario should be registered separately as a tail scenario.
    • sentiment is signed. The sign indicates direction relative to risk appetite (bullish/bearish), and the absolute value indicates strength, avoiding mixing “degree of bullishness” and “degree of bearishness” into one unsigned field.

    3. Step Two: End-to-End Pipeline Architecture

    The overall architecture has five layers, each with a single responsibility and a clear interface:

    1. Collection layer: pulls raw content through compliant channels such as public subscription feeds, official release channels, and market data interfaces. On weekends, use low-frequency scheduled jobs (e.g., one incremental crawl every 2 to 4 hours), which avoids pressure on target sites and saves downstream compute.
    2. Cleaning and deduplication layer: first performs exact deduplication on URL and title hashes, then uses locality-sensitive hashing algorithms such as SimHash and MinHash for near-duplicate body text. A single policy press release is often republished by dozens of channels, so deduplication significantly reduces downstream LLM calls — this is the first gate for cost control.
    3. Structuring layer: strongly structured messages such as quotes and macro data are handled with rule templates (regex plus field location), which are stable and cost nothing; long texts such as policy documents are sent to an LLM for extraction, producing JSON that conforms to the model above, with JSON Schema validation as a fallback, and validation failures automatically downgraded to a manual processing queue.
    4. Analysis layer: completes event classification, industry mapping, impact scoring, and association with similar historical events. For industry mapping, it is advisable to maintain a static knowledge table (mapping policy keywords to industry classifications), which is more stable and controllable than calling an LLM each time.
    5. Generation layer: renders a Markdown brief from a fixed template, then has an LLM do a single pass of language polishing, followed by manual review before pushing.

    On the deployment side, this pipeline has modest infrastructure requirements: object storage retains raw snapshots for audit and traceability, a message queue decouples the pace difference between collection and analysis, a container platform or function computing carries stateless parsing tasks, and logging plus monitoring and alerting ensure stability during unattended weekend hours.

    4. Step Three: Explainable Impact Scoring

    The goal of scoring is not to “predict price moves” but to prioritize information so reviewers see high-weight events first. A minimal viable scoring function:

    1. CATEGORY_WEIGHT = {
    2. EventCategory.POLICY: 0.9, # Policy has a large impact on overall risk appetite
    3. EventCategory.CB_MEETING: 0.8, # Overseas rate expectations affect global asset pricing
    4. EventCategory.COMMODITY: 0.7, # Commodities mainly affect the corresponding supply chain
    5. EventCategory.MACRO_DATA: 0.6, # Macro data matters through the expectation gap, not the absolute value
    6. }
    7. def time_decay(published_at: datetime, now: datetime,
    8. half_life_hours: float = 36.0) -> float:
    9. """The longer since publication, the more the weight decays by half-life"""
    10. hours = max(0.0, (now - published_at).total_seconds() / 3600)
    11. return 0.5 ** (hours / half_life_hours)
    12. def impact_score(event: MarketEvent, now: datetime) -> float:
    13. base = CATEGORY_WEIGHT[event.category]
    14. certainty = min(1.0, max(0.0, event.certainty))
    15. strength = abs(event.sentiment)
    16. return round(base * certainty * strength
    17. * time_decay(event.published_at, now), 4)

    The scoring design follows three principles:

    • Category weights reflect historical transmission strength. Policy and overseas central bank events have historically had a larger impact on overall market risk appetite, while commodities and macro data act more on specific sectors. The weights in the table are illustrative only and must be calibrated with historical event backtests before going live.
    • Certainty conversion. Strictly distinguish “may happen” from “has happened.” A “hold steady” meeting outcome is weighted at 0.906, while the tail scenario of a “25 basis point hike” has only about a 9.4% probability but a larger impact if realized, so it should be flagged as its own item rather than drowned out by the main scenario.
    • Time decay. News released after Friday’s close and news released late Sunday night have different marginal effects on Monday’s open; a half-life model captures this better than a one-size-fits-all cutoff.

    Macro data requires an additional expectation gap field: a GDP growth rate of 4.5% is itself a neutral number — “landing at the lower edge of the expected range” is what drives pricing. During extraction, capture the actual value, the consensus expectation, and the expected range together, and use the standardized deviation rather than the absolute value when scoring. Structural information such as a slowdown in M1 growth or slower fiscal spending should also be registered as independent facts for downstream logical linkage.

    5. Step Four: Brief Generation and Manual Review

    The generation logic is straightforward: sort by impact score, take the top N events, and render them grouped by category. Sample output:

    1. ## Weekend News Brief (auto-generated by the system, for reference only, not investment advice)
    2. ### 1. Policy and Industry
    3. - [Impact score 0.82] AI policy lands: clarifies the "AI+" initiative,
    4. tiered regional layout, and financial support for enterprises
    5. - Key facts: cultivate AI-native enterprises and "little giant" specialized
    6. SMEs; develop new AI occupations and improve title review and skill certification
    7. - Potentially related directions: AI core industry, data annotation, intelligent terminal manufacturing
    8. ### 2. Overseas Central Banks and Rates
    9. - [Impact score 0.77] Meeting approaching: rate futures imply about a 90.6%
    10. probability of holding steady; hikes remain possible at more distant meetings
    11. - Watch points: post-meeting tone, voting structure, changes in forward guidance wording
    12. ### 3. Commodities
    13. - [Impact score 0.71] International crude oil hits a stage high: geopolitical
    14. premium plus low inventories as dual drivers
    15. - Tail scenario: if the conflict escalates and key facilities are damaged,
    16. volatility could expand further
    17. ### 4. Macro Data
    18. - [Impact score 0.64] Q3 GDP growth at the lower edge of the expected range:
    19. production and exports strong, domestic demand and investment weak
    20. - Structural notes: M1 growth slowed and fiscal spending is slow, indicating
    21. weakness in both money activation and fiscal impulse

    The manual review step cannot be skipped. Reviewers focus on three things: first, whether key facts match the source, to prevent LLM hallucination; second, whether the impact scores are clearly distorted, for example incorrectly converting a policy that has already landed and has certainty 1; third, whether disclaimers and data source attribution are complete. Only after review passes is pushing allowed, with a full audit trail.

    6. Engineering and Compliance Notes

    On the engineering side:

    • Idempotent design: write to storage using event_id as the unique key, so rerunning a job does not produce duplicate briefs;
    • Rate limiting and backoff: apply client-side rate limiting to collection targets and retry failed requests with exponential backoff, avoiding triggering the other side’s risk controls;
    • Observability: treat collection success rate, parsing success rate, Schema validation pass rate, score distribution, and brief generation latency as core metrics, and alert on any anomaly;
    • Cost control: send long texts to the LLM only after deduplication; use a rule engine as a fallback for high-frequency simple fields, reserving model calls for the parts that truly need semantic understanding.

    On the compliance side:

    • Collect only information from public, lawful channels, and comply with target sites’ terms of access and rate limits;
    • Position system output as “information organization and decision support,” prominently label it “not investment advice,” and retain manual review before pushing;
    • Retain raw snapshots and processing logs for inspection, ensuring every conclusion can be traced back to a specific source and version.

    7. Summary

    Upgrading “weekend news roundup + trading strategy” from manual labor to an engineered system comes down to three steps: first normalize heterogeneous news with a unified event model, then quantify qualitative judgments with an explainable, backtestable scoring system, and finally safeguard accuracy and compliance with template-based generation plus manual review. The data model and scoring function given here are a minimal viable skeleton; in practice you can extend it with an industry knowledge base, historical event backtesting, personalized subscription delivery, and more. It is worth emphasizing that the tool solves an efficiency problem — it lets you see faster, before Monday’s open, “what happened, how certain it is, and what the market may focus on” — while the final investment decision should still rest on independent judgment about the information itself.