← Systems & Data

Trading Signal Platform

A deployed stock-signal platform — one analysis engine behind a web app, a Telegram bot, and portfolio/risk tools.

Role
Solo — full-stack engineering
Year
2026
Stack
FastAPI · Python · scikit-learn (KNN) · Plotly · Clerk · APScheduler · DeepSeek · SQLite · Hetzner
TL;DR

A stock-signal platform I built and run: MACD/RSI/Volume signals with KNN forecasting and AI news analysis, plus portfolio, risk, and trading-journal tools. One analysis engine feeds three surfaces — a web app (primary, deployed on Hetzner, multi-user), a Telegram bot, and an older desktop client. Nothing exotic under the hood; the value is that it's a real, shipped, full-stack product.

Commercial project — selected details only. Architecture and results are shown; proprietary code and data are not.

What it is

A stock-signal platform I built and run. It computes technical-indicator signals (MACD, RSI, Volume) with KNN forecasting and AI-powered news analysis, and wraps them in portfolio, risk, and trading-journal tools. One analysis engine feeds three surfaces — a web app (the primary interface, deployed on Hetzner and multi-user), a Telegram bot, and an older desktop client.

I’ll be straight about it: there’s no exotic technology here. The models are standard and the ideas are well-known. What makes it worth showing is that it’s a real, shipped, full-stack product — the breadth, and the fact that it actually runs.

One engine, three surfaces

The design that holds it together is a single analysis engine behind a few delivery surfaces:

  • a FastAPI REST API (Clerk JWT auth) that the web frontend calls,
  • a Telegram bot for alerts and on-demand queries,
  • an APScheduler service running interval and daily jobs,

with persistence split across three SQLite databases (news, computed caches, and per-user data). The same signals, forecasts, and news therefore show up identically on the web and in Telegram.

Signals & forecasting

  • Signals — a bullish MACD crossover only fires when supporting conditions hold: MACD stayed below the signal line for N days, RSI isn’t overbought, and volume is above average.
  • KNN forecast — after a signal fires, expected profitability is estimated from the nearest historical analogues (features: indicators on the day plus market context like SPY and VIX).
  • Pre-signal scan — a KNN pass over all tickers 1–2 days before a likely crossover builds an “upcoming signals” list.
  • Dynamic exit — a daily KNN re-evaluation of open positions gives a hold-or-exit recommendation.
  • ATR stops — a standalone ATR indicator computes stop-loss and risk levels, and accepts a custom entry price for personalized levels.

These are deliberately simple models. The engineering is in wiring them into something consistent, cached, and usable — not in the algorithms themselves.

AI news pipeline

Articles are collected (Finnhub, yfinance), stored with fuzzy de-duplication, then scored for relevance and impact by a DeepSeek LLM, which also writes summaries. From there the system pushes per-ticker (micro) and market-wide (macro) alerts to Telegram, using peer and sector maps to support macro-impact and peer analysis.

The web app

The primary, actively developed surface — a dark, widget-based dashboard: a signal board with filters, interactive Plotly charts (candles/line with signals and crossovers overlaid), company cards with AI news, an earnings table, a portfolio view, ATR-based risk management, and a trading journal. Widgets are draggable and resizable with saved layouts and pop-out windows, and it’s multi-user via Clerk auth with per-user watchlists and data.

The Telegram bot

Push alerts for new signals, micro and macro news, and earnings; on-demand commands (/forecast, /news, /macro, /status, …); authorization by chat_id with rate limiting; and scheduled jobs such as a morning digest.

Running it

It’s deployed on a Hetzner server, where the API, bot, and scheduler run alongside each other and share the analysis engine and databases. An older PyQt6 desktop build mirrors an earlier version of the web UI but isn’t maintained — new features land on the web first, and often only there.