5.2 KiB
Crypto Trading Agents
🛠️ Usage Guide
Installation
Clone the repository:
git clone https://github.com/Tomortec/CryptoTradingAgents.git
cd TradingAgents
Create a virtual environment:
conda create -n tradingagents python=3.13
conda activate tradingagents
Install dependencies:
pip install -r requirements.txt
Configuration
Configure LLM API Key
Create a .env file under the ./cli directory and fill in your LLM API key, such as:
For Qwen: DASHSCOPE_API_KEY=XXXXXX
For ChatGPT: OPENAI_API_KEY=XXXXXX
Configure Information Source API Keys
Also add the required API keys for data sources into the ./cli/.env file
Check and Modify Configuration
Edit ./tradingagents/default_config.py to change the language, LLM settings, and other default configurations.
(Optional) Configure Investment Preferences
Create a file named investment_preferences in the ./cli directory to define custom investment preferences.
Run the Program
Execute the main program from terminal:
python -m cli.main
Steps to Use
- Enter Asset Symbol, such as BTC or ETH
- Enter Analysis Date, consistent with the source project
- Select Analyst Team, consistent with the source project
- Choose Research Depth, consistent with the source project
- Import External Reports: Type
yand press Enter to open the default editor, where you can input external viewpoints for the model to consider. Save the file when done. - Import Investment Preferences: Use the saved file at
./cli/investment_preferencesor input them directly in the editor (optional). - Select LLM Model, consistent with the source project
- Generate Report: After processing, the report will be saved under
./tradingagents/reports. Example: BTC Analysis (Chinese Version)
Supported LLMs
| Name | API Variable | Tested |
|---|---|---|
| Qwen (by Alibaba) | DASHSCOPE_API_KEY |
✅ |
| ChatGPT (by OpenAI) | OPENAI_API_KEY |
✅ |
Supported Information Sources
| Source | Name | API Variable | Data Type | Registration |
|---|---|---|---|---|
| Alternative.me | Fear & Greed Index | None needed | Sentiment | N/A |
| Binance | K-line, market depth, 24h price change, long/short ratio | None needed | Market | N/A |
| Blockbeats | Blockbeats News | None needed | News | N/A |
| CoinDesk | CoinDesk News | COINDESK_API_KEY |
News | API Key Registration |
| CoinStats | CoinStats News | COINSTATS_API_KEY |
News | API Registration |
| Reddit Posts | REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET, REDDIT_USERNAME, REDDIT_PASSWORD, REDDIT_USER_AGENT |
Sentiment & News | Register App | |
| taapi.io | Technical indicators like EMA, MACD, RSI, Supertrend, Bollinger Bands, Three White Soldiers, etc. | TAAPI_API_KEY |
Technical Analysis | My Account |
Customization
Customize Prompts
Edit files under ./tradingagents/i18n/prompts
Customize Data Sources
Refer to ./tradingagents/dataflows/README.md
🔄 Planned Updates
- Add LLM search capabilities for richer information retrieval
- Enable automatic report delivery
- Improve prompt templates using latest LLM research
- Integrate additional price prediction tools
- Provide a UI interface
⚠️ Disclaimer
This project is for research and educational purposes only and does not constitute investment advice. Investing involves risk—make decisions cautiously.
We welcome contributions! Including but not limited to submitting issues, fixing bugs, adding features, improving documentation, and localization.
⭐️⭐️ If this project helps you, please consider giving us a star! ⭐️⭐️