The Problem
Every trader has been here: you're staring at a candlestick chart, trying to figure out if that's a Head and Shoulders forming or just noise. You flip between three indicator panels, check RSI, squint at the MACD histogram, and still aren't sure.
I wanted a tool where I could just screenshot a chart and get a structured breakdown — patterns detected, trend direction, confidence scores, and what to watch next. No manual drawing, no subjective interpretation.
So I built KlineVision.
What It Does
Upload any K-line (candlestick) chart screenshot — A-shares, US stocks, crypto, anything — and KlineVision returns:
- Classic Pattern Detection — Head & Shoulders, Bullish Engulfing, Morning Star, Flags, Triangles, and 70+ more patterns with confidence scores
- Chan Theory Analysis (缠论) — Bi (笔), Duan (线段), Zhongshu (中枢), and Beichi (背驰) structure detection. If you trade Chinese markets, you know how powerful this is
- Trend Judgment — Bullish / Bearish / Sideways with strength and confidence
- Trading Signals — Contextual buy/sell/watch signals with risk notes
- Bilingual Output — Full analysis in both English and Chinese
The analysis is powered by Google Gemini's vision model with a carefully crafted prompt that enforces structured JSON output.
The Tech Stack
Next.js 16 (App Router, TypeScript)
├── EODHD + Tushare (market data)
├── Supabase (auth + PostgreSQL)
├── Stripe (subscriptions)
├── SVG K-line renderer (server-side, zero deps)
└── 11-locale i18n (en/zh/ja/ko/es/fr/de/pt/ru/ar/hi)
A few things I'm proud of:
Pure SVG K-Line Renderer
Server-rendered candlestick charts that crawlers can see (no Canvas/WebGL). I wrote a pure TypeScript SVG string generator — zero native dependencies, works in Vercel Serverless. It draws candlesticks, MA lines, volume bars, pattern highlights, and annotations, all as SVG XML strings.
Each page has real data — historical win rates, T+5/10/20 return statistics, recent detection cases — not LLM-generated fluff. The pattern detection runs a rule-based engine on actual OHLCV data from EODHD and Tushare.
11-Language Support
Every page renders in 11 languages with proper hreflang tags. Entity content (pattern names, descriptions, FAQs) is stored as L10n objects:
name:
en: "Bullish Engulfing"
zh: "看涨吞没"
ja: "強気の包み足"
ko: "상승 장악형"
# ...
Translation is done via Gemini batch API (~$0.15 for all entities × 9 languages).
The prompt is the secret sauce — it forces Gemini to output a strict JSON schema with confidence scores, bilingual explanations, and explicit "what I can't determine from this image" sections. No hallucinated price targets.
Pattern Detection Pipeline
Beyond the screenshot analysis, there's a daily data pipeline:
- Fetch — Pull OHLCV data from EODHD (US/A-shares) and Tushare (HK)
- Detect — Rule-based engine scans for 10 candlestick patterns (Hammer, Engulfing, Doji, Morning/Evening Star, etc.)
- Backfill — Calculate T+5/10/20 returns for historical detections
- Compute — MACD, RSI, Bollinger Bands snapshots for each stock
- Aggregate — Win rate statistics at global/market/symbol level
Try It
- Upload a chart: klinevision.ai
- Browse patterns: klinevision.ai/patterns
- Check a stock: klinevision.ai/stocks/us/AAPL
- Scan for patterns: klinevision.ai/scanner/doji/us
The core analysis feature is free. I'd love feedback from anyone who trades or is interested in technical analysis.
What's Next
- More chart patterns in the rule engine (currently 10, targeting 30+)
- Multi-timeframe confirmation (daily + 4h + 1h)
- Real-time pattern alerts via Telegram
- Hong Kong market expansion (Tushare rate limits are... fun)
Top comments (1)
The split between the rule-based engine for actual pattern detection and the Gemini vision layer for screenshot analysis is interesting. You're basically running two parallel truth-finding systems and letting one annotate the other. The vision model isn't doing the real math—it's acting as an interface translator between "squiggly lines on an image" and "structured data the pipeline already knows how to process."
What I find myself wondering is where the ground truth lives in this setup. The OHLCV data is deterministic. The pattern engine is deterministic. Gemini's interpretation of the screenshot is probabilistic and occasionally wrong. So the vision analysis becomes a kind of UX affordance rather than the source of truth. The real analysis already happened server-side before the user even uploaded anything, and the LLM is just narrating it back in a way that matches what the user thinks they're asking for.
That's not a criticism. It's actually quite clever. It sidesteps the hallucination problem by anchoring the LLM's output to a schema that's already been populated by deterministic calculation. The "what I can't determine" section in the prompt is doing a lot of heavy lifting as a safety valve.
Makes me think about other domains where you could use this pattern: LLM as natural language interface to a system that already computed the answer hours ago, and just needs to present it in a context the user understands. The hard part is making the user feel like the analysis is happening in real time, when really they're just triggering a retrieval.
How often do you run into drift between what the vision model claims it sees and what the backend actually computed? Or does the prompt structure mostly keep it in line?