Skip to content

ijfields/Autonomous-Quantitative-Trading-Lab

 
 

Repository files navigation

🤖 Autonomous Quantitative Trading Laboratory

Python Next.js PostgreSQL Gemini

An end-to-end autonomous system that discovers alpha in academic papers, GitHub repositories, and trading forums, then rigorously backtests strategies using a professional event-driven engine.


🚀 Quick Start Guide

Follow these steps to get running in 5 minutes.

1. Prerequisites

  • Docker Desktop (or Engine) installed and running.
  • Conda (Miniconda or Anaconda) installed.
  • Google AI Studio API Keys (Free tier works).

2. Clone & Configure

git clone <your-repo-url>
cd research_backtesting_agents-Project

# Create .env from template
cp .env.example .env

# Edit .env and paste your Google API Keys
nano .env 

3. Start Infrastructure (Database + Search)

Runs PostgreSQL (with pgvector) and SearXNG (Meta-Search Engine).

docker compose up -d

4. Setup Python Environment (The Agents)

# Create Environment
conda create -n pydantic_ai_env python=3.12 -y
conda activate pydantic_ai_env

# Install Dependencies
pip install -r requirements.txt

# Initialize Database
python -c "from research_backtesting_agentsV2.src.common.database import init_db; import asyncio; asyncio.run(init_db())"

5. Launch the Dashboard (Optional but Recommended)

cd research_backtesting_dashboard
npm install
npm run build
npm start
  • Access at: http://localhost:3000

🏃 Autonomous Mode (CLI)

Run the agents directly if you don't want to use the dashboard controls.

Mode A: Deep Research (Scout & Sniper) Auto-discovers strategies 24/7.

# Make sure you are in the root directory
conda activate pydantic_ai_env
python research_backtesting_agentsV2/research_main.py

Mode B: Backtesting Pipeline Picks up discovered strategies and tests them.

python research_backtesting_agentsV2/backtest_main.py

📂 Project Structure

.
├── .env                     # Global Configuration (Secrets, Ports)
├── docker-compose.yml       # Infrastructure (DB, SearXNG)
├── research_backtesting_agentsV2/   # 🧠 Python Agents
│   ├── research_main.py     # Research Loop
│   ├── backtest_main.py     # Backtest Loop
│   └── src/                 # Core Logic
└── research_backtesting_dashboard/  # 📊 Next.js UI

🐛 Troubleshooting

  • Database Connection Failed? Check if Docker is running (docker ps).
  • API Quota Errors? Add more keys to RESEARCH_KEYS in .env.
  • Connection Issues? Run the diagnostic tool:
    python check_connection.py

📜 License

MIT License. See LICENSE for details.

About

An end-to-end autonomous system that discovers alpha in academic papers, GitHub repositories, and trading forums, then rigorously backtests strategies using a professional event-driven engine.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 55.0%
  • TypeScript 44.3%
  • Other 0.7%