2026-03-29 00:10:26 +01:00
# Predix
2024-09-06 15:39:41 +08:00
2026-03-29 00:10:26 +01:00
<h4 align="center">
<strong>AI-powered Quantitative Trading Agent for EUR/USD Forex</strong>
</h4>
2024-09-25 08:54:04 +08:00
2026-03-29 00:10:26 +01:00
<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>
2025-05-22 15:37:34 +08:00
2026-03-29 00:10:26 +01:00
<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://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>
2026-04-02 20:35:57 +02:00
<a href="https://github.com/PredixAI/predix/stargazers"><img src="https://img.shields.io/github/stars/PredixAI/predix" alt="Stars"></a>
2026-03-29 00:10:26 +01:00
</p>
2024-04-02 21:04:09 -07:00
2026-03-29 00:10:26 +01:00
---
2025-09-19 10:58:07 +08:00
2026-03-29 00:10:26 +01:00
## Overview
2025-09-19 10:58:07 +08:00
2026-03-29 00:10:26 +01:00
**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:
2025-05-14 11:21:13 +08:00
2026-03-29 00:10:26 +01:00
- 📊 **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
2025-05-14 11:21:13 +08:00
2026-03-29 00:10:26 +01:00
Predix is optimized for **1-minute EUR/USD FX data** (2020– 2026) and uses Qlib as the underlying backtesting engine.
2025-05-14 11:21:13 +08:00
2026-04-02 20:16:54 +02:00
## Acknowledgments
This project draws inspiration from various open-source projects in the AI trading and multi-agent systems space. We thank all the authors for their innovative work that helped shape our understanding of these patterns.
Special thanks to:
- **[Microsoft RD-Agent ](https://github.com/microsoft/RD-Agent )** (MIT License) - Foundation for our autonomous R&D agent framework. We extend our gratitude to the RD-Agent team for their excellent foundational work.
- **[TradingAgents ](https://github.com/TradingAgents/TradingAgents )** (Apache 2.0 License) - Inspiration for our multi-agent debate system, reflection mechanism, and memory management modules.
- **[ai-hedge-fund ](https://github.com/virattt/ai-hedge-fund )** - Inspiration for macro analysis (Stanley Druckenmiller agent), risk management concepts, and market regime detection.
All code in Predix is originally written and implemented independently. Predix extends these frameworks with EUR/USD forex-specific features, 1-minute backtesting capabilities, comprehensive risk management, and trading dashboards.
2026-04-02 19:34:05 +02:00
2026-03-29 00:10:26 +01:00
---
2025-05-26 17:43:43 +08:00
2026-03-29 00:10:26 +01:00
## Installation
2025-05-30 12:28:52 +08:00
2026-03-29 00:10:26 +01:00
### Prerequisites
2025-05-30 12:28:52 +08:00
2026-03-29 00:10:26 +01:00
- **Python 3.10 or 3.11**
- **Docker** (required for sandboxed code execution)
- **Linux** (officially supported; macOS/Windows may work with adjustments)
2025-05-30 12:28:52 +08:00
2026-03-29 00:10:26 +01:00
### Quick Install
2025-05-30 12:28:52 +08:00
2026-03-29 00:10:26 +01:00
```bash
2026-04-02 21:21:29 +02:00
# Clone repository
2026-03-29 00:10:26 +01:00
git clone https://github.com/PredixAI/predix
cd predix
2025-05-14 11:32:23 +08:00
2026-03-29 00:10:26 +01:00
# Create conda environment
conda create -n predix python = 3.10
conda activate predix
2024-06-27 10:12:58 +00:00
2026-04-02 21:21:29 +02:00
# Install in editable mode
pip install -e .[ test,lint]
2026-03-29 00:10:26 +01:00
```
2024-06-27 10:12:58 +00:00
2026-04-02 21:21:29 +02:00
### Configuration
2024-06-27 10:12:58 +00:00
2026-04-02 21:21:29 +02:00
1. **Create `.env` file:**
```bash
# Local LLM (llama.cpp)
OPENAI_API_KEY = local
OPENAI_API_BASE = http://localhost:8081/v1
CHAT_MODEL = qwen3.5-35b
# Embedding (Ollama)
LITELLM_PROXY_API_KEY = local
LITELLM_PROXY_API_BASE = http://localhost:11434/v1
EMBEDDING_MODEL = nomic-embed-text
# Paths
QLIB_DATA_DIR = ~/.qlib/qlib_data/eurusd_1min_data
```
2024-09-06 15:39:41 +08:00
2026-04-02 21:21:29 +02:00
2. **Start LLM server (llama.cpp):**
2026-03-29 00:10:26 +01:00
```bash
2026-04-02 21:21:29 +02:00
~/llama.cpp/build/bin/llama-server \
--model ~/models/qwen3.5/Qwen3.5-35B-A3B-Q3_K_M.gguf \
--n-gpu-layers 36 \
--ctx-size 80000 \
--port 8081
2026-03-29 00:10:26 +01:00
```
2024-08-09 19:55:35 +08:00
2026-04-02 21:21:29 +02:00
---
## Quick Start
2024-06-27 10:12:58 +00:00
2026-04-02 21:21:29 +02:00
### 1. Run Trading Loop
2024-07-25 16:18:00 +08:00
2026-03-29 00:10:26 +01:00
```bash
2026-04-02 21:21:29 +02:00
# Activate conda environment
conda activate predix
2025-07-11 16:26:16 +08:00
2026-04-02 21:21:29 +02:00
# Start EURUSD trading loop
rdagent fin_quant
2024-07-25 16:18:00 +08:00
2026-04-02 21:21:29 +02:00
# With options
rdagent fin_quant --loop-n 5 --step-n 2
```
2025-07-11 16:26:16 +08:00
2026-04-02 21:21:29 +02:00
### 2. Monitor Results
2025-07-11 16:26:16 +08:00
2026-03-29 00:10:26 +01:00
```bash
2026-04-02 21:21:29 +02:00
# Start the UI dashboard
rdagent server_ui --port 19899 --log-dir git_ignore_folder/RD-Agent_workspace/
2024-11-28 15:35:13 +08:00
2026-04-02 21:21:29 +02:00
# Or open in browser
# http://127.0.0.1:19899
```
2024-11-28 15:35:13 +08:00
2026-04-02 21:21:29 +02:00
### 3. Loop Continuously
To run the trading loop continuously with auto-restart:
```bash
# Simple loop
while true; do
rdagent fin_quant
sleep 5
done
2026-03-29 00:10:26 +01:00
```
2024-11-28 15:35:13 +08:00
2026-04-02 21:21:29 +02:00
---
## Configuration
2025-03-21 14:55:30 +08:00
2026-03-29 00:10:26 +01:00
```bash
# Start the UI dashboard
rdagent ui --port 19899 --log-dir log/ --data-science
```
2025-07-07 14:18:56 +08:00
2026-03-29 00:10:26 +01:00
Then open `http://127.0.0.1:19899` in your browser.
2025-06-13 18:32:39 +08:00
2026-03-29 00:10:26 +01:00
---
2025-08-05 15:48:28 +08:00
2026-03-29 00:10:26 +01:00
## Configuration
2025-08-05 15:48:28 +08:00
2026-03-29 00:10:26 +01:00
### Data Configuration
2024-11-01 17:33:59 +08:00
2026-03-29 00:10:26 +01:00
Edit [`data_config.yaml` ](data_config.yaml ) to customize:
2024-10-31 12:49:38 +08:00
2026-03-29 00:10:26 +01:00
```yaml
instrument : EURUSD
frequency : 1min
data_path : ~/.qlib/qlib_data/eurusd_1min_data
2024-11-28 15:35:13 +08:00
2026-03-29 00:10:26 +01:00
# 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"
2024-11-28 15:35:13 +08:00
2026-03-29 00:10:26 +01:00
# Market context for LLM prompts
market_context :
spread_bps : 1.5
target_arr : 9.62 # Target annual return (%)
max_drawdown : 20 # Max drawdown (%)
2026-03-18 14:04:52 +08:00
```
2024-11-28 15:35:13 +08:00
2026-03-29 00:10:26 +01:00
### Environment Variables
2024-11-28 15:35:13 +08:00
2026-03-29 00:10:26 +01:00
| 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` |
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
---
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
## Features
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
### 🔄 Iterative Factor Evolution
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
Predix continuously proposes, implements, and validates new alpha factors:
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
- Learns from backtest feedback
- Avoids overfitting through walk-forward validation
- Discovers non-obvious patterns in order flow, volatility, and session dynamics
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
### 🧠 Model Architecture Search
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
Automatically explores and refines predictive models:
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
- Linear baselines (LightGBM, XGBoost)
- Deep learning (LSTM, Transformer, Temporal CNN)
- Ensemble methods
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
### 📚 Knowledge Base
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
Built-in knowledge accumulation across loops:
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
- Successful factors are archived
- Failed attempts inform future proposals
- Cross-loop learning improves robustness
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
### 🖥️ Interactive UI
2026-03-18 14:04:52 +08:00
2026-03-29 00:10:26 +01:00
Real-time dashboard for monitoring:
2024-07-25 16:18:00 +08:00
2026-03-29 00:10:26 +01:00
- Factor performance metrics
- Model architecture evolution
- Cumulative returns and drawdowns
- Code diffs and implementation history
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
---
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
## Project Structure
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
```
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
```
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
---
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
## Data Setup
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
Predix uses 1-minute EUR/USD data. To prepare your dataset:
2024-08-02 16:22:06 +08:00
2026-03-29 00:10:26 +01:00
```bash
# Run the data setup script (if provided)
./setup_predix_eurusd.sh
2024-08-02 16:22:06 +08:00
2026-03-29 00:10:26 +01:00
# Or manually place data in:
# ~/.qlib/qlib_data/eurusd_1min_data/
```
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
Expected data columns: `$open` , `$close` , `$high` , `$low` , `$volume`
2024-10-31 12:49:38 +08:00
2026-03-29 00:10:26 +01:00
---
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
## CLI Commands
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
| 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 |
2024-08-09 19:55:35 +08:00
2026-03-29 00:10:26 +01:00
---
2024-07-25 15:35:47 +08:00
2026-03-29 00:10:26 +01:00
## Requirements
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
Core dependencies (see [`requirements.txt` ](requirements.txt ) for full list):
2024-08-01 18:21:48 +08:00
2026-03-29 00:10:26 +01:00
- **LLM**: `openai` , `litellm`
- **Data**: `pandas` , `numpy` , `pyarrow`
- **ML**: `scikit-learn` , `lightgbm` , `xgboost`
- **Backtesting**: `qlib` (via Docker)
- **UI**: `streamlit` , `plotly` , `flask`
2024-06-27 10:12:58 +00:00
2026-03-29 00:10:26 +01:00
---
2024-06-21 16:41:34 +08:00
2026-03-29 00:10:26 +01:00
## License
2024-06-21 16:41:34 +08:00
2026-03-29 00:10:26 +01:00
This project is licensed under the **MIT License** – see the [`LICENSE` ](LICENSE ) file for details.
2024-06-21 16:41:34 +08:00
2026-04-02 20:35:57 +02:00
### Attribution Requirements
If you use this code or concepts in your project, you **must** :
1. Include the MIT License text
2. Keep the copyright notice: "Copyright (c) 2025 Predix Team"
3. Provide attribution to the original project
See [`ATTRIBUTION.md` ](ATTRIBUTION.md ) for detailed guidelines and examples.
2026-03-29 00:10:26 +01:00
---
2024-06-21 16:41:34 +08:00
2026-03-29 00:10:26 +01:00
## Contributing
2024-07-30 20:15:47 +08:00
2026-03-29 00:10:26 +01:00
Contributions are welcome! Please:
2024-07-30 20:15:47 +08:00
2026-03-29 00:10:26 +01:00
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
2024-07-30 20:15:47 +08:00
2026-03-29 00:10:26 +01:00
For major changes, please open an issue first to discuss your approach.
2024-08-06 15:00:41 +08:00
2026-03-29 00:10:26 +01:00
---
2024-08-06 15:00:41 +08:00
2026-03-29 00:10:26 +01:00
## Citation
2024-07-30 20:15:47 +08:00
2026-03-29 00:10:26 +01:00
If you use Predix in your research, please cite the underlying framework:
2024-07-30 20:15:47 +08:00
2026-03-29 00:10:26 +01:00
```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}
2025-05-22 15:37:34 +08:00
}
```
2024-04-02 21:04:09 -07:00
2026-03-29 00:10:26 +01:00
---
2025-03-21 08:56:13 +01:00
2026-03-29 00:10:26 +01:00
## Support
2025-03-21 08:56:13 +01:00
2026-03-29 00:10:26 +01:00
- **Issues**: [GitHub Issues ](https://github.com/PredixAI/predix/issues )
- **Documentation**: [Read the Docs ](https://rdagent.readthedocs.io/ )
2024-08-09 21:32:32 +08:00
2026-03-29 00:10:26 +01:00
---
2024-06-21 16:41:34 +08:00
2026-03-29 00:10:26 +01:00
## Disclaimer
2024-04-02 21:04:09 -07:00
2026-03-29 00:10:26 +01:00
Predix is provided "as is" for **research and educational purposes only** . It is **not** intended for:
2024-04-02 21:04:09 -07:00
2026-03-29 00:10:26 +01:00
- Live trading or financial advice
- Production use without thorough testing
- Replacement of qualified financial professionals
2024-08-28 16:35:25 +08:00
2026-03-29 00:10:26 +01:00
Users assume all liability and should comply with applicable laws and regulations in their jurisdiction. Past performance does not guarantee future results.