Files
NexQuant/README.md
T
TPTBusiness 11b347d0e7 chore: prepare repository for Predix public release
- Rebrand from RD-Agent to Predix for EUR/USD quantitative trading
- Update all documentation to English
- Remove Microsoft-specific references
- Clean up temporary files and backups
- Update LICENSE, README, and configuration for PredixAI organization

Breaking changes:
- Project name changed from 'rdagent' to 'predix' in pyproject.toml
- All Microsoft and RD-Agent branding replaced with Predix
- Documentation completely rewritten for EUR/USD focus

Documentation:
- README.md: Professional English documentation with installation, quick start, CLI reference
- CHANGELOG.md: Cleaned up, references upstream RD-Agent for historical changes
- CODE_OF_CONDUCT.md: Switched to Contributor Covenant v2.0
- SECURITY.md: Predix-specific vulnerability reporting process
- SUPPORT.md: Updated support channels (nico@predix.io, GitHub Discussions)
- CONTRIBUTING.md: Adapted for Predix project
- docs/: Sphinx configuration updated for Predix branding

Configuration:
- pyproject.toml: Updated project metadata, keywords, URLs for PredixAI
- .gitignore: Comprehensive Python/gitignore template
- Makefile: Updated CI pages URL
- setup_predix_eurusd.sh: Translated to English

Cleanup:
- Deleted log files, caches, __pycache__ directories
- Removed backup files (*.backup_*)
- Cleaned web/node_modules
2026-03-29 00:10:26 +01:00

314 lines
8.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Predix
<h4 align="center">
<strong>AI-powered Quantitative Trading Agent for EUR/USD Forex</strong>
</h4>
<p align="center">
<a href="#installation">Installation</a> •
<a href="#quick-start">Quick Start</a> •
<a href="#configuration">Configuration</a> •
<a href="#features">Features</a>
</p>
<p align="center">
<a href="https://github.com/PredixAI/predix/blob/main/LICENSE"><img src="https://img.shields.io/github/license/PredixAI/predix" alt="License"></a>
<a href="https://pypi.org/project/predix/"><img src="https://img.shields.io/pypi/v/predix" alt="PyPI"></a>
<a href="https://github.com/PredixAI/predix/actions/workflows/ci.yml"><img src="https://github.com/PredixAI/predix/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
</p>
---
## Overview
**Predix** is an autonomous AI agent for quantitative trading strategies in the EUR/USD forex market. Built on a multi-agent framework, Predix automates the full research and development cycle:
- 📊 **Data Analysis** Automatically analyzes market patterns and microstructure
- 💡 **Strategy Discovery** Proposes novel trading factors and signals
- 🧠 **Model Evolution** Iteratively improves predictive models
- 📈 **Backtesting** Validates strategies on historical 1-minute data
Predix is optimized for **1-minute EUR/USD FX data** (20202026) and uses Qlib as the underlying backtesting engine.
---
## Installation
### Prerequisites
- **Python 3.10 or 3.11**
- **Docker** (required for sandboxed code execution)
- **Linux** (officially supported; macOS/Windows may work with adjustments)
### Quick Install
```bash
# Install from PyPI
pip install predix
# Or install from source
git clone https://github.com/PredixAI/predix
cd predix
pip install -e .
```
### Development Setup
```bash
# Create conda environment
conda create -n predix python=3.10
conda activate predix
# Install in editable mode with dev dependencies
make dev
```
---
## Quick Start
### 1. Health Check
Verify your environment is properly configured:
```bash
rdagent health_check --no-check-env
```
### 2. Configure LLM Backend
Create a `.env` file in your project root:
```bash
# Example: OpenAI configuration
cat << EOF > .env
CHAT_MODEL=gpt-4o
EMBEDDING_MODEL=text-embedding-3-small
OPENAI_API_BASE=https://api.openai.com/v1
OPENAI_API_KEY=your-api-key-here
EOF
```
**Alternative providers:**
- **Azure OpenAI**: Set `AZURE_API_KEY`, `AZURE_API_BASE`, `AZURE_API_VERSION`
- **DeepSeek**: Use `CHAT_MODEL=deepseek/deepseek-chat` with `DEEPSEEK_API_KEY`
- **SiliconFlow (embedding)**: Use `EMBEDDING_MODEL=litellm_proxy/BAAI/bge-m3`
### 3. Run Quantitative Trading Loop
```bash
# Full factor & model co-evolution
rdagent fin_quant
# Factor-only evolution
rdagent fin_factor
# Model-only evolution
rdagent fin_model
```
### 4. Monitor Results
```bash
# Start the UI dashboard
rdagent ui --port 19899 --log-dir log/ --data-science
```
Then open `http://127.0.0.1:19899` in your browser.
---
## Configuration
### Data Configuration
Edit [`data_config.yaml`](data_config.yaml) to customize:
```yaml
instrument: EURUSD
frequency: 1min
data_path: ~/.qlib/qlib_data/eurusd_1min_data
# Walk-forward split
train_start: "2022-03-14"
train_end: "2024-06-30"
valid_start: "2024-07-01"
valid_end: "2024-12-31"
test_start: "2025-01-01"
test_end: "2026-03-20"
# Market context for LLM prompts
market_context:
spread_bps: 1.5
target_arr: 9.62 # Target annual return (%)
max_drawdown: 20 # Max drawdown (%)
```
### Environment Variables
| Variable | Description | Example |
|----------|-------------|---------|
| `CHAT_MODEL` | LLM for reasoning | `gpt-4o`, `deepseek-chat` |
| `EMBEDDING_MODEL` | Embedding model | `text-embedding-3-small` |
| `OPENAI_API_KEY` | API key for OpenAI | `sk-...` |
| `DEEPSEEK_API_KEY` | API key for DeepSeek | `sk-...` |
| `DS_LOCAL_DATA_PATH` | Local data directory | `./data` |
---
## Features
### 🔄 Iterative Factor Evolution
Predix continuously proposes, implements, and validates new alpha factors:
- Learns from backtest feedback
- Avoids overfitting through walk-forward validation
- Discovers non-obvious patterns in order flow, volatility, and session dynamics
### 🧠 Model Architecture Search
Automatically explores and refines predictive models:
- Linear baselines (LightGBM, XGBoost)
- Deep learning (LSTM, Transformer, Temporal CNN)
- Ensemble methods
### 📚 Knowledge Base
Built-in knowledge accumulation across loops:
- Successful factors are archived
- Failed attempts inform future proposals
- Cross-loop learning improves robustness
### 🖥️ Interactive UI
Real-time dashboard for monitoring:
- Factor performance metrics
- Model architecture evolution
- Cumulative returns and drawdowns
- Code diffs and implementation history
---
## Project Structure
```
predix/
├── rdagent/ # Core agent framework
│ ├── app/ # CLI and scenario apps
│ ├── components/ # Reusable agent components
│ ├── core/ # Core abstractions
│ ├── scenarios/ # Domain-specific scenarios
│ └── utils/ # Utilities
├── constraints/ # Constraint definitions
├── docs/ # Documentation
├── web/ # Web UI frontend
├── data_config.yaml # Data configuration
├── pyproject.toml # Project metadata
└── requirements.txt # Dependencies
```
---
## Data Setup
Predix uses 1-minute EUR/USD data. To prepare your dataset:
```bash
# Run the data setup script (if provided)
./setup_predix_eurusd.sh
# Or manually place data in:
# ~/.qlib/qlib_data/eurusd_1min_data/
```
Expected data columns: `$open`, `$close`, `$high`, `$low`, `$volume`
---
## CLI Commands
| Command | Description |
|---------|-------------|
| `rdagent fin_quant` | Full factor & model co-evolution |
| `rdagent fin_factor` | Factor-only evolution |
| `rdagent fin_model` | Model-only evolution |
| `rdagent fin_factor_report --report-folder=<path>` | Extract factors from financial reports |
| `rdagent general_model <paper-url>` | Extract model from research paper |
| `rdagent data_science --competition <name>` | Kaggle/data science competition mode |
| `rdagent ui --port 19899 --log-dir <path>` | Start monitoring dashboard |
| `rdagent health_check` | Validate environment setup |
---
## Requirements
Core dependencies (see [`requirements.txt`](requirements.txt) for full list):
- **LLM**: `openai`, `litellm`
- **Data**: `pandas`, `numpy`, `pyarrow`
- **ML**: `scikit-learn`, `lightgbm`, `xgboost`
- **Backtesting**: `qlib` (via Docker)
- **UI**: `streamlit`, `plotly`, `flask`
---
## License
This project is licensed under the **MIT License** see the [`LICENSE`](LICENSE) file for details.
---
## Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
For major changes, please open an issue first to discuss your approach.
---
## Citation
If you use Predix in your research, please cite the underlying framework:
```bibtex
@misc{yang2025rdagentllmagentframeworkautonomous,
title={R&D-Agent: An LLM-Agent Framework Towards Autonomous Data Science},
author={Yang, Xu and Yang, Xiao and Fang, Shikai and Zhang, Yifei and Wang, Jian and Xian, Bowen and Li, Qizheng and Li, Jingyuan and Xu, Minrui and Li, Yuante and others},
year={2025},
eprint={2505.14738},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
```
---
## Support
- **Issues**: [GitHub Issues](https://github.com/PredixAI/predix/issues)
- **Documentation**: [Read the Docs](https://rdagent.readthedocs.io/)
---
## Disclaimer
Predix is provided "as is" for **research and educational purposes only**. It is **not** intended for:
- Live trading or financial advice
- Production use without thorough testing
- Replacement of qualified financial professionals
Users assume all liability and should comply with applicable laws and regulations in their jurisdiction. Past performance does not guarantee future results.