<?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: yuhang chen</title>
    <description>The latest articles on DEV Community by yuhang chen (@yuhang_chen_969a8b10adae9).</description>
    <link>https://dev.to/yuhang_chen_969a8b10adae9</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3700054%2F58bd0f2c-fb36-46f4-ad70-1f06db1f1391.png</url>
      <title>DEV Community: yuhang chen</title>
      <link>https://dev.to/yuhang_chen_969a8b10adae9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yuhang_chen_969a8b10adae9"/>
    <language>en</language>
    <item>
      <title>[Open Source] A super powerful AI-Agent quantitative trading tool: QuantDinger</title>
      <dc:creator>yuhang chen</dc:creator>
      <pubDate>Sun, 25 Jan 2026 18:43:24 +0000</pubDate>
      <link>https://dev.to/yuhang_chen_969a8b10adae9/open-source-a-super-powerful-ai-agent-quantitative-trading-tool-quantdinger-2303</link>
      <guid>https://dev.to/yuhang_chen_969a8b10adae9/open-source-a-super-powerful-ai-agent-quantitative-trading-tool-quantdinger-2303</guid>
      <description>&lt;p&gt;The AI ​​quantitative trading platform, developed over six months, has been officially open-sourced under the Apache 2.0 license, making it commercially usable.&lt;br&gt;
The platform supports all major markets: US stocks, A-shares, Hong Kong stocks, cryptocurrencies, forex, and futures.&lt;br&gt;
It's a viable alternative to TradingView, capable of AI-driven strategy development and indicator plotting on candlestick charts.  It also supports a multi-user version and one-click deployment via local Docker.&lt;br&gt;
Demo address: &lt;a href="https://ai.quantdinger.com" rel="noopener noreferrer"&gt;https://ai.quantdinger.com&lt;/a&gt;&lt;br&gt;
GitHub address: &lt;a href="https://github.com/brokermr810/QuantDinger" rel="noopener noreferrer"&gt;https://github.com/brokermr810/QuantDinger&lt;/a&gt;&lt;br&gt;
If you find it useful, please give us a star! Your support is our motivation for improvement. We are also recruiting like-minded project administrators to manage the repository and build an open-source community together!&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%2Fb1p8liqvktihz07acbj1.jpeg" 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%2Fb1p8liqvktihz07acbj1.jpeg" alt=" " width="800" height="943"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>QuantDinger: Build, Backtest, and Trade with AI – An Open-Source, Local-First Quant Platform in Python</title>
      <dc:creator>yuhang chen</dc:creator>
      <pubDate>Sat, 24 Jan 2026 18:12:13 +0000</pubDate>
      <link>https://dev.to/yuhang_chen_969a8b10adae9/quantdinger-build-backtest-and-trade-with-ai-an-open-source-local-first-quant-platform-in-5fpn</link>
      <guid>https://dev.to/yuhang_chen_969a8b10adae9/quantdinger-build-backtest-and-trade-with-ai-an-open-source-local-first-quant-platform-in-5fpn</guid>
      <description>&lt;p&gt;Feeling good today ~&lt;br&gt;
QuantDinger just hit another small milestone:  Officially partnered with the Indiana University Quantitative Finance Society (QFS)! Grateful for their support — together pushing quant finance education and nurturing the next gen of quants&lt;br&gt;&lt;br&gt;
Added global financial market monitoring to the dashboard — now you can scan crypto, US/HK stocks, forex, commodities in one view. No more FOMO&lt;/p&gt;

&lt;p&gt;From 0 to 441 stars + 119 forks now, every commit feels like it's paying off thanks to the community.&lt;br&gt;
As a solo dev + growing open-source spark, reaching this point is genuinely exciting.&lt;br&gt;
In the AI era, local-first, privacy-focused, Python-native quant tooling still feels unbeatable Keep grinding! Next goal: get more people using it — strategy contributions, translations, bug fixes, docs all super welcome ~&lt;br&gt;
What quant / AI trading side project are you working on lately? Drop it in the comments, let's vibe GitHub: &lt;a href="https://github.com/brokermr810/QuantDinger" rel="noopener noreferrer"&gt;https://github.com/brokermr810/QuantDinger&lt;/a&gt;&lt;br&gt;
Feedback/Collab: &lt;a href="mailto:brokermr810@gmail.com"&gt;brokermr810@gmail.com&lt;/a&gt; or Telegram#QuantDinger #QuantFinance #AITrading #OpenSource #Python&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%2Fz2gj5tijef46xbwbiwh9.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%2Fz2gj5tijef46xbwbiwh9.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devops</category>
      <category>database</category>
    </item>
    <item>
      <title>I Built an AI-Powered Quant Trading Platform That Runs 100% Locally – Introducing QuantDinger</title>
      <dc:creator>yuhang chen</dc:creator>
      <pubDate>Sat, 24 Jan 2026 18:07:12 +0000</pubDate>
      <link>https://dev.to/yuhang_chen_969a8b10adae9/i-built-an-ai-powered-quant-trading-platform-that-runs-100-locally-introducing-quantdinger-4en5</link>
      <guid>https://dev.to/yuhang_chen_969a8b10adae9/i-built-an-ai-powered-quant-trading-platform-that-runs-100-locally-introducing-quantdinger-4en5</guid>
      <description>&lt;p&gt;Hey dev.to community &lt;/p&gt;

&lt;p&gt;If you've ever tried building algorithmic trading strategies, you probably know the pain:Backtesting tools are either too basic (no real AI help) or locked in proprietary platforms&lt;br&gt;
Data privacy is a constant worry when using cloud-based services&lt;br&gt;
Switching between crypto exchanges, stocks, forex brokers feels like juggling different APIs&lt;br&gt;
Strategy development in Pine Script or limited DSLs is frustrating if you're a Python person&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%2Fw4x7eoucaw6ufxmq97l9.jpeg" 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%2Fw4x7eoucaw6ufxmq97l9.jpeg" alt=" " width="800" height="943"&gt;&lt;/a&gt;&lt;br&gt;
After years of frustration with fragmented tools, I decided to build something better: QuantDinger — a fully open-source, local-first quantitative trading platform powered by AI.It's designed for quants, algo traders, and Python developers who want full control, privacy, and modern AI assistance — without sending your strategies or data to any vendor.What is QuantDinger?QuantDinger is a complete end-to-end quant workflow in one Python-native app:AI-assisted strategy creation → Use LLMs (OpenAI, Grok, Gemini, DeepSeek, local models via Ollama) as co-pilot to generate, debug, and optimize Python strategies&lt;br&gt;
High-performance backtesting → Vectorized + multi-threaded engine, supports parameter optimization, walk-forward analysis&lt;br&gt;
Live trading execution → Unified interface for crypto (10+ exchanges via CCXT), US/HK stocks (Interactive Brokers), forex (MT5 bridge)&lt;br&gt;
Multi-agent research system → LLM agents with reflection loops, local RAG for market sentiment, news, fundamentals&lt;br&gt;
Beautiful dashboard → Real-time charts (Plotly), portfolio tracking, global market overview, multi-language UI (English/中文/日本語/한국어)&lt;/p&gt;

&lt;p&gt;Everything runs locally or on your own server. Your API keys, historical data, and trading logic never leave your machine.Why Local-First + Privacy Matters in 2025With increasing regulations (GDPR, data sovereignty laws) and rising AI privacy concerns, many traders are moving away from cloud-only platforms. QuantDinger gives you:Zero vendor lock-in&lt;br&gt;
No telemetry or forced updates&lt;br&gt;
Full auditability of every line of code (Apache 2.0 license)&lt;/p&gt;

&lt;p&gt;Key Technical HighlightsBackend: FastAPI + SQLModel + Celery for async tasks&lt;br&gt;
Frontend: React + Vite + Tailwind + shadcn/ui (responsive, mobile-friendly)&lt;br&gt;
AI Layer: LangChain + local RAG + multi-LLM support&lt;br&gt;
Data Handling: DuckDB for fast local storage, Parquet for historical data&lt;br&gt;
Deployment: One-command Docker Compose (backend + frontend + Redis + Postgres optional)&lt;/p&gt;

&lt;p&gt;Quick Start in 3 StepsClone the repo:bash&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/brokermr810/QuantDinger.git" rel="noopener noreferrer"&gt;https://github.com/brokermr810/QuantDinger.git&lt;/a&gt;&lt;br&gt;
cd QuantDinger&lt;/p&gt;

&lt;p&gt;Start with Docker (recommended):bash&lt;/p&gt;

&lt;p&gt;docker compose up -d&lt;/p&gt;

&lt;p&gt;Open &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt; → Create account → Connect your exchange/broker → Start building!&lt;/p&gt;

&lt;p&gt;Or run without Docker (needs Python 3.11+, Node 18+):bash&lt;/p&gt;

&lt;h1&gt;
  
  
  Backend
&lt;/h1&gt;

&lt;p&gt;poetry install&lt;br&gt;
poetry run python main.py&lt;/p&gt;

&lt;h1&gt;
  
  
  Frontend (separate terminal)
&lt;/h1&gt;

&lt;p&gt;cd frontend&lt;br&gt;
pnpm install&lt;br&gt;
pnpm dev&lt;/p&gt;

&lt;p&gt;Demo &amp;amp; ScreenshotsHere's a quick intro video (3 mins): &lt;a href="https://youtu.be/HPTVpqL7knM" rel="noopener noreferrer"&gt;https://youtu.be/HPTVpqL7knM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live hosted demo (for quick try, but local is recommended): &lt;a href="https://ai.quantdinger.com" rel="noopener noreferrer"&gt;https://ai.quantdinger.com&lt;/a&gt;&lt;br&gt;
Recent updates: Added DeepSeek LLM support, fixed IBKR position sync, improved mobile UI&lt;/p&gt;

&lt;p&gt;Next up: More built-in strategies, reinforcement learning agents, better optimization UI, community strategy marketplace.I Need Your Help!This is a solo + community project, and I'd love your input:Try it out and share your experience (good/bad)&lt;br&gt;
What quant pain points does this solve (or miss)?&lt;br&gt;
Contribute code, docs, translations, or strategy examples&lt;br&gt;
Star/fork on GitHub if it looks interesting &lt;/p&gt;

&lt;p&gt;Drop a comment below — tell me what kind of trading setup you use, or what feature you'd kill for in a tool like this.Thanks for reading, and happy (profitable) coding! #opensource #python #quant #trading #algotrading #ai #fintech #backtesting&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>QuantDinger: An open-source local quantitative trading platform.</title>
      <dc:creator>yuhang chen</dc:creator>
      <pubDate>Thu, 08 Jan 2026 09:57:58 +0000</pubDate>
      <link>https://dev.to/yuhang_chen_969a8b10adae9/quantdinger-an-open-source-local-quantitative-trading-platform-25fa</link>
      <guid>https://dev.to/yuhang_chen_969a8b10adae9/quantdinger-an-open-source-local-quantitative-trading-platform-25fa</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Project Background and Functionality
Project Positioning:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;QuantDinger aims to create a "Local-First" open-source AI quantitative trading workbench. Designed as a self-hosted alternative to TradingView and QuantConnect, its core principle is to return data ownership to the user. Addressing the pain points of expensive SaaS platforms, it provides a self-hosted solution that integrates data acquisition, AI-driven investment research, strategy backtesting, and live trading.&lt;br&gt;
Core Functional Entities:&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%2Fzhby7sz74xn9go97awe1.jpg" 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%2Fzhby7sz74xn9go97awe1.jpg" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Multi-source Data Aggregation:  Unified data interfaces for cryptocurrencies (CCXT), US stocks (YFinance/Finnhub), and Chinese A-shares (AkShare) are provided, offering a standardized OHLCV (Open, High, Low, Close, Volume) data format.&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%2Fnsglm3q8v59v7q36tjjj.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%2Fnsglm3q8v59v7q36tjjj.png" alt=" " width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Strategy development environment: Features a built-in code editor based on Monaco Editor, supporting strategy development using the Python language.&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%2Fynq1cudi7vny89bmvfre.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%2Fynq1cudi7vny89bmvfre.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visualization Charts: Integrates TradingView's Lightweight Charts library for candlestick chart display and technical indicator analysis.&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%2Fgmdifz2iyf1s4japs3vl.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%2Fgmdifz2iyf1s4japs3vl.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LLM-assisted tools:  Utilize external large language models (via OpenRouter API calls) to assist in generating code snippets or interpreting market news (existing as a functional module, not a core part of the system).&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%2Fdn2749cbcujdcd2ou5sh.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%2Fdn2749cbcujdcd2ou5sh.png" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live/Simulated Trading: Supports connecting to exchange APIs for order routing and asset management.&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%2Feagnu15rbpaj1qvrf2l9.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%2Feagnu15rbpaj1qvrf2l9.png" alt=" " width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Technology Selection and Architecture Diagram
Codebase directory structure (inferred based on common Flask/Vue projects):&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;codeText&lt;/p&gt;

&lt;p&gt;downloadcontent_copy&lt;/p&gt;

&lt;p&gt;expand_less&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;QuantDinger/
├── backend_api_python/        
│   ├── app/
│   │   ├── routes/             
│   │   ├── services/           
│   │   ├── models/             
│   │   └── utils/              
│   ├── quantdinger.db          
│   ├── requirements.txt        
│   └── run.py                  
├── quantdinger_vue/            
│   ├── src/                    
│   └── package.json            
└── docker-compose.yml          
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technology Stack Details:&lt;/p&gt;

&lt;p&gt;Frontend: Vue.js 3, Vite, TypeScript, Lightweight Charts (candlestick charts), Element Plus (UI components).&lt;/p&gt;

&lt;p&gt;Backend: Python Flask (web framework), SQLAlchemy (ORM), Pydantic (data validation).&lt;/p&gt;

&lt;p&gt;Data Adaptation Layer:&lt;/p&gt;

&lt;p&gt;ccxt: Handles REST/WebSocket data from 100+ cryptocurrency exchanges.&lt;/p&gt;

&lt;p&gt;akshare: Scrapes A-share financial data.&lt;/p&gt;

&lt;p&gt;yfinance: Retrieves historical data for US stocks.&lt;/p&gt;

&lt;p&gt;Persistence: SQLite (lightweight file-based database, no need for separate MySQL/PostgreSQL deployment).&lt;/p&gt;

&lt;p&gt;Technology Stack Details:&lt;/p&gt;

&lt;p&gt;Frontend: Vue.js 3, Vite, TypeScript, Lightweight Charts (candlestick charts), Element Plus (UI components).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Database Design
The project uses SQLite (quantdinger.db) to store metadata, avoiding heavy database maintenance. The main data table (Model) design is as follows:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;users&lt;/code&gt; table&lt;/p&gt;

&lt;p&gt;Used for basic authentication.&lt;/p&gt;

&lt;p&gt;Fields: id, username, password_hash, api_token.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;api_keys&lt;/code&gt; table&lt;/p&gt;

&lt;p&gt;Stores exchange access credentials.&lt;/p&gt;

&lt;p&gt;Fields: id, exchange_name, api_key (AES encrypted storage), secret_key (AES encrypted storage), user_id.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;strategies&lt;/code&gt; table&lt;/p&gt;

&lt;p&gt;Stores user-written strategy code and configuration.&lt;/p&gt;

&lt;p&gt;Fields: id, name, code_content (Text type, stores Python source code), timeframe (e.g., '1h', '1d'), symbol (e.g., 'BTC/USDT'), status (RUNNING/STOPPED).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;logs&lt;/code&gt; / &lt;code&gt;trade_history&lt;/code&gt; table&lt;/p&gt;

&lt;p&gt;Records signals and transaction history during strategy execution.&lt;/p&gt;

&lt;p&gt;Fields: id, strategy_id, timestamp, action (BUY/SELL), price, amount, message.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detailed Implementation of Core Modules
4.1 Backend Interface Layer (app/routes)
Based on Flask Blueprint, it implements RESTful APIs, mainly including:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Market Route (/api/market): Receives time range and symbol parameters from the frontend, calls the data service layer, and returns a JSON formatted candlestick chart array.&lt;/p&gt;

&lt;p&gt;Strategy Route (/api/strategy):&lt;/p&gt;

&lt;p&gt;POST /save: Receives a Python code string and stores it in the database.&lt;/p&gt;

&lt;p&gt;POST /run: Triggers the strategy execution logic.&lt;/p&gt;

&lt;p&gt;GET /logs: Polls to read strategy execution logs.&lt;/p&gt;

&lt;p&gt;LLM Route (/api/llm): As a pass-through proxy, it encapsulates the frontend's Prompt and forwards it to the OpenRouter API, and then returns the returned Code or Text to the frontend. 4.2 Data Adaptation Service (app/services/data_factory.py)&lt;br&gt;
This is a typical factory pattern implementation used to abstract away the differences between different data sources:&lt;/p&gt;

&lt;p&gt;Defines a unified interface &lt;code&gt;IDataSource&lt;/code&gt;, including the method &lt;code&gt;fetch_ohlcv(symbol, timeframe, limit)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Crypto implementation class: Instantiates &lt;code&gt;ccxt.binance()&lt;/code&gt; or &lt;code&gt;ccxt.okx()&lt;/code&gt;, handling API signatures and network requests.&lt;/p&gt;

&lt;p&gt;Stock implementation class: Calls functions from &lt;code&gt;akshare&lt;/code&gt; or &lt;code&gt;yfinance.download()&lt;/code&gt;, and converts the returned Pandas DataFrame into a unified &lt;code&gt;[timestamp, open, high, low, close, volume]&lt;/code&gt; list format.&lt;/p&gt;

&lt;p&gt;4.3 Strategy Execution Engine (app/services/execution_engine.py)&lt;br&gt;
This is the core of the system, responsible for running the user's Python code.&lt;/p&gt;

&lt;p&gt;Dynamic execution: Uses Python's built-in &lt;code&gt;exec()&lt;/code&gt; function or &lt;code&gt;importlib&lt;/code&gt; to dynamically load the user-written code string.&lt;/p&gt;

&lt;p&gt;Sandbox/Context injection: When executing &lt;code&gt;exec()&lt;/code&gt;, system-encapsulated API objects (such as &lt;code&gt;buy()&lt;/code&gt;, &lt;code&gt;sell()&lt;/code&gt;, &lt;code&gt;get_data()&lt;/code&gt;) are injected through the &lt;code&gt;locals&lt;/code&gt; parameter, allowing user code to directly call these functions without worrying about the underlying implementation.&lt;/p&gt;

&lt;p&gt;Process management: To prevent strategy deadlocks from blocking the web service, each running strategy is usually started in a separate process or thread using &lt;code&gt;multiprocessing&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deployment and Running Steps
The project's dependencies are quite complex (involving Python data science libraries and a Node environment), so using Docker is strongly recommended.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Environment configuration:&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file in the project root directory.&lt;/p&gt;

&lt;p&gt;Configure key variables:&lt;/p&gt;

&lt;p&gt;codeIni&lt;br&gt;
downloadcontent_copy&lt;/p&gt;

&lt;p&gt;expand_less&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FLASK_APP=run.py
FLASK_ENV=production
SECRET_KEY=your_secure_key
OPENROUTER_API_KEY=sk-xxx   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Building and Starting:&lt;/p&gt;

&lt;p&gt;codeBash&lt;br&gt;
downloadcontent_copy&lt;/p&gt;

&lt;p&gt;expand_less&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d --build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Backend Container: Based on &lt;code&gt;python:3.10-slim&lt;/code&gt;, automatically installs dependencies via pip and starts Flask (Gunicorn).&lt;/p&gt;

&lt;p&gt;Frontend Container: Based on Nginx, builds Vue artifacts and hosts static files, while configuring a reverse proxy to forward &lt;code&gt;/api&lt;/code&gt; requests to the Backend container.&lt;/p&gt;

&lt;p&gt;Access:&lt;/p&gt;

&lt;p&gt;Access via browser at &lt;code&gt;http://localhost:80&lt;/code&gt; (or the port mapped in docker-compose).&lt;/p&gt;

&lt;p&gt;Initialize the administrator account (you may need to check docker logs for the initial password or create it manually on first startup).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project Summary and Optimization Directions
Project Summary:
QuantDinger is essentially a web-based Python quantitative trading script runner. It lowers the barrier to using &lt;code&gt;ccxt&lt;/code&gt; and &lt;code&gt;pandas&lt;/code&gt; through a web interface and uses SQLite for lightweight data persistence. Its decentralized architecture ensures that trading strategies and API keys remain entirely under the user's control, making it suitable for privacy-sensitive individual traders with some Python experience.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Optimization Directions (Code and Architecture Level):&lt;/p&gt;

&lt;p&gt;Security Enhancement (Sandboxing): Currently, using &lt;code&gt;exec()&lt;/code&gt; to execute user code poses security risks. It is recommended to introduce Docker-in-Docker (DinD) or use gVisor to allocate independent sandbox containers for each strategy to prevent malicious code from accessing the file system.&lt;/p&gt;

&lt;p&gt;Data Storage Upgrade: SQLite is not suitable for storing massive amounts of tick-level financial data. It is recommended to introduce TimescaleDB or InfluxDB to replace SQLite as the backend for market data storage to improve query efficiency.&lt;/p&gt;

&lt;p&gt;Event-Driven Engine: The current architecture is biased towards simple script polling. It is recommended to refactor to an event-driven architecture, introducing a message queue (Redis/RabbitMQ) to achieve a low-latency link of "market data update -&amp;gt; trigger event -&amp;gt; strategy response -&amp;gt; trade execution".&lt;/p&gt;

&lt;p&gt;Code Reusability and Modularization: Allow users to upload custom Python libraries or modules (.py files), not just single-file scripts, to reuse complex indicator calculation logic.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://github.com/brokermr810/QuantDinger?tab=readme-ov-file&lt;/code&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
      <category>quantitative</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
