Fully Open Source • Local-First • Free

AI-Powered Trading
Research That Validates
Before You Risk a Dollar

Local-first AI trading research: market heatmaps, news catalysts, strategy generation, Backtrader backtests, and transparent agent runs — all in one Docker app. No brokerage connection. No hosted accounts. Your data stays on your machine.

What Could You Do with TradingSpy?

One workspace for market research, strategy generation, backtesting, and AI-powered analysis.

Trading Companion

Chat with your market data, strategies, news, heatmaps, and backtest history.

Strategy Researcher

Generate and iterate strategies until one beats the baseline. Loop engineering at its finest.

Trend Prediction

Statistical calculations and LLM reasoning with support/resistance lines to simulate expected trends.

Signal Analysis

Analyze real-time movement with peer stocks, insider trading data, and technical indicators.

Key Features

Traditional data visualisation for quick results, combined with loop-engineering-powered agents.

Market Intelligence

Real-time quotes, sector heatmaps, industry performance, insider activity, news search, and fundamentals — all in one query.

AI Strategy Generation

Describe a trading thesis in plain English; get a working Backtrader strategy with syntax and runtime validation.

Automated Backtesting

Every generated strategy is backtested against downloaded candles with configurable parameter sweeps.

Benchmark Comparison

Every result is compared to buy-and-hold and any saved strategy. Underperformers are rejected automatically.

Loop Engineering

Set a goal and the agent iterates until it succeeds — no babysitting required.

Transparent Agent Runs

Every tool call, validation failure, rejection reason, and accepted result is logged and visible in the Task Center.

Multi-Provider LLM

Google AI Studio, Mistral, OpenRouter, NVIDIA, LiteLLM, Ollama (local), AWS Bedrock, GCP Vertex AI, Azure OpenAI.

OpenAI-Compatible API

Use TradingSpy as a backend for scripts, other agents, or custom integrations via /v1/chat/completions.

Local-First Architecture

All data stored locally. No external accounts, no telemetry, no cloud dependency. Your data stays on your machine.

AI Agents

Each agent is purpose-built for a specific task. Pick one or let the system route your request automatically.

Strategy Race

Example prompt

"Generate until it beats buy and hold for QQQ. Use daily candles."

Generates strategies from the AI Strategy Studio, backtests them, and loops until one beats the target benchmark. Supports improving a previous version or racing against a custom baseline.

Signal Analysis

Example prompt

"Predict the next move for btc-usd for daily interval"

Reads recent bars and support/resistance levels to predict the price trend.

Stock Screening

Example prompt

"Scan AI stocks until you find 10 which are good enough on fundamentals"

Screens a universe for valuation/growth/profitability candidates, enriches passing names with market context, news, options, and insider summaries.

Chat

Example prompt

"Give me a daily market brief with breadth, strongest and weakest industries."

Pulls data from yfinance to summarize daily market information.

Quick Start

Up and running in 3 steps with Docker.

1

Clone & Configure

$ git clone https://github.com/mrhustlex/TradingSpy-TradingAgentService.git
$ cd TradingSpy-TradingAgentService
$ cp .env.example .env
# Add your LLM provider key to .env
2

Launch

$ docker compose up -d --build

Or run manually without Docker — Python 3.11 + Node.js 22

View manual setup instructions

Data Sources

Yahoo Finance

Price quotes, OHLCV candles, fundamentals, insider transactions, analyst recommendations, earnings dates, options chains. Primary data backbone.

SearXNG

Privacy-respecting metasearch for financial news, analyst opinions, macro events, and catalyst research. Runs locally.

arXiv

Academic papers on quantitative finance and algorithmic trading. Abstract and full-text PDF reading.

Backtrader

Local backtesting engine for strategy execution, parameter optimization, and benchmark comparison.

Supported Markets

Any Yahoo Finance-compatible symbol works.

United States

AAPL, NVDA, QQQ, SPY

London

AZN.L, HSBA.L

Hong Kong

0700.HK

Japan

7203.T

Crypto

BTC-USD, ETH-USD

Commodities

GC=F, CL=F

+ India, Canada, Australia, Germany, France, UK, Eurozone, China

LLM Providers

Use any provider. Configure in .env or the app Settings page.

Google AI Studio
Mistral
OpenRouter
NVIDIA
LiteLLM
Ollama (Local)
AWS Bedrock
GCP Vertex AI
Azure OpenAI

Safety & Limits

TradingSpy is for research and education only. It is not financial advice.

Backtests can overfit and do not predict future returns.

Generated strategy Python is executed locally and is not sandboxed. Review it before running.

All services bind to localhost. No telemetry. No cloud dependency.

Ready to Start Researching?

Clone the repo, spin up Docker, and start exploring markets and strategies in minutes.