DEV Community

ULNIT
ULNIT

Posted on • Originally published at github.com

"I Built an AI Trading Signal System for Chinese Stocks — It Runs on a $35 Pi"

I Built an AI Trading Signal System for Chinese Stocks — It Runs on a $35 Pi

Last week, 36kr (China's TechCrunch) ran a headline that stopped me mid-scroll:

"AI Trading Competition Results Are In: Only Chinese AI Is Making Money. Bet Against GPT-5."

That's when I realized — the AI + finance gold rush isn't happening on Wall Street. It's happening on the A-share market.

So I built something.

What It Does

Every trading day at 4 PM Beijing time, a Python script wakes up on my $35 Raspberry Pi, pulls live data from Sina Finance, runs it through an analysis engine, and generates a structured trading signal report.

No Bloomberg Terminal. No $2,000/month data feed. No AWS bill. Just:

  • Sina Finance JS API (free, no API key required)
  • Python stdlib (zero dependencies)
  • Raspberry Pi ($35, runs 24/7)
# That's the entire data pipeline
INDICES = {
    "上证指数": "sh000001",
    "深证成指": "sz399001",
    "创业板指": "sz399006",
    "科创50": "sh000688",
    "沪深300": "sh000300"
}

def fetch(codes):
    url = f"https://hq.sinajs.cn/list={','.join(codes)}"
    # ... fetch and parse
Enter fullscreen mode Exit fullscreen mode

What It Covers

Category Coverage Count
📈 Major Indices Shanghai Composite, Shenzhen Component, ChiNext, STAR 50, CSI 300 5
🔥 Hot Sectors AI, Semiconductors, New Energy, Pharma, Consumer Electronics, Robotics 8
⚡ Key Stocks Kweichow Moutai, CATL, BYD, SMIC, Cambricon, iFlytek, Inspur, Sugon 9

A Sample Signal

Here's what a real output looks like:

📊 Sentiment: Bearish 🔴
📈 Shanghai 4068.57 (-0.73%) | Shenzhen 15575.13 (-1.81%)
🔥 Strongest: Pharma (+2.38%)
❄️ Weakest: Semiconductors (-5.84%)
📊 Rotation: Capital flowing from semiconductors → pharma

🎯 Signals:
  [HOLD] ★★★ Cash/Reverse Repo — Broad sell-off, recommend wait
  [ROTATE] ★★ CSI 300 — Watch secondary strength sectors
Enter fullscreen mode Exit fullscreen mode

The engine computes sentiment (bullish/bearish/neutral), identifies sector rotation patterns, and generates actionable signals — all from raw price data with no external AI API calls.

The Architecture

Sina Finance API (free, real-time)
         ↓
  Python Scraping Engine
  (5 indices + 8 sectors + 9 stocks)
         ↓
    AI Analysis Engine
  (sentiment + rotation + momentum)
         ↓
    Daily Report (Markdown + JSON)
         ↓
  Subscription Distribution ($29-99/month)
Enter fullscreen mode Exit fullscreen mode

Why Chinese A-Shares?

Three reasons this market is uniquely suited for AI-driven signals:

1. Retail Dominance

Over 80% of A-share trading volume comes from retail investors. That means more noise, more overreactions, more exploitable patterns. AI thrives in chaos.

2. Free Data

Sina Finance provides real-time quotes via a simple HTTP API. No registration. No rate limits. No billing. Try getting that from Yahoo Finance or Bloomberg.

3. The Great Rotation

Chinese markets are undergoing a historic sector rotation — from real estate/old economy to AI/semiconductors/clean energy. The momentum signals are massive and measurable.

The $0 InfrastructureStack

This is the part that still feels like cheating:

Component Cost
Data Source $0 (Sina Finance)
Compute $0 (Raspberry Pi, owned)
Storage $0 (local Markdown files)
Distribution $0 (GitHub Pages)
AI/ML $0 (rule-based engine)
Total Monthly $0.00

The entire product runs on a device that costs less than dinner for two.

The Business Model

I'm monetizing through tiered subscriptions:

  • Free Tier: Daily market overview + 1 signal → FREE
  • Pro Tier: Full signals + sector rotation + stock picks → $29/month
  • VIP Tier: Pro + real-time alerts + 1-on-1 consultation → $99/month

All payments via PayPal.me — no Stripe integration, no payment processing fees, no recurring billing infrastructure to maintain.

Market Validation

This isn't just a hobby project. The signals are real:

  • 36kr headline: "Only Chinese AI is making money" (May 2026)
  • API resale market: Revenue up 1,134% YoY
  • WAIC 2025: Top question was "How do I use AI to make money?"

The demand for AI-powered financial intelligence in China is exploding — and the barrier to entry (free data, cheap compute, Python) has never been lower.

What I Learned Building This

1. Free data is everywhere — if you know where to look

Most developers assume financial data requires expensive APIs. Sina Finance, East Money, and other Chinese platforms provide free, real-time data with no registration. The trick is knowing the endpoints.

2. You don't need ML for useful signals

The analysis engine is pure heuristics — sentiment from breadth indicators, rotation from sector relative strength, signals from momentum and volume. No TensorFlow. No GPU. No training data. And it works.

3. Simplicity sells

The report is a Markdown file. The distribution is GitHub Pages. The payment is a PayPal link. Users don't need to install anything, sign up for anything, or learn a new platform. They get a link and a file.

Try It Yourself

git clone https://github.com/ulnit/ai-trading-signals
cd ai-trading-signals
python3 src/engine.py

# Outputs: reports/report_YYYYMMDD.md + reports/report_YYYYMMDD.json
Enter fullscreen mode Exit fullscreen mode

The entire codebase is open source. Fork it, modify it, sell it — MIT License.

What's Next

I'm building an entire portfolio of AI products this way — all running on the same $35 Pi:

  • 🎬 AI Video Factory — automated YouTube content pipeline
  • 🔌 AI API Gateway — resell GPT-4o and Claude access
  • 🛠️ AI Agent Toolkit — CLI tools for AI developers (pip install ai-agent-toolkit)
  • 🎯 Bug Bounty Automation Kit — automated recon and vuln scanning

View the full product stack →


Disclaimer: AI trading signals are for research purposes only. They do not constitute investment advice. Markets involve risk — invest cautiously.

Built with Python ❤️ · Running on a $35 Raspberry Pi · 24/7 Automated

Top comments (0)