Stop Trading Like It's 1999: I Built an Autonomous, Vision-Capable Crypto Bot with Python 3.13 šŸš€

Published: (December 31, 2025 at 05:35 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Meet LLM_Trader v2

An autonomous, vision‑capable trading engine that turns market data, news, and chart context into structured BUY / SELL / HOLD / UPDATE decisions.

LLM Trader Dashboard

LLM_Trader v2 in action.

šŸ—ļø The Architecture: A ā€œBrainā€ for the Markets

Most AI bots fail because they simply dump raw numbers into a prompt. LLM_Trader v2 uses a sophisticated multi‑stage pipeline designed for confluence.

The Muscles (Market Data)

  • Aggregates data from 5+ major exchanges (Binance, KuCoin, Gate.io, MEXC, Hyperliquid) via ccxt.
  • Analyzes:
    • Technical Indicators – custom engine built from scratch (no pandas‑ta).
    • Order‑book depth & spread.
    • Trade flow (buy/sell ratio, trade velocity).
    • Funding rates for perpetual futures.
    • OHLCV across 7 timeframes: 4 h, 12 h, 24 h, 3 d, 7 d, 30 d, 365 d.

The Eyes (Vision Engine)

  • Renders a ~150‑candlestick chart with Plotly, optimized for AI pattern recognition.
  • Sends the image directly to vision models (Gemini Flash) for visual pattern analysis—because sometimes a chart pattern is worth a thousand RSI readings.

The Ears (RAG Engine)

  • Pulls real‑time news via CryptoCompare.
  • Processes with wtpsplit for neural sentence segmentation.
  • Extracts key facts and numbers, filtering noise to give the LLM a ā€œground truthā€ of current events—not just headlines, but data‑rich sentences.

The Brain (Model Manager)

  • Orchestrates textual data, visual charts, news snippets, and market metrics.
  • Toggles between Google Gemini, Claude (via OpenRouter), or local models via LM Studio.

🧠 From ā€œChatā€ to ā€œExecutionā€: The PositionExtractor (New Feature in v2)

The magic isn’t just in the prompt—it’s in the parsing. PositionExtractor uses standardized regex patterns to consistently extract:

  • Action – BUY / SELL / HOLD / CLOSE
  • Confidence – HIGH / MEDIUM / LOW (mapped to position sizing)
  • Rationale – Structured explanation logged for future ā€œTrading Brainā€ learning.

šŸ“Š What the AI Actually Sees (Real Example)

Below is a snapshot of what gets sent to the AI for a single analysis cycle:

TRADING CONTEXT:
  - Symbol: BTC/USDC
  - Current Price: $87,499
  - Fear & Greed Index: 24 (Extreme Fear) – 7‑day history

MARKET OVERVIEW:
  - Total Market Cap: $3.88T | BTC Dominance: 56.52%
  - Order Book Imbalance: +0.180 (Moderate Buy Pressure)
  - Buy/Sell Ratio: 0.16 (Strong Selling)

TECHNICAL ANALYSIS (4h):
  - RSI: 46.65 | MACD Histogram: +112.46
  - ADX: 12.86 | Stochastic: 60.02/73.78
  - Death Cross Active (20 SMA

Disclaimer: This software is for educational purposes. Crypto trading involves high risk. Always paper‑trade first.

Back to Blog

Related posts

Read more Ā»

The RGB LED Sidequest šŸ’”

markdown !Jennifer Davishttps://media2.dev.to/dynamic/image/width=50,height=50,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%...

Mendex: Why I Build

Introduction Hello everyone. Today I want to share who I am, what I'm building, and why. Early Career and Burnout I started my career as a developer 17 years a...