Skip to content

Mak-1911/quant-copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quant-Copilot

Description

Quant Copilot is an innovative platform that leverages large language models (LLMs) to transform natural language trading strategy descriptions into executable Python code. The platform uses frameworks like BackTrader and Vectorbt for strategy execution and backtesting.

Key Features

  • Strategy Generation: Convert natural language to Python trading strategies
  • Visual Strategy Builder: Drag-and-drop interface for strategy creation
  • Automated Backtesting: Test strategies against historical data
  • Performance Analytics: Detailed metrics and visualizations
  • Strategy Explanations: AI-powered strategy documentation
  • Paper Trading: Test strategies in real-time with virtual money
  • Leaderboard System: Compare and rank strategy performance

Tech Stack

  • Backend: FastAPI
  • Database: PostgreSQL with SQLModel ORM
  • Cache: Redis
  • Authentication: JWT with Email OTP
  • LLM Integration: Google Gemini
  • Backtesting Engine: Backtrader
  • Data Source: Yahoo Finance
  • Package Management: Poetry

Installation

Prerequisites

Python 3.9+
PostgreSQL
Redis
Poetry

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/quant-copilot.git
cd quant-copilot
  1. Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
  1. Install dependencies using Poetry:
poetry install
  1. Set up environment variables:
# Create .env file
POSTGRES_URL=postgresql://user:password@localhost:5432/dbname
REDIS_URL=redis://localhost:6379
JWT_SECRET=your_jwt_secret
GEMINI_API_KEY=your_gemini_api_key
  1. Initialize the database:
poetry run alembic upgrade head

Running the Application

poetry run uvicorn app.main:app --reload

Running Tests

poetry run pytest

Project Structure

quant-copilot/
├── app/
│   ├── models/          # SQLModel definitions
│   ├── routes/          # API endpoints
│   ├── services/        # Business logic
│   └── utility/         # Helper functions
├── tests/              # Test suite
├── alembic/            # Database migrations
├── pyproject.toml      # Poetry configuration
└── poetry.lock         # Dependency lock file

Development

Adding Dependencies

poetry add package-name
poetry add package-name --dev  # for development dependencies

Updating Dependencies

poetry update

Creating a New Migration

poetry run alembic revision --autogenerate -m "migration description"

API Documentation

Access the API documentation at http://localhost:8000/docs after starting the server.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit changes
  4. Push to the branch
  5. Open a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

you junior ai assisstant to research, generate and bactest trading strategies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages