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.
- 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
- 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
Python 3.9+
PostgreSQL
Redis
Poetry- Clone the repository:
git clone https://github.com/yourusername/quant-copilot.git
cd quant-copilot- Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -- Install dependencies using Poetry:
poetry install- 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- Initialize the database:
poetry run alembic upgrade headpoetry run uvicorn app.main:app --reloadpoetry run pytestquant-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
poetry add package-name
poetry add package-name --dev # for development dependenciespoetry updatepoetry run alembic revision --autogenerate -m "migration description"Access the API documentation at http://localhost:8000/docs after starting the server.
- Fork the repository
- Create a feature branch
- Commit changes
- Push to the branch
- Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.