Skip to content

Commit f489fa2

Browse files
authored
Merge pull request #2 from icojerrel/claude/continue-work-011CUq1JWCHDeiRR6WoX9U33
2 parents 3cf9920 + f7d0192 commit f489fa2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11296
-1
lines changed

.dockerignore

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Moon Dev AI Agents - Docker Ignore
2+
3+
# Environment files
4+
.env
5+
.env.local
6+
.env.*.local
7+
8+
# Python
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
*.so
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
30+
# Virtual environments
31+
venv/
32+
ENV/
33+
env/
34+
tflow/
35+
36+
# IDEs
37+
.vscode/
38+
.idea/
39+
*.swp
40+
*.swo
41+
*~
42+
43+
# OS
44+
.DS_Store
45+
Thumbs.db
46+
47+
# Logs (will be mounted as volume)
48+
logs/
49+
*.log
50+
51+
# Data (will be mounted as volume)
52+
src/data/
53+
54+
# Git
55+
.git/
56+
.gitignore
57+
58+
# Documentation
59+
*.md
60+
docs/
61+
62+
# CI/CD
63+
.github/
64+
65+
# Test files
66+
tests/
67+
test_*.py
68+
*_test.py
69+
70+
# Temporary files
71+
tmp/
72+
temp/
73+
*.tmp
74+
75+
# Large files
76+
*.mp4
77+
*.avi
78+
*.mov
79+
*.mkv
80+
*.iso
81+
*.dmg
82+
83+
# Secrets
84+
credentials.json
85+
*.pem
86+
*.key
87+
*.cert

.env_example

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,42 @@ COINGECKO_API_KEY=your_coingecko_api_key_here
4747
# HYPER LIQUID ETH PRIVATE KEY - CAREFUL!
4848
HYPER_LIQUID_ETH_PRIVATE_KEY=your_hyper_liquid_eth_private_key_here
4949

50+
# MetaTrader 5 Credentials
51+
MT5_LOGIN=your_mt5_account_number
52+
MT5_PASSWORD=your_mt5_password
53+
MT5_SERVER=your_broker_server # e.g., "MetaQuotes-Demo", "ICMarkets-Demo", etc.
54+
MT5_PATH= # Optional: Path to MT5 terminal (leave empty for auto-detect)
55+
56+
# Telegram Alerting (Highly Recommended for Production)
57+
TELEGRAM_ALERTS_ENABLED=true
58+
TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 # Get from @BotFather
59+
TELEGRAM_CHAT_ID=123456789 # Your chat ID
60+
61+
# Discord Alerting (Optional)
62+
DISCORD_ALERTS_ENABLED=false
63+
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_url
64+
65+
# Email Alerting (Optional)
66+
EMAIL_ALERTS_ENABLED=false
67+
SMTP_SERVER=smtp.gmail.com
68+
SMTP_PORT=587
69+
70+
EMAIL_PASSWORD=your_app_password
71+
72+
73+
# Logging Configuration
74+
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
75+
JSON_LOGS=false # Set to true for structured JSON logs
76+
LOG_MAX_BYTES=10485760 # 10MB log file size before rotation
77+
LOG_BACKUP_COUNT=5 # Number of backup log files to keep
78+
MIN_ALERT_LEVEL=WARNING # Minimum level for alerts: INFO, WARNING, ERROR, CRITICAL
79+
80+
# Health Monitoring
81+
HEALTH_CHECK_INTERVAL=300 # Seconds between health checks (300 = 5 minutes)
82+
CPU_THRESHOLD=90.0 # CPU usage % threshold for alerts
83+
MEMORY_THRESHOLD=90.0 # Memory usage % threshold
84+
DISK_THRESHOLD=90.0 # Disk usage % threshold
85+
5086
# 🚨 SECURITY REMINDERS:
5187
# 1. Never print these values in logs
5288
# 2. Never share your .env file

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,7 @@ binance_trades.csv
156156

157157
# Ignore large video files (assistant)
158158
src/data/chat_agent/*.mov
159+
160+
# Test results
161+
tests/results/*.json
162+
logs/*.log

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Moon Dev AI Trading Agents - Production Dockerfile
2+
# Built with love by Moon Dev 🚀
3+
4+
FROM python:3.10.9-slim
5+
6+
# Set working directory
7+
WORKDIR /app
8+
9+
# Install system dependencies
10+
RUN apt-get update && apt-get install -y \
11+
git \
12+
build-essential \
13+
wget \
14+
curl \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
# Install TA-Lib (required for technical indicators)
18+
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
19+
tar -xzf ta-lib-0.4.0-src.tar.gz && \
20+
cd ta-lib/ && \
21+
./configure --prefix=/usr && \
22+
make && \
23+
make install && \
24+
cd .. && \
25+
rm -rf ta-lib ta-lib-0.4.0-src.tar.gz
26+
27+
# Copy requirements first (for better caching)
28+
COPY requirements.txt .
29+
30+
# Install Python dependencies
31+
RUN pip install --no-cache-dir -r requirements.txt
32+
33+
# Copy application code
34+
COPY . .
35+
36+
# Create necessary directories
37+
RUN mkdir -p logs data
38+
39+
# Set environment variables
40+
ENV PYTHONUNBUFFERED=1
41+
ENV LOG_LEVEL=INFO
42+
ENV TZ=UTC
43+
44+
# Health check
45+
HEALTHCHECK --interval=5m --timeout=30s --start-period=1m --retries=3 \
46+
CMD python -c "import sys; sys.exit(0)"
47+
48+
# Default command (can be overridden in docker-compose)
49+
CMD ["python", "src/main.py"]

Dockerfile.test

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# 🌙 Moon Dev's 24-Hour Trading Test Docker Image
2+
# Optimized for running comprehensive trading system tests
3+
4+
FROM python:3.11-slim
5+
6+
# Set working directory
7+
WORKDIR /app
8+
9+
# Install system dependencies
10+
RUN apt-get update && apt-get install -y \
11+
gcc \
12+
g++ \
13+
git \
14+
curl \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
# Copy requirements first (for better caching)
18+
COPY requirements.txt .
19+
20+
# Install Python dependencies
21+
RUN pip install --no-cache-dir -r requirements.txt
22+
23+
# Copy the entire project
24+
COPY . .
25+
26+
# Create directories for test results and data
27+
RUN mkdir -p /app/tests/results \
28+
/app/src/data/mt5 \
29+
/app/logs
30+
31+
# Set environment variables
32+
ENV PYTHONUNBUFFERED=1
33+
ENV PYTHONPATH=/app
34+
35+
# Health check (check if test is still running)
36+
HEALTHCHECK --interval=5m --timeout=30s --start-period=1m --retries=3 \
37+
CMD python -c "import sys; from pathlib import Path; sys.exit(0 if Path('/app/tests/results').exists() else 1)"
38+
39+
# Default command: run 24-hour test with --skip-mt5 flag (for Docker)
40+
# Note: MT5 requires Windows, so we skip actual MT5 connection in Docker
41+
# The test will still test all other functionality (AI decisions, risk management, etc.)
42+
CMD ["python", "tests/test_24h_trading.py", "--duration", "24", "--interval", "15", "--skip-mt5"]

0 commit comments

Comments
 (0)