Stop Trading Like It's 1999: I Built an Autonomous, Vision-Capable Crypto Bot with Python 3.13 š
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āÆ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.
- Technical Indicators ā custom engine built from scratch (no
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
wtpsplitfor 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
- Discord: Join our Development Chat
Disclaimer: This software is for educational purposes. Crypto trading involves high risk. Always paperātrade first.
