⚠️ This is the original CLI-only version of QuantCoder, preserved in thequantcoder-legacy
branch.
QuantCoder is a command-line tool that allows users to generate QuantConnect trading algorithms from research articles using natural language processing and large language models (LLMs). It was initiated in November 2023 and based on a cognitive architecture inspired by the article "Dual Agent Chatbots and Expert Systems Design"
The initial version successfully coded a blended momentum and mean-reversion strategy as described in "Outperforming the Market (1000% in 10 years)", which received over 10,000 impressions on LinkedIn.
✅ Requires Python 3.8 or later
# Clone the repository and switch to the legacy branch
git clone https://github.com/SL-Mar/QuantCoder.git
cd QuantCoder
git checkout quantcoder-legacy
# Create and activate a virtual environment
python -m venv .venv-legacy
# On Windows:
.\.venv-legacy\Scripts\activate
# On macOS/Linux:
source .venv-legacy/bin/activate
# Install dependencies and the CLI
pip install -e .
python -m spacy download en_core_web_sm
pip install openai==0.28
You may also freeze dependencies:
pip freeze > requirements-legacy.txt
🧠 LLM Configuration By default, this project uses the OpenAI gpt-4o-2024-11-20 model for generating trading code from research articles.
To launch the CLI tool in interactive mode:
python -m quantcli.cli interactive
Or if quantcli
is recognized as a command:
quantcli interactive
This legacy version uses the OpenAI SDK v0.28. Newer versions (>=1.0.0
) are not supported.
If you encounter this error:
You tried to access openai.ChatCompletion, but this is no longer supported...
Fix it by running:
pip install openai==0.28
The folder 'Strategies and publications' contains articles and trading strategies generated using this CLI tool. These strategies may have been manually refined or enhanced using LLM-based methods. Use them at your own discretion — conduct thorough research and validate before live use.
This project is licensed under the MIT License. See the LICENSE file for details.