mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-02 01:27:24 -04:00
Compare commits
4 Commits
v0.2.0-alp
...
v0.2.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 8142f38ab9 | |||
| 595a659fe7 | |||
| a4bc4fd0de | |||
| 4666e09385 |
@@ -6,11 +6,11 @@
|
||||
|
||||
# AI Model API Configuration
|
||||
OPENAI_API_BASE=https://your-openai-proxy.com/v1
|
||||
OPENAI_API_KEY=your_openai_key_here
|
||||
OPENAI_API_KEY=your_openai_key_here # https://platform.openai.com/api-keys
|
||||
|
||||
# Data Source Configuration
|
||||
ALPHAADVANTAGE_API_KEY=your_alphavantage_key_here
|
||||
JINA_API_KEY=your_jina_key_here
|
||||
ALPHAADVANTAGE_API_KEY=your_alphavantage_key_here # https://www.alphavantage.co/support/#api-key
|
||||
JINA_API_KEY=your_jina_key_here # https://jina.ai/
|
||||
|
||||
# System Configuration (Docker default paths)
|
||||
RUNTIME_ENV_PATH=/app/data/runtime_env.json
|
||||
|
||||
12
README.md
12
README.md
@@ -218,7 +218,7 @@ AI-Trader Bench/
|
||||
|
||||
```bash
|
||||
# 1. Clone project
|
||||
git clone https://github.com/HKUDS/AI-Trader.git
|
||||
git clone https://github.com/Xe138/AI-Trader.git
|
||||
cd AI-Trader
|
||||
|
||||
# 2. Install dependencies
|
||||
@@ -331,7 +331,7 @@ The easiest way to run AI-Trader is with Docker Compose:
|
||||
|
||||
```bash
|
||||
# 1. Clone and setup
|
||||
git clone https://github.com/HKUDS/AI-Trader.git
|
||||
git clone https://github.com/Xe138/AI-Trader.git
|
||||
cd AI-Trader
|
||||
|
||||
# 2. Configure environment
|
||||
@@ -590,8 +590,8 @@ We welcome contributions of all kinds! Especially AI trading strategies and agen
|
||||
|
||||
## 📞 Support & Community
|
||||
|
||||
- **💬 Discussions**: [GitHub Discussions](https://github.com/HKUDS/AI-Trader/discussions)
|
||||
- **🐛 Issues**: [GitHub Issues](https://github.com/HKUDS/AI-Trader/issues)
|
||||
- **💬 Discussions**: [GitHub Discussions](https://github.com/Xe138/AI-Trader/discussions)
|
||||
- **🐛 Issues**: [GitHub Issues](https://github.com/Xe138/AI-Trader/issues)
|
||||
|
||||
## 📄 License
|
||||
|
||||
@@ -615,8 +615,8 @@ The materials provided by the AI-Trader project are for research purposes only a
|
||||
|
||||
**🌟 If this project helps you, please give us a Star!**
|
||||
|
||||
[](https://github.com/HKUDS/AI-Trader)
|
||||
[](https://github.com/HKUDS/AI-Trader)
|
||||
[](https://github.com/Xe138/AI-Trader)
|
||||
[](https://github.com/Xe138/AI-Trader)
|
||||
|
||||
**🤖 Experience AI's full potential in financial markets through complete autonomous decision-making!**
|
||||
**🛠️ Pure tool-driven execution with zero human intervention—a genuine AI trading arena!** 🚀
|
||||
|
||||
@@ -26,10 +26,10 @@ def get_daily_price(SYMBOL: str):
|
||||
url = f'https://www.alphavantage.co/query?function={FUNCTION}&symbol={SYMBOL}&outputsize={OUTPUTSIZE}&apikey={APIKEY}'
|
||||
r = requests.get(url)
|
||||
data = r.json()
|
||||
print(data)
|
||||
if data.get('Note') is not None or data.get('Information') is not None:
|
||||
print(f"Error")
|
||||
print(f"⚠️ {SYMBOL}: API rate limit or error - {data.get('Note') or data.get('Information')}")
|
||||
return
|
||||
print(f"✓ Fetched {SYMBOL}")
|
||||
with open(f'./daily_prices_{SYMBOL}.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
if SYMBOL == "QQQ":
|
||||
|
||||
@@ -34,4 +34,4 @@ services:
|
||||
- "${TRADE_HTTP_PORT:-8002}:8002"
|
||||
- "${GETPRICE_HTTP_PORT:-8003}:8003"
|
||||
- "${WEB_HTTP_PORT:-8888}:8888"
|
||||
restart: unless-stopped
|
||||
restart: on-failure:3 # Restart max 3 times on failure, prevents endless loops
|
||||
|
||||
@@ -3,6 +3,40 @@ set -e # Exit on any error
|
||||
|
||||
echo "🚀 Starting AI-Trader..."
|
||||
|
||||
# Validate required environment variables
|
||||
echo "🔍 Validating environment variables..."
|
||||
MISSING_VARS=()
|
||||
|
||||
if [ -z "$OPENAI_API_KEY" ]; then
|
||||
MISSING_VARS+=("OPENAI_API_KEY")
|
||||
fi
|
||||
|
||||
if [ -z "$ALPHAADVANTAGE_API_KEY" ]; then
|
||||
MISSING_VARS+=("ALPHAADVANTAGE_API_KEY")
|
||||
fi
|
||||
|
||||
if [ -z "$JINA_API_KEY" ]; then
|
||||
MISSING_VARS+=("JINA_API_KEY")
|
||||
fi
|
||||
|
||||
if [ ${#MISSING_VARS[@]} -gt 0 ]; then
|
||||
echo ""
|
||||
echo "❌ ERROR: Missing required environment variables:"
|
||||
for var in "${MISSING_VARS[@]}"; do
|
||||
echo " - $var"
|
||||
done
|
||||
echo ""
|
||||
echo "Please set these variables in your .env file:"
|
||||
echo " 1. Copy .env.example to .env"
|
||||
echo " 2. Edit .env and add your API keys"
|
||||
echo " 3. Restart the container"
|
||||
echo ""
|
||||
echo "See docs/DOCKER.md for more information."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Environment variables validated"
|
||||
|
||||
# Step 1: Data preparation
|
||||
echo "📊 Fetching and merging price data..."
|
||||
# Run scripts from /app/scripts but output to /app/data
|
||||
|
||||
Reference in New Issue
Block a user