Quant Trading Bot Devlog

한국어로 보기

Building a Korean Stock Quant Bot Solo - Project Architecture (Updated)

This is the English version of a post originally written in Korean. See the Korean original and other posts(new tab).

This is a personal quant trading system that runs on a single desktop at home. There's no separate server — one CPU and one graphics card handle everything (swapped to a different brand's single card on 2026-08-17; before that it was two cards of the same brand, split across layers).

A lot has changed since I first wrote about this project, so here I'm just re-summarizing the big picture. The details of each piece have been moved out to their own posts, linked below.

Three axes

This project splits into three parts that differ in character.

  1. The trading bot — connected to a real account, where actual money moves. When the price drifts past a certain band from the target weight, it proposes a trade over Telegram, and once I approve it, the order goes out.
  2. The fully automated verification track — separate from the trading bot, this verifies a track that keeps trading on AI judgment alone, without human approval, on a paper trading account.
  3. The AI recommendation pipeline — several models analyze stocks and send reference-only reports. It doesn't auto-trade with real money; it just keeps a running record of whether the recommendations turned out right.

I kept these separate because I didn't want to treat logic backed by real capital, logic verifying full automation without capital at risk, and still-experimental reference-only logic with the same level of trust.

Architecture diagram

User (Telegram)
│
├─ Trading bot (real account, approval-based auto-investing)
│   ├─ Broker Open API integration
│   ├─ Price-band monitoring + AI signal-strength-based auto-investing
│   ├─ Auto-cancel safeguard for orders unfilled too long
│   └─ Public-disclosure-based risk-stock monitoring overlay (observation stage)
│
├─ Fully automated verification track (paper account, always-on auto-trading without approval)
│   └─ Executes the AI recommendation pipeline's judgments with fake money, continuously verifying it
│
└─ AI recommendation pipeline (reference only, no auto-trading)
    │
    ├─ Ranking engine (every 2 hours during market hours + deep research nightly)
    │   ├─ Quant desk (LightGBM)        — statistical patterns in structured data like price/volume
    │   ├─ Flow desk (Transformer)      — trends and regime shifts over time
    │   ├─ Research desk (TradingAgents) — multi-agent LLM that reads news/disclosures/fundamentals like a human and writes reports
    │   └─ A consensus engine that combines the rankings from the three "desks" above (see below)
    │
    ├─ Real-time monitoring (every 5 minutes)
    │   └─ Urgent alerts for sharp moves/disclosures + anomaly scanning across all tickers
    │
    └─ Report generation
        ├─ Regular model reports (internal/shareable split + data-freshness indicator)
        └─ Performance tracker — matches recommendations against actual returns and keeps a running record

(The core processes are all registered as OS services, so they keep running even if my dev environment is off or crashes)

Component breakdown

Trading bot

I set target portfolio weights, and when the actual weight drifts past a certain band, I get a Telegram notification. Once I approve it, the order goes out as-is.

There have been some changes here recently. The polling that constantly checked bands was too frequent, so I turned it off. Alongside a broker migration, I've fully locked the old broker's scheduled rebalancing. Instead, on the new broker's path, I've walked through every situation that matters for real trading with real money, one at a time — normal orders, rejection handling, the recovery path for ambiguous failures, partial fills, and settlement.

I've written up the design of these safeguards in a separate post(new tab).

I recently added one more safeguard. It's a monitor that automatically detects risk signals — like an audit opinion issue or a stock being flagged for administrative designation — based on publicly disclosed facts, and sends an alert and flags it in the report. It's still observation-only for now, not blocking trades automatically; I plan to decide whether to actually filter on it once I've accumulated enough grounds for that judgment.

There's also something I tried and dropped. I tested an idea for extending the allocation approach on a paper ledger, but concluded that at this account's size the judgment itself isn't even measurable, so I dropped it the same day I started.

Fully automated verification track

Separate from the trading bot, I'm also running a track on a paper trading account that keeps trading on AI judgment alone, without human approval. The goal is to confirm — without any real loss risk — whether this judgment could someday be fully entrusted with real money too.

While running this track, I found a problem where a meaningful chunk of cash kept sitting unbought. The cause was a calculation that would abandon a buy proposal entirely if it slightly exceeded the limit; I fixed it by keeping the limit itself unchanged but switching from "reject if over" to "just buy up to the limit."

I've written up the details in a separate post(new tab).

The AI ensemble — how consensus gets built

The core of this pipeline isn't any single model — it's how the judgments of three desks with different perspectives (quant/flow/research) get collected into a ranked table and turned into consensus. Why it combines by rank rather than by score, and why I've deliberately kept the method simple, I've written up as a narrative in a separate post(new tab).

Making it run reliably

I split what used to be one script doing everything into separate processes registered as OS services, split the report into internal/shareable versions, and separated recommendation performance from execution losses — all written up in a separate post(new tab).

Side project: data archive

A side project that started as archiving old stock news has grown into an umbrella project that now also collects stock-discussion-board sentiment, intraday minute-level prices, investor-type trading flow, and order-book data.

I recently added a stream that collects public statements from figures who can move the market. This isn't meant to become a trading signal — it's purely for observation and record-keeping, to later verify whether these statements actually preceded price moves.

The common thread across all of it is that it's perishable data — if I don't capture it now, I won't be able to get it later at all. Most of it is still just being collected for now; I've covered the details in a separate post(new tab).

Side project: network watcher

I once had an incident where the home Wi-Fi sat in a half-broken state for over half a day, unnoticed. That prompted me to build a small monitoring program that notices network problems instead of me, and even attempts self-recovery — kept completely separate from the main system, in both code and runtime environment.

It's now armed for automatic recovery, not just observation, but fortunately nothing that severe has happened again, so it hasn't actually triggered in production yet. I've covered the details in a separate post(new tab).

Side project: backups

Separate from the core logic, I found a dangerous hole in the infrastructure — all the code and data I'd built up were sitting on a single disk with no backup at all. If the data itself were lost, every judgment built on top of it would become meaningless too, so I fixed it.

Now code and configuration are kept in version control, and data that can't be recreated gets backed up automatically to a separate disk every day. I also added monitoring that catches not just "the backup failed" but "the backup silently stopped altogether." As a hedge against the worst case — the same disk becoming entirely unusable — I also upload an encrypted copy to the cloud.

I've covered the details in the devlog(new tab).

Wrapping up

Right now I'm carefully widening the trading bot's live-trading scope from a very small starting point, while verifying the same judgment fully automatically on a paper account. The AI recommendation pipeline itself remains reference-only.

I'll post updates here occasionally as things change.