# Trading Platform — TODO > Last updated: 2026-04-01 ## Current State - **268 tests passing**, lint clean - 6 microservices (data-collector, strategy-engine, order-executor, portfolio-manager, backtester, api) + CLI + shared library - 8 trading strategies (RSI, Grid, MACD, Bollinger, EMA Crossover, VWAP, Volume Profile, Combined) - Operations: SQLAlchemy ORM, Alembic migrations, structlog, Telegram alerts, resilience, Prometheus + Grafana - Monitoring: Prometheus, Grafana (provisioned dashboard), Loki + Promtail log aggregation - Security: Bearer token auth on /health and /metrics endpoints - CI/CD: Gitea Actions workflow, standalone CI script - REST API: FastAPI with portfolio, orders, strategies endpoints - Advanced risk: trailing stop-loss, volatility-based position sizing, max open positions - Multi-exchange: ccxt factory supporting any exchange (Binance, Bybit, OKX, Kraken, etc.) --- ## All Completed ### Critical (Deployment Blockers) - [x] Alembic 초기 마이그레이션 (6 테이블) - [x] Docker Compose 헬스체크 포트 노출 (8080-8083) - [x] numpy 의존성 추가 ### High Priority - [x] CLI 명령어 구현 (backtest, strategy, portfolio, data) - [x] Backtester sys.path 해킹 제거 (STRATEGIES_DIR 환경변수) - [x] Integration tests (7개) - [x] Dockerfile 의존성 정리 + PYTHONPATH 설정 ### Medium Priority - [x] Edge case tests (30개: zero volume, empty data, extreme values, reset, notifier) - [x] DB transaction rollback + transaction() context manager - [x] Portfolio snapshots (주기적 저장 + Telegram 일일 요약) - [x] Strategy parameter validation (41 tests, 7 strategies) - [x] VWAP division by zero 버그 수정 ### Low Priority - [x] Grafana dashboard provisioning (7-panel trading overview) - [x] Multi-exchange support (ccxt factory) - [x] REST API (FastAPI: portfolio, orders, strategies) - [x] Strategy combination framework (weighted voting) - [x] Advanced risk management (trailing stop, volatility sizing, position limits) - [x] Loki + Promtail log aggregation - [x] CI/CD pipeline (Gitea Actions + scripts/ci.sh) - [x] Docker E2E test script (scripts/e2e-test.sh) - [x] Security hardening (bearer token auth on endpoints) --- ## Future Ideas (Not Planned) - WebSocket 기반 실시간 대시보드 - 백테스트 결과 시각화 (matplotlib/plotly 차트) - 분산 추적 (OpenTelemetry) - 멀티 타임프레임 전략 - 머신러닝 기반 시그널 필터 - 주문 유형 확장 (LIMIT, STOP_LIMIT, OCO) - Kubernetes 배포 설정 --- ## Quick Start (개발 환경) ```bash # 1. 환경 설정 cp .env.example .env # .env에 BINANCE_API_KEY, BINANCE_API_SECRET 입력 # 2. 의존성 설치 pip install -e shared/ # 3. 인프라 실행 make infra # 4. DB 마이그레이션 make migrate # 5. 테스트 make test # 6. 서비스 실행 make up # 7. API 접근 curl http://localhost:8000/api/v1/strategies curl http://localhost:8000/api/v1/portfolio/positions # 8. 모니터링 docker compose --profile monitoring up -d # Grafana: http://localhost:3000 (admin/admin) # Prometheus: http://localhost:9090 # 9. CLI 사용 trading strategy list trading backtest run --strategy rsi --symbol BTCUSDT --from 2025-01-01 --to 2025-12-31 trading portfolio show # 10. E2E 테스트 make e2e # 11. CI make ci ```