I built TradingSpy: local, privacy-first AI trading assistant(First Open Source)(github.com)
github.com
I built TradingSpy: local, privacy-first AI trading assistant(First Open Source)
https://github.com/mrhustlex/TradingSpy-TradingAgentService
6 コメント
Ooh, this does look nice and well integrated ( yahoo does not always want to cooperate for me ). I am not much of an active trader, but I used gpt for some of what tradingspy does ( minus the nice visualizations and what not ). Will try it out.
cool, I think the most important feature I wanna test out is the loop agent. loop engineering is popular, so I was thinking if that could do like a strategy improvement loop
Hi HN,
I spend a lot of my weekends digging through market charts, scraping news catalysts, checking insider trading patterns, and testing Backtrader strategies. A few months ago, I realized I was spending way more time wiring together five different data APIs, writing custom plumbing scripts, and managing Jupyter notebooks than actually researching alpha.
Worse, most commercial platforms out there charge a fortune, lock you into their ecosystem, or harvest your proprietary strategies and data. Since I couldn’t find a privacy-first, all-in-one local environment that did what I wanted, I decided to build it myself.
I call it TradingSpy, and I just open-sourced it.
GitHub: https://github.com/mrhustlex/TradingSpy
What it is:
TradingSpy is a local-first AI trading research workstation running entirely in Docker. It combines traditional data visualization (heatmaps, indices tracking, corporate data) with loop-engineered AI agents that act as autonomous research companions. It is not a broker and it does not place live trades. It is strictly a sandbox for strategy generation, market analysis, and backtesting.
Core Features & Architecture:
Zero Data Privacy Concerns: Everything runs locally on your machine via Docker. Your strategy ideas and data remain entirely yours.
Loop-Engineered Agents: You give it a target (e.g., "Improve EMA_Trend for TQQQ until it beats the baseline buy-and-hold"). The agent autonomously generates the Backtrader Python code, validates the syntax, runs backtests against historical data, evaluates performance, and discards underperforming variations without you having to babysit it.
Deterministic + Probabilistic Hybrid: Not everything needs an LLM. It features a fast, traditional market dashboard (sector heatmaps, industry movements, batch quotes via yfinance) alongside tool-backed agents for stock screening and technical trend analysis.
Extensive LLM Support: Works out of the box with free-tier cloud APIs (Google AI Studio, OpenRouter) or completely offline local models via Ollama (like qwen2.5-coder).
OpenAI-Compatible API: The backend exposes a /v1/chat/completions endpoint, so you can use it as a backend for your own custom CLI scripts or external pipelines.
The codebase relies on Python 3.11 (FastAPI/Backtrader) for the backend and React for the frontend, bundled cleanly with Docker Compose.
Right now, I'm a solo developer building this on zero budget because it’s a tool I genuinely needed. I’m opening it up to the community because I want to make quantitative research accessible without the data privacy paranoia.
It is still highly experimental software meant for educational research (definitely not financial advice). I would love to get your feedback on the architecture, code-generation loops, or any feature requests you might have!