<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: qrak</title>
    <description>The latest articles on DEV Community by qrak (@qrak).</description>
    <link>https://dev.to/qrak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3687925%2Fbfcfb88c-523f-487e-a027-86a4b7ced803.png</url>
      <title>DEV Community: qrak</title>
      <link>https://dev.to/qrak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/qrak"/>
    <language>en</language>
    <item>
      <title>LLM TRADER BOT</title>
      <dc:creator>qrak</dc:creator>
      <pubDate>Wed, 29 Jul 2026 23:13:41 +0000</pubDate>
      <link>https://dev.to/qrak/llm-trader-bot-3625</link>
      <guid>https://dev.to/qrak/llm-trader-bot-3625</guid>
      <description>&lt;p&gt;Let me tell you a story about failure.&lt;/p&gt;

&lt;p&gt;Late 2024. I'm sitting in my Wrocław apartment after an 8-hour warehouse shift. My back hurts. I've been trying to make a trading bot work for two weeks. Every night, same result: the LLM generates beautiful-sounding analysis. Confident. Articulate. Completely wrong.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"RSI is 28, oversold. BUY."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Next morning: -4.2%.&lt;/p&gt;

&lt;p&gt;The problem wasn't the LLM being stupid. It was me being lazy. I was dumping numbers into a prompt and hoping for magic — the exact thing every "LLM trading bot" tutorial on YouTube tells you to do.&lt;/p&gt;

&lt;p&gt;I had three options: give up, buy a course, or do what nobody else was doing — read the actual research papers. I chose option three. 77 papers later, I understood the real problem. And I built something that fixes it.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Chart Vision — The LLM Reads Candlestick Images
&lt;/h2&gt;

&lt;p&gt;Every cycle, the bot generates a 4K PNG candlestick chart with 5 overlay indicators (SMA, RSI, Volume, CMF, OBV). This image goes directly to Google Gemini 3.6 Flash. Not as bytes. Not as a data URL. As a visual inference.&lt;/p&gt;

&lt;p&gt;I spent two weeks coding pattern detection algorithms — head and shoulders, wedges, trendlines. Then I compared the AI's visual reads against my code. The AI was better. By a lot. I deleted 900 lines of pattern detection code. Never looked back.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Bull vs Bear Debate — One Prompt, Two Sides
&lt;/h2&gt;

&lt;p&gt;TradingAgents spawns separate agents for bull and bear analysis. Smart, but each one costs an API call. My bot gives the LLM a single instruction: argue the bullish case first (with evidence), then argue the bearish case (with the same rigor). Then decide.&lt;/p&gt;

&lt;p&gt;One prompt. Both perspectives. Zero extra tokens. The model holds both arguments in context simultaneously — it can't "forget" the counter-argument halfway through.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. EV Framework — What Optiver Said LLMs Can't Do
&lt;/h2&gt;

&lt;p&gt;Optiver found LLMs can explain expected value but can't execute it. My EV Framework computes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Win rate from trade history, filtered by similarity to current setup&lt;/li&gt;
&lt;li&gt;Average win size vs average loss size&lt;/li&gt;
&lt;li&gt;Expected P&amp;amp;L = (win_rate × avg_win) - ((1 - win_rate) × avg_loss)&lt;/li&gt;
&lt;li&gt;Kelly fraction sizing based on account equity&lt;/li&gt;
&lt;li&gt;Risk/reward validation before signal acceptance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The LLM provides the reasoning. The EV Framework provides the math. If the LLM says "strong buy" but EV comes back negative — HOLD.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Falsification Check — Name the Price That Proves You Wrong
&lt;/h2&gt;

&lt;p&gt;Before any signal is accepted, the LLM must write one sentence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"This signal would be proven wrong if [specific price level or indicator condition] occurs."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If it can't name one — rejected. If the named condition triggers — position closed early. If the condition is vague — rejected, try again. This single prompt addition improved signal quality more than any other change.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Vector Memory — The Bot Remembers Its Mistakes
&lt;/h2&gt;

&lt;p&gt;Every closed trade gets embedded as a vector with 15+ metadata fields: symbol, direction, entry price, exit price, P&amp;amp;L percentage, max adverse excursion, timeframe, ADX at entry, trend strength, RSI, volume trend, pattern detected, news sentiment score, surprise ratio, and closed timestamp.&lt;/p&gt;

&lt;p&gt;On every new analysis cycle, the bot queries ChromaDB (now on &lt;strong&gt;BAAI/bge-base-en-v1.5 768D&lt;/strong&gt; embeddings): "Find me the 5 most similar trades to this current setup." These 5 trades are injected into the LLM prompt with their outcomes. Time-decay ensures recent trades carry 3x more weight than old ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Eight AI Agents Maintaining the Codebase
&lt;/h2&gt;

&lt;p&gt;In the &lt;code&gt;.ai/&lt;/code&gt; directory, eight specialized agent prompts — one Supervisor plus seven workers. Each has a dedicated scope, journal, and personality. They've produced real commits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Supervisor&lt;/strong&gt; — Routes work, scans codebase via vector search&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bolt&lt;/strong&gt; — Performance: found a sync file read in an async loop (40ms fix)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Palette&lt;/strong&gt; — UX: ARIA labels, toast notifications, collapsible panels&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sentinel&lt;/strong&gt; — Security: rate limiting, CSP headers, API key isolation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refactor&lt;/strong&gt; — Clean code: killed 27 isinstance chains, enforced DI pattern&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concise&lt;/strong&gt; — Code reduction: cut 380 lines across the prompt builder&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bugfixer&lt;/strong&gt; — Regressions: caught 3 bugs before they hit &lt;code&gt;main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smoke Tests&lt;/strong&gt; — Pre-flight: syntax, import scan, ruff lint before every commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;133 commits since the agent system was introduced. Every one tested. Every one documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Validation Pipeline — Never Trust Raw LLM Output
&lt;/h2&gt;

&lt;p&gt;Every AI response passes through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TrendValidator&lt;/strong&gt; — cross-checks LLM-reported trend against actual ADX calculations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PatternQualityScorer&lt;/strong&gt; — deterministic score from real detection, not self-reporting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Falsification Check&lt;/strong&gt; — reject signals that can't name their failure condition&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;6 Risk Guards&lt;/strong&gt; — symbol whitelist, max position, cooldown, min R:R, SL/TP validity&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Zero-Cost Sentiment — No API Keys
&lt;/h2&gt;

&lt;p&gt;Reddit JSON (free, no auth), X/Twitter via Nitter (public feeds), RSS from CoinDesk, CoinTelegraph, Decrypt, CryptoSlate — enriched via Crawl4AI. All processed through a RAG engine built on ChromaDB. No monthly bills. No API rate limits.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Test Suite
&lt;/h2&gt;

&lt;p&gt;1,324 tests. Fully mocked — no network, no ChromaDB, no LLM API. They run in about 60 seconds on any machine. Codacy CLI v2 + ruff for automated quality gates. AST-based codebase vector search for semantic navigation.&lt;/p&gt;

&lt;p&gt;Coverage includes: LLM output corruption, async race conditions, rate limiting with exponential backoff, vector DB boundaries, friction reporting for all 6 guard types, closed-loop feedback injection, ticker retry with network timeout handling.&lt;/p&gt;

&lt;p&gt;When Optiver says LLMs "fail to incorporate new information after acting" — my tests verify the bot doesn't do that. When the arXiv survey says reproducibility is the bottleneck — my tests are deterministic.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;☕ &lt;strong&gt;This project is 100% self-funded.&lt;/strong&gt; No company. No investors. Just a warehouse worker paying for servers and API keys. If this gave you an idea or saved you time — &lt;a href="https://www.buymeacoffee.com/qrak" rel="noopener noreferrer"&gt;Buy Me a Coffee&lt;/a&gt; helps keep it running. &lt;a href="https://qrak.org" rel="noopener noreferrer"&gt;qrak.org&lt;/a&gt; has more free content (AdSense-supported — every visit helps).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What It Costs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google Gemini 3.6 Flash: &lt;strong&gt;free tier&lt;/strong&gt; (1,500 requests/day)&lt;/li&gt;
&lt;li&gt;Technical indicators: &lt;strong&gt;CPU only&lt;/strong&gt; (Numba JIT, microseconds)&lt;/li&gt;
&lt;li&gt;News + Sentiment: &lt;strong&gt;free&lt;/strong&gt; (Reddit JSON, Nitter, RSS + Crawl4AI enrichment)&lt;/li&gt;
&lt;li&gt;Vector database: &lt;strong&gt;local ChromaDB&lt;/strong&gt;, BAAI/bge-base-en-v1.5 768D embeddings&lt;/li&gt;
&lt;li&gt;Hosting: &lt;strong&gt;home server&lt;/strong&gt; (Ryzen 5700G, 32 GB RAM)&lt;/li&gt;
&lt;li&gt;Dashboard: &lt;strong&gt;Cloudflare Tunnel&lt;/strong&gt; (free tier)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Month-to-month cost: &lt;strong&gt;0 zł&lt;/strong&gt;. Not "almost free." Free.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/qrak/LLM_trader.git
&lt;span class="nb"&gt;cd &lt;/span&gt;LLM_trader
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="nb"&gt;cp &lt;/span&gt;keys.env.example keys.env
python start.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dashboard at &lt;code&gt;localhost:8000&lt;/code&gt;. Windows users: &lt;code&gt;scripts/experimental_branch.ps1&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What this bot IS:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A research-grade, open-source LLM trading engine&lt;/li&gt;
&lt;li&gt;Paper trading only (real execution via separate CCXT service)&lt;/li&gt;
&lt;li&gt;Fully transparent — every prompt, response, and trade log is inspectable&lt;/li&gt;
&lt;li&gt;Self-improving through reflection engine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What it's NOT:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A get-rich-quick scheme&lt;/li&gt;
&lt;li&gt;A production trading system (yet)&lt;/li&gt;
&lt;li&gt;Something you should trust with real money without extensive testing&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/qrak/LLM_trader" rel="noopener noreferrer"&gt;github.com/qrak/LLM_trader&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Dashboard:&lt;/strong&gt; &lt;a href="https://semanticsignal.qrak.org" rel="noopener noreferrer"&gt;semanticsignal.qrak.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Landing Page:&lt;/strong&gt; &lt;a href="https://qrak.org" rel="noopener noreferrer"&gt;qrak.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buy Me a Coffee:&lt;/strong&gt; &lt;a href="https://www.buymeacoffee.com/qrak" rel="noopener noreferrer"&gt;buymeacoffee.com/qrak&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email:&lt;/strong&gt; &lt;a href="mailto:contact@qrak.org"&gt;contact@qrak.org&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built in Wrocław, Poland. No degree. No bootcamp. Just Python, asyncio, and thousands of hours after warehouse shifts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;☕ Support:&lt;/strong&gt; &lt;a href="https://www.buymeacoffee.com/qrak" rel="noopener noreferrer"&gt;buymeacoffee.com/qrak&lt;/a&gt; — every coffee = real API calls&lt;br&gt;&lt;br&gt;
&lt;strong&gt;📊 Live:&lt;/strong&gt; &lt;a href="https://semanticsignal.qrak.org" rel="noopener noreferrer"&gt;semanticsignal.qrak.org&lt;/a&gt; — watch it trade in real time&lt;br&gt;&lt;br&gt;
&lt;strong&gt;📚 More:&lt;/strong&gt; &lt;a href="https://qrak.org" rel="noopener noreferrer"&gt;qrak.org&lt;/a&gt; — research, articles, free resources (AdSense-supported)&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Stop Trading Like It's 1999 — I Built an Autonomous, Vision-Capable Crypto Bot with Python 3.13</title>
      <dc:creator>qrak</dc:creator>
      <pubDate>Wed, 29 Jul 2026 22:22:34 +0000</pubDate>
      <link>https://dev.to/qrak/-stop-trading-like-its-1999-an-llm-crypto-bot-that-sees-charts-remembers-trades-and-learns-1cd1</link>
      <guid>https://dev.to/qrak/-stop-trading-like-its-1999-an-llm-crypto-bot-that-sees-charts-remembers-trades-and-learns-1cd1</guid>
      <description>&lt;p&gt;Let me tell you a story about failure.&lt;/p&gt;

&lt;p&gt;December 2024. I'm sitting in my Wrocław apartment after an 8-hour warehouse shift. My back hurts. I've been trying to make a trading bot work for two weeks. Every night, same result: the LLM generates beautiful-sounding analysis. Confident. Articulate. Completely wrong.&lt;/p&gt;

&lt;p&gt;"RSI is 28, oversold. BUY." Next morning: -4.2%.&lt;/p&gt;

&lt;p&gt;The problem wasn't the LLM being stupid. It was me being lazy. I was dumping numbers into a prompt and hoping for magic — the exact thing every "LLM trading bot" tutorial on YouTube tells you to do.&lt;/p&gt;

&lt;p&gt;I had three options: give up, buy a course, or do what nobody else was doing — read the actual research papers.&lt;/p&gt;

&lt;p&gt;I chose option three. 77 papers later, I understood the real problem. And I built something that fixes it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Research Rabbit Hole
&lt;/h2&gt;

&lt;p&gt;Here's what 77 academic papers and industry reports taught me about LLM trading:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TradingAgents&lt;/strong&gt; (UCLA/MIT, 95k GitHub stars) — brilliant framework. Multi-agent debate, specialized analyst roles. But three dealbreakers: stocks only (no crypto), zero chart vision (raw numbers only), and every analysis costs 5+ API calls. Beautiful architecture, expensive to run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optiver's 2026 research&lt;/strong&gt; — LLMs pass their intern trading exam. They understand EV. They can explain market making. But when it's time to actually execute? They freeze. Too conservative. Leave money on the table. The gap between understanding EV and maximizing EV is where real trading lives — and LLMs fail there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agentic Trading Survey&lt;/strong&gt; (arXiv 2026) — 77 studies reviewed. Only 2 had proper time-consistent data splits. Zero reached reproducibility level R3. Most academic LLM trading papers are architecturally impressive PowerPoint slides with cherry-picked backtests. Try running their code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lopez-Lira at Bank of Finland&lt;/strong&gt; — LLM agents can trade. But they don't give a damn about losing money unless you explicitly program them to care. They'll follow losing instructions straight to zero, smiling in their probabilistic way the whole time.&lt;/p&gt;

&lt;p&gt;So I asked: what if one bot fixed all of this? Chart vision for pattern recognition. EV computation from real history. Falsification checks that reject hallucinated signals. Vector memory that remembers every trade outcome. And bull/bear debate that costs zero extra API calls.&lt;/p&gt;

&lt;p&gt;That's what I built. Here's exactly how.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Chart Vision — The LLM Reads Candlestick Images
&lt;/h2&gt;

&lt;p&gt;Every cycle, the bot generates a 4K PNG candlestick chart with 5 overlay indicators (SMA, RSI, Volume, CMF, OBV). This image goes directly to Google Gemini 3.6 Flash. Not as bytes. Not as a data URL. As a visual inference.&lt;/p&gt;

&lt;p&gt;Why? Because I spent two weeks coding pattern detection algorithms — head and shoulders, wedges, trendlines, support/resistance. Then I compared the AI's visual reads against my code. The AI was better. By a lot.&lt;/p&gt;

&lt;p&gt;I deleted 900 lines of pattern detection code. Never looked back.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. 50+ Indicators, JIT-Compiled Locally
&lt;/h2&gt;

&lt;p&gt;No pandas-ta. No TA-Lib. I built the entire indicator engine from scratch using NumPy and Numba. Every EMA, SMA, MACD, ADX, Stochastic, Bollinger Band, TTM Squeeze, Ichimoku component, and 11 moving average variants compiles to machine code on first call and caches the result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@njit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_ema_numba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;period&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;period&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty_like&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;50 indicators. All custom. All JIT-compiled. All running in microseconds on a CPU. No CUDA. No cloud. Just a Ryzen 5700G on my desk.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Bull vs Bear Debate — One Prompt, Two Sides, Zero Extra Cost
&lt;/h2&gt;

&lt;p&gt;TradingAgents spawns separate agents for bull and bear analysis. Smart, but each one costs an API call. My bot gives the LLM a single instruction: argue the bullish case first (with evidence from the chart, indicators, and news), then argue the bearish case (with the same rigor). Then decide.&lt;/p&gt;

&lt;p&gt;One prompt. Both perspectives. Zero extra tokens. The result is less biased because the model has to hold both arguments in context simultaneously — it can't "forget" the counter-argument halfway through.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. EV Framework — What Optiver Said LLMs Can't Do
&lt;/h2&gt;

&lt;p&gt;Optiver found LLMs can explain expected value but can't execute it. My EV Framework computes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Win rate from trade history (filtered by similarity to current setup)&lt;/li&gt;
&lt;li&gt;Average win size vs average loss size&lt;/li&gt;
&lt;li&gt;Expected P&amp;amp;L = (win_rate × avg_win) — ((1 — win_rate) × avg_loss)&lt;/li&gt;
&lt;li&gt;Kelly fraction sizing based on account equity&lt;/li&gt;
&lt;li&gt;Risk/reward validation before signal acceptance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The LLM provides the reasoning. The EV Framework provides the math. Neither trusts the other blindly. If the LLM says "strong buy" but EV comes back negative — HOLD.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Falsification Check — Name the Price That Proves You Wrong
&lt;/h2&gt;

&lt;p&gt;Before any signal is accepted, the LLM must write one sentence: "This signal would be proven wrong if [specific price level or indicator condition] occurs."&lt;/p&gt;

&lt;p&gt;If it can't name one — signal rejected. If the named condition triggers before the next cycle — position closed early. If the named condition is vague ("if the market turns bearish") — rejected, try again with specificity.&lt;/p&gt;

&lt;p&gt;This single prompt addition improved signal quality more than any other change. Hallucinated signals can't produce falsifiable claims.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. ChromaDB Vector Memory — The Bot Remembers Its Mistakes
&lt;/h2&gt;

&lt;p&gt;Every closed trade gets embedded as a vector with 15+ metadata fields:&lt;/p&gt;

&lt;p&gt;symbol, direction, entry price, exit price, P&amp;amp;L percentage, max adverse excursion, timeframe, ADX at entry, trend strength, RSI, volume trend, pattern detected, news sentiment score, surprise ratio, and closed timestamp.&lt;/p&gt;

&lt;p&gt;On every new analysis cycle, the bot queries: "Find me the 5 most similar trades to this current setup." These 5 trades are injected into the LLM prompt with their outcomes. The AI sees real results from similar past conditions.&lt;/p&gt;

&lt;p&gt;Time-decay ensures recency matters: a trade from last week carries 3x more weight than one from two months ago, even if the indicators look identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Seven AI Agents that Maintain Their Own Codebase
&lt;/h2&gt;

&lt;p&gt;In the .ai directory you'll find seven specialized agent prompts. Each has a dedicated scope, a journal, and a personality. They've produced real commits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bolt (performance): Found a sync file read in an async loop — 40ms latency fix&lt;/li&gt;
&lt;li&gt;Palette (UX): Added ARIA labels, toast notifications, collapsible panels&lt;/li&gt;
&lt;li&gt;Sentinel (security): Rate limiting middleware, CSP headers, API key isolation&lt;/li&gt;
&lt;li&gt;Refactor (clean code): Killed 27 isinstance chains, enforced DI pattern across 14 modules&lt;/li&gt;
&lt;li&gt;Concise (code reduction): Reduced 380 lines across the prompt builder&lt;/li&gt;
&lt;li&gt;Bugfixer (regressions): Caught 3 bugs before they hit main — verified by reading ALL journals&lt;/li&gt;
&lt;li&gt;Smoke Tests (pre-flight): Syntax check, import scan, and ruff lint before every commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;133 commits since the agent system was introduced. Every one of them tested and documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Validation Pipeline — Never Trust Raw LLM Output
&lt;/h2&gt;

&lt;p&gt;Every AI response passes through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TrendValidator: cross-checks LLM-reported trend strength against actual ADX calculations. Discrepancy over 15 points — computed value wins&lt;/li&gt;
&lt;li&gt;PatternQualityScorer: deterministic 0-100 score from actual pattern detection, not LLM self-reporting&lt;/li&gt;
&lt;li&gt;Falsification Check: reject signals that can't name their own failure condition&lt;/li&gt;
&lt;li&gt;Risk Guards: symbol whitelist, max position size, cooldown window, minimum risk/reward, SL/TP validity, wrong-side SL/TP detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  9. Zero-Cost Sentiment — No API Keys, No Paid Services
&lt;/h2&gt;

&lt;p&gt;Reddit JSON (free, no auth needed), X/Twitter through Nitter instances (public feeds), RSS from CoinDesk, CoinTelegraph, Decrypt, CryptoSlate. All processed through a RAG engine built on ChromaDB. No monthly bills. No API rate limits. Just free internet data, curated.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Test Suite (The Part Nobody Talks About)
&lt;/h2&gt;

&lt;p&gt;1,324 tests. Fully mocked — no network calls, no ChromaDB, no LLM API. They run in about 60 seconds on any machine.&lt;/p&gt;

&lt;p&gt;Coverage includes: LLM output corruption, async race conditions, rate limiting with exponential backoff, vector DB boundaries, friction reporting for all 6 guard types, closed-loop feedback injection, ticker retry with network timeout handling.&lt;/p&gt;

&lt;p&gt;When Optiver says LLMs "fail to incorporate new information after acting" — my tests verify the bot doesn't do that. When the arXiv survey says reproducibility is the bottleneck — my tests are deterministic.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Costs to Run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google Gemini 3.6 Flash: free tier (1,500 requests/day)&lt;/li&gt;
&lt;li&gt;Technical indicators: CPU (Numba JIT, microseconds)&lt;/li&gt;
&lt;li&gt;News and Sentiment: free (Reddit JSON, Nitter, RSS)&lt;/li&gt;
&lt;li&gt;Vector database: local ChromaDB (~50 MB disk, ~200 MB RAM)&lt;/li&gt;
&lt;li&gt;Hosting: home server (Ryzen 5700G, 32 GB RAM)&lt;/li&gt;
&lt;li&gt;Dashboard: Cloudflare Tunnel (free tier)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Month-to-month cost: exactly 0 zł. Not "almost free." Free.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/qrak/LLM_trader.git
&lt;span class="nb"&gt;cd &lt;/span&gt;LLM_trader
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="nb"&gt;cp &lt;/span&gt;keys.env.example keys.env
python start.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dashboard at &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;. Windows users: run scripts/experimental_branch.ps1.&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;p&gt;What this bot IS: a research-grade, open-source LLM trading engine. Paper trading only. Fully transparent — every prompt, response, and trade log is inspectable. Self-improving through reflection engine.&lt;/p&gt;

&lt;p&gt;What it's NOT: a get-rich-quick scheme, a production trading system (yet), or something you should trust with real money without extensive testing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;Source: github.com/qrak/LLM_trader&lt;br&gt;
Live Dashboard: semanticsignal.qrak.org&lt;br&gt;
Landing Page: qrak.org&lt;br&gt;
Buy Me a Coffee: buymeacoffee.com/qrak&lt;br&gt;
Email: &lt;a href="mailto:contact@qrak.org"&gt;contact@qrak.org&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Built in Wroclaw, Poland. No degree. No bootcamp. Just Python, asyncio, and thousands of hours after warehouse shifts.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>crypto</category>
    </item>
    <item>
      <title>Stop Trading Like It's 1999: I Built an Autonomous, Vision-Capable Crypto Bot with Python 3.13 🚀</title>
      <dc:creator>qrak</dc:creator>
      <pubDate>Wed, 31 Dec 2025 22:35:28 +0000</pubDate>
      <link>https://dev.to/qrak/stop-trading-like-its-1999-i-built-an-autonomous-vision-capable-crypto-bot-with-python-313-3110</link>
      <guid>https://dev.to/qrak/stop-trading-like-its-1999-i-built-an-autonomous-vision-capable-crypto-bot-with-python-313-3110</guid>
      <description>&lt;p&gt;`&lt;strong&gt;How I "Vibe Coded" an asyncio-first trading engine that bridges the gap between technical indicators and human-scale market context.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the world of algorithmic trading, we've been stuck in a loop. We rely on RSI, MACD, and Bollinger Bands—mathematical formulas designed for an era before high-frequency sentiment and global AI reasoning. While these indicators are foundational, they are blind to context.&lt;/p&gt;

&lt;p&gt;A human trader doesn't just buy because an RSI hits 30. They look at the shape of the wedge, they read the fear in the headlines, and they interpret the "vibe" of the order book.&lt;/p&gt;

&lt;p&gt;I wanted to build a bot that doesn't just calculate—it &lt;strong&gt;reasons&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Meet &lt;strong&gt;LLM_Trader v2&lt;/strong&gt;: An autonomous, vision-capable trading engine that turns market data, news, and chart context into structured BUY/SELL/HOLD/UPDATE decision.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhif0932el6m1ra9u66l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhif0932el6m1ra9u66l.png" alt="LLM Trader Dashboard" width="800" height="501"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;LLM_Trader v2 in action.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Architecture: A "Brain" for the Markets
&lt;/h2&gt;

&lt;p&gt;Most AI bots fail because they simply dump raw numbers into a prompt. LLM_Trader v2 uses a sophisticated multi-stage pipeline designed for &lt;strong&gt;confluence&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Muscles (Market Data):&lt;/strong&gt; Using &lt;code&gt;ccxt&lt;/code&gt;, the bot aggregates data from 5+ major exchanges (Binance, KuCoin, Gate.io, MEXC, Hyperliquid). But it doesn't stop at price—it analyzes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Technical Indicators:&lt;/strong&gt; (Custom engine, built from scratch without &lt;code&gt;pandas-ta&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;  Order book depth &amp;amp; spread analysis.&lt;/li&gt;
&lt;li&gt;  Trade flow (Buy/Sell ratio, trade velocity).&lt;/li&gt;
&lt;li&gt;  Funding rates for perpetual futures.&lt;/li&gt;
&lt;li&gt;  OHLCV across 7 timeframes: 4H, 12H, 24H, 3D, 7D, 30D, 365D.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Eyes (Vision Engine):&lt;/strong&gt; The bot renders a ~150 candlestick chart using Plotly, optimized for AI pattern recognition. This image is sent directly to Vision models (Gemini Flash) for visual pattern analysis—because sometimes, a chart pattern is worth a thousand RSI readings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Ears (RAG Engine):&lt;/strong&gt; Real-time news via CryptoCompare, processed with &lt;code&gt;wtpsplit&lt;/code&gt; for neural sentence segmentation. The bot extracts key facts and numbers, filtering noise to give the LLM a "ground truth" of current events—not just headlines, but data-rich sentences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Brain (Model Manager):&lt;/strong&gt; All this context—textual data, visual charts, news snippets, and market metrics—is orchestrated by a model manager that toggles between Google Gemini, Claude (via OpenRouter), or local models via LM Studio.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  🧠 From "Chat" to "Execution": The PositionExtractor
&lt;/h3&gt;

&lt;p&gt;(New Feature in v2)&lt;br&gt;
The magic isn't just in the prompt—it's in the parsing. I built a robust &lt;code&gt;PositionExtractor&lt;/code&gt; that doesn't just "guess" what the AI wants. It uses standardized REGEX patterns to consistently extract:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Action&lt;/strong&gt;: BUY / SELL / HOLD / CLOSE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence&lt;/strong&gt;: HIGH / MEDIUM / LOW (mapped to position sizing)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rationale&lt;/strong&gt;: A structured explanation that is logged for future "Trading Brain" learning.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📊 What the AI Actually Sees (Real Example)
&lt;/h2&gt;

&lt;p&gt;Here's a glimpse of what gets sent to the AI for a single analysis cycle:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`yaml&lt;br&gt;
TRADING CONTEXT:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Symbol: BTC/USDC&lt;/li&gt;
&lt;li&gt;Current Price: $87,499&lt;/li&gt;
&lt;li&gt;Fear &amp;amp; Greed Index: 24 (Extreme Fear) - 7 day history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MARKET OVERVIEW:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total Market Cap: $3.88T | BTC Dominance: 56.52%&lt;/li&gt;
&lt;li&gt;Order Book Imbalance: +0.180 (Moderate Buy Pressure)&lt;/li&gt;
&lt;li&gt;Buy/Sell Ratio: 0.16 (Strong Selling)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TECHNICAL ANALYSIS (4h):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RSI: 46.65 | MACD Histogram: +112.46&lt;/li&gt;
&lt;li&gt;ADX: 12.86 | Stochastic: 60.02/73.78&lt;/li&gt;
&lt;li&gt;Death Cross Active (20 SMA &amp;lt; 50 SMA)&lt;/li&gt;
&lt;li&gt;TTM Squeeze: Extreme Low Volatility&lt;/li&gt;
&lt;li&gt;Volume Spike: 2.55x average&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;WEEKLY MACRO (200W SMA):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trend: Bullish (100% confidence)&lt;/li&gt;
&lt;li&gt;Cycle Phase: Early Bull Market&lt;/li&gt;
&lt;li&gt;Distance from 200W SMA: +46.2%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DETECTED PATTERNS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MACD bull cross 9 bars ago&lt;/li&gt;
&lt;li&gt;Stochastic bull cross in oversold (12 bars ago)&lt;/li&gt;
&lt;li&gt;MACD Bullish Divergence (64 bars ago)&lt;/li&gt;
&lt;li&gt;Volume spike 2.55x average (NOW)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NEWS CONTEXT:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Bitcoin Soars Past $89,000 Milestone..."&lt;/li&gt;
&lt;li&gt;"Crypto Shorts Liquidated: $64M Wiped Out..."
`&lt;code&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI synthesizes all of this—plus a chart image and its previous analysis—into a structured JSON decision with confluence scoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Multi-Model Intelligence &amp;amp; Local Privacy
&lt;/h2&gt;

&lt;p&gt;One of the biggest upgrades in v2 is &lt;strong&gt;Provider Resilience&lt;/strong&gt;. If Google's API is down, the bot automatically falls back to OpenRouter. If you want 100% privacy, it connects to LM Studio, allowing you to run the entire reasoning layer on your own hardware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Currently supported models:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Any model with Google API (Flash, Pro, 2.5, 3.0)&lt;/li&gt;
&lt;li&gt;  Any model (preferred vision models) via OpenRouter&lt;/li&gt;
&lt;li&gt;  Any local model via LM Studio&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧬 Persistent Learning: The Trading Brain
&lt;/h2&gt;

&lt;p&gt;Here's where it gets interesting. LLM_Trader v2 doesn't just trade—it learns. After every closed trade, the bot analyzes its performance and distills lessons into a persistent &lt;code&gt;TradingBrain&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Confidence Calibration:&lt;/strong&gt; Tracks win rates by confidence level. If "HIGH confidence" trades have a 0% win rate, the AI sees this and adjusts.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Distilled Insights:&lt;/strong&gt; Stores lessons like "SL too tight (1.4%) caused early exit. Consider 1.5–2% minimum in Sideways + Weak Trend + Low Vol."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Factor Performance:&lt;/strong&gt; Tracks which confluence factors (volume support, trend alignment) correlate with wins.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Time Decay:&lt;/strong&gt; Recent insights weighted higher (0.95 per week), so the bot adapts to changing regimes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feedback loop means the bot genuinely improves over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  📡 Discord Integration (Already Live)
&lt;/h2&gt;

&lt;p&gt;Real-time signals delivered straight to your Discord server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trade notifications (BUY/SELL/CLOSE with reasoning)&lt;/li&gt;
&lt;li&gt;Position status updates&lt;/li&gt;
&lt;li&gt;Message tracking for cleanup&lt;/li&gt;
&lt;li&gt;Configurable via &lt;code&gt;config.ini&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚙️ The Tech Stack
&lt;/h2&gt;

&lt;p&gt;Built with an &lt;strong&gt;"Asyncio-First"&lt;/strong&gt; approach in Python 3.13:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Language:&lt;/strong&gt; Python 3.13 (asyncio-first)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Data Aggregation:&lt;/strong&gt; ccxt (5+ exchanges)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Charting:&lt;/strong&gt; Plotly + Kaleido&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical Indicators:&lt;/strong&gt; Custom engine with numpy, pandas, numba, scipy&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;NLP/Segmentation:&lt;/strong&gt; wtpsplit (backed by torch)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Market Data:&lt;/strong&gt; CoinGecko API (global metrics, dominance, DeFi)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Sentiment:&lt;/strong&gt; Fear &amp;amp; Greed Index (7-day history) (alternative.me)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Persistence:&lt;/strong&gt; JSON-based Trading Brain&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Notifications:&lt;/strong&gt; Discord.py&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Get Started (Open Source &amp;amp; Beta)
&lt;/h2&gt;

&lt;p&gt;The project is in BETA and configured for Paper Trading. Watch the bot make decisions without risking a dollar.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clone &amp;amp; Install&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
git clone https://github.com/qrak/LLM_trader.git&lt;br&gt;
cd LLM_trader&lt;br&gt;
python -m venv .venv&lt;br&gt;
source .venv/bin/activate  # or .venv\Scripts\Activate.ps1&lt;br&gt;
pip install -r requirements.txt&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configure Your Keys&lt;/strong&gt;&lt;br&gt;
Copy &lt;code&gt;keys.env.example&lt;/code&gt; to &lt;code&gt;keys.env&lt;/code&gt; and add your API keys (Google AI, OpenRouter, CryptoCompare, CoinGecko).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Customize Your Strategy (config.ini)&lt;/strong&gt;&lt;br&gt;
The bot is fully configurable via &lt;code&gt;config/config.ini&lt;/code&gt;. You can switch AI providers, change timeframes, or enable/disable Discord integration without touching the code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`ini&lt;br&gt;
[ai_providers]&lt;/p&gt;
&lt;h1&gt;
  
  
  Options: "local", "googleai", "openrouter", "all"
&lt;/h1&gt;

&lt;p&gt;provider = googleai&lt;/p&gt;
&lt;h1&gt;
  
  
  Base URL for local LM Studio instance
&lt;/h1&gt;

&lt;p&gt;lm_studio_base_url = &lt;a href="http://localhost:1234/v1" rel="noopener noreferrer"&gt;http://localhost:1234/v1&lt;/a&gt;&lt;br&gt;
lm_studio_model = local-model&lt;/p&gt;
&lt;h1&gt;
  
  
  OpenRouter
&lt;/h1&gt;

&lt;p&gt;openrouter_base_url = &lt;a href="https://openrouter.ai/api/v1" rel="noopener noreferrer"&gt;https://openrouter.ai/api/v1&lt;/a&gt;&lt;br&gt;
openrouter_base_model = google/gemini-2.0-flash-exp:free&lt;/p&gt;
&lt;h1&gt;
  
  
  Google AI Studio
&lt;/h1&gt;

&lt;p&gt;google_studio_model = gemini-3-flash-preview&lt;/p&gt;

&lt;p&gt;[general]&lt;br&gt;
crypto_pair = BTC/USDC&lt;br&gt;
timeframe = 4h&lt;br&gt;
candle_limit = 999&lt;br&gt;
ai_chart_candle_limit = 150&lt;br&gt;
discord_bot = false&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Launch the Engine&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
python start.py&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  💬 Join the Community
&lt;/h2&gt;

&lt;p&gt;Trading is better with friends (and more AI).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/qrak/LLM_trader" rel="noopener noreferrer"&gt;github.com/qrak/LLM_trader&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Discord:&lt;/strong&gt; Join our &lt;a href="https://discord.gg/ZC48aTTqR2" rel="noopener noreferrer"&gt;Development Chat&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: This software is for educational purposes. Crypto trading involves high risk. Always paper trade first.&lt;/em&gt;&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>python</category>
      <category>cryptocurrency</category>
    </item>
    <item>
      <title>Elevating Crypto Communities: How I Combined Discord and AI for Real-Time Market Intelligence 📊🤖</title>
      <dc:creator>qrak</dc:creator>
      <pubDate>Wed, 31 Dec 2025 22:32:16 +0000</pubDate>
      <link>https://dev.to/qrak/elevating-crypto-communities-how-i-combined-discord-and-ai-for-real-time-market-intelligence-5h36</link>
      <guid>https://dev.to/qrak/elevating-crypto-communities-how-i-combined-discord-and-ai-for-real-time-market-intelligence-5h36</guid>
      <description>&lt;p&gt;`&lt;br&gt;
Managing a crypto community is a full-time job. Between the "When Moon?" questions and the "Is BTC dumping?" panic, community admins are often overwhelmed. &lt;/p&gt;

&lt;p&gt;What if you could give your members access to a professional-grade technical analyst that never sleeps, never gets emotional, and can visually analyze charts in seconds?&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;DiscordCryptoAnalyzer&lt;/strong&gt; to bridge this gap—a powerful, vision-powered bot that turns any Discord channel into a high-octane research lab.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Why This Isn't Just "Another Discord Bot"
&lt;/h2&gt;

&lt;p&gt;Most market bots just spit out a price or a simple RSI number. &lt;strong&gt;DiscordCryptoAnalyzer&lt;/strong&gt; takes a fundamentally different approach. It uses &lt;strong&gt;Vision Models&lt;/strong&gt; (like Gemini Flash) to "see" the market the way a human does.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Visual Pattern Recognition
&lt;/h3&gt;

&lt;p&gt;When a user types &lt;code&gt;!analyze BTC/USDT&lt;/code&gt;, the bot doesn't just look at numbers. It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetches real-time candles from Binance or KuCoin.&lt;/li&gt;
&lt;li&gt;Renders a high-resolution Plotly chart with support/resistance levels and pivot points.&lt;/li&gt;
&lt;li&gt;Sends that &lt;strong&gt;actual image&lt;/strong&gt; to an AI vision model.&lt;/li&gt;
&lt;li&gt;The AI identifies "head and shoulders," "wedges," and "breakouts" visually, providing a reasoning that humans can verify on the spot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjip67099lcsud4dogqw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjip67099lcsud4dogqw9.png" alt="Chart Example 1" width="644" height="854"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Short json message in action&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Multi-Timeframe Context
&lt;/h3&gt;

&lt;p&gt;The bot doesn't judge a coin by a single candle. It analyzes context across 1h, 4h, and 12h timeframes simultaneously to detect trend strength and divergence. &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Community Engagement Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Educational References:&lt;/strong&gt; Technical terms in the analysis automatically link to definitions, helping community members learn as they trade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multilingual Support:&lt;/strong&gt; The bot can provide analysis in English, Polish, Spanish, and more, making it perfect for global crypto groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Reports:&lt;/strong&gt; Along with the Discord summary, it generates a full interactive HTML report for deep-dive research. You can see a &lt;a href="https://github.com/qrak/DiscordCryptoAnalyzer/blob/main/example_html/BTCUSDT_analysis_202512310928_googleai_gemini-3-flash-preview.html" rel="noopener noreferrer"&gt;live example of an BTC/USDT analysis report here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhbwi2eq2yo67tv50wgq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhbwi2eq2yo67tv50wgq.png" alt="Chart Example 2" width="800" height="423"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Detailed technical breakdown and AI rationale.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ The Tech Behind the Bot
&lt;/h2&gt;

&lt;p&gt;Built for speed and flexibility, the bot features a &lt;strong&gt;user-configurable AI orchestration layer&lt;/strong&gt;. Through &lt;code&gt;config.ini&lt;/code&gt;, users have total control over the intelligence level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single Provider Mode:&lt;/strong&gt; Lock the bot to a specific provider like Google Gemini (GenAI SDK), OpenRouter, or local LM Studio for maximum control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback Chain ("All"):&lt;/strong&gt; Enable a resilient fallback system (Google AI → LM Studio → OpenRouter) to ensure the bot continues operating even if a primary API hits a rate limit or goes offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vision Optimization:&lt;/strong&gt; Specifically tuned for vision-capable models (e.g., &lt;code&gt;gemini-1.5-flash-latest&lt;/code&gt;) to ensure visual patterns are accurately extracted.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚡ Performance &amp;amp; Engineering: It's Not Just a Script
&lt;/h3&gt;

&lt;p&gt;What makes this bot truly "production-ready" isn't just the AI—it's the robust architecture behind it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Numba Acceleration (Custom Engine)&lt;/strong&gt;&lt;br&gt;
We didn't just import &lt;code&gt;pandas-ta&lt;/code&gt;. We built our own indicator engine from scratch using &lt;strong&gt;Native NumPy + Numba JIT&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Why?&lt;/em&gt; Standard libraries are bloated. Our custom &lt;code&gt;@njit(cache=True)&lt;/code&gt; implementations for EMA, SMA, and overlap indicators calculate in &lt;strong&gt;microseconds&lt;/strong&gt;, ensuring the bot handles high-frequency message spikes without blocking the asyncio event loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Smart Anti-Spam &amp;amp; Role Management&lt;/strong&gt;&lt;br&gt;
Community health is as important as signals. The bot includes a custom &lt;code&gt;AntiSpam&lt;/code&gt; cog that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;code&gt;commands.CooldownMapping&lt;/code&gt; to track user message frequency bucket-style.&lt;/li&gt;
&lt;li&gt;Automatically assigns a configurable "Muted" role to spammers.&lt;/li&gt;
&lt;li&gt;Cleans up its own tracking references (&lt;code&gt;_cleanup_user_tracking&lt;/code&gt;) to prevent memory leaks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Layered Agent Architecture&lt;/strong&gt;&lt;br&gt;
The codebase follows a strict &lt;strong&gt;Instruction Hierarchy&lt;/strong&gt; (referenced in &lt;code&gt;AGENTS.md&lt;/code&gt;), separating the "Brain" (&lt;code&gt;AnalysisEngine&lt;/code&gt;), "Muscles" (&lt;code&gt;DiscordCryptoBot&lt;/code&gt;), and "Eyes" (&lt;code&gt;Plotly&lt;/code&gt;). This makes it easy for other developers to contribute without breaking the core logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 Global Scale
&lt;/h3&gt;

&lt;p&gt;Straight out of the box, the bot supports &lt;strong&gt;8 languages&lt;/strong&gt; (English, Polish, Spanish, French, Chinese, etc.), configurable via &lt;code&gt;config.ini&lt;/code&gt;. It automatically adapts its technical analysis explanations to the user's local language.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧪 Try It Live
&lt;/h2&gt;

&lt;p&gt;I've set up a dedicated environment where you can test the bot's features right now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Join the Lab:&lt;/strong&gt; &lt;a href="https://discord.gg/ZC48aTTqR2" rel="noopener noreferrer"&gt;Discord Invitation Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/qrak/DiscordCryptoAnalyzer" rel="noopener noreferrer"&gt;qrak/DiscordCryptoAnalyzer&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏁 Join the Future of Market Research
&lt;/h2&gt;

&lt;p&gt;AI is changing the way we interpret data. By bringing high-level reasoning directly into the social hub of crypto—Discord—we're making institutional-grade analysis accessible to everyone.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you found this useful, feel free to star the repo or join our development chat!&lt;/em&gt;&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>gemini</category>
      <category>showdev</category>
      <category>ai</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
