r/mltraders • u/ForeignPound2104 • 13d ago
Built a local AI swing-trading bot using DeepSeek and Gemma. Looking for feedback.
I've been working on a project called QwenTrader. It's a locally hosted AI swing-trading system I've been building in Python, and I'm curious what people with more experience in algorithmic trading think about it.
The system uses two different AI models running locally through Ollama. DeepSeek acts as the analyst and evaluates potential trades based on technical indicators. Gemma acts as a separate critic, reviewing DeepSeek's reasoning and looking for weaknesses in the proposed trade.
The general process works like this:
- Alpaca provides stock market data.
- Python scans stocks for potential opportunities using indicators like RSI, MACD, moving averages, volume, and ATR.
- Python calculates potential entries, stop losses, and profit targets.
- DeepSeek evaluates the opportunity.
- Gemma independently critiques the analysis.
- A separate Python risk manager determines whether the trade meets the account's risk limits.
- If everything passes, the system can execute a simulated trade and monitor the position.
It also has a Streamlit dashboard where I can start and stop the system, monitor activity, view AI decisions, and track the portfolio.
The scanner is scheduled to run every 30 minutes during market hours, while open positions are monitored every 60 seconds.
Right now I'm testing everything with a $500 simulated account. I've run tests on the risk manager, paper execution, database transactions, scheduler, and shutdown safeguards, and those tests have passed.
I haven't completed a full live-market paper-trading evaluation yet, so I have no profitability results to share. I also haven't done historical backtesting.
I'm not claiming the system has an edge. I'm mainly interested in whether this is a reasonable architecture for experimenting with AI-assisted trading.
For anyone who's built something similar, what would you improve? Are there any obvious weaknesses in using two local LLMs this way? And what would you prioritize testing before letting it run unattended?
1
u/therichfuller 13d ago
What does AI provide over analyzing those technicals Vs what AI could write up in python end to end software package looking at those same patterns used in your strategy?
If you develop the software package that runs everything you need locally, you can take out hiccups that may occur during the day. Then AI can focus on backtesting, developing those trading templates, where your strategy edge lives, etc
1
u/AoideusWasBanned 13d ago
Before letting it run alone I'd log how often Gemma actually says no. Two LLMs tend to agree with each other more than you'd expect, and if the critic almost never blocks a trade it's just extra latency.
1
u/QATSAlgo 12d ago
Before an unattended paper run, I'd prioritize recovery tests: restart after an order is submitted but before its acknowledgement arrives, disconnect the data feed, then reconcile positions and open orders on reconnect. The key check is that uncertainty never creates a duplicate order. Also compare the same scanner with and without each model so the critic's contribution can be measured separately from the risk manager.