初始提交:纯信号量化交易系统 v1.0
策略:纯信号模式(不定期换仓,止损止盈卖出后因子选股补仓) 股票池:沪深300+中证500(800+只) 止损-8% / 止盈+25% / 单只20% / 最多5只 5年回测:+371.7%,夏普0.82,年化21.3% 组件: - engine.py: 核心交易引擎 + 因子评分 + 数据管理 - scheduler.py: APScheduler定时调度 + HTTP状态接口 - trade_tool.py: 命令行工具 - config.json: 策略参数配置 - Dockerfile + docker-compose.yml: 容器化部署 日志系统: - 文件日志(按日轮转,保留90天) - SQLite: trades/daily_log/signal_log/system_log
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
LABEL maintainer="trading-signal"
|
||||
LABEL description="A股纯信号量化交易系统"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 系统依赖
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tzdata curl && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python依赖
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 应用代码
|
||||
COPY scripts/ /app/scripts/
|
||||
COPY config/ /app/config/
|
||||
|
||||
# 数据和日志通过volume挂载
|
||||
VOLUME ["/app/data", "/app/logs"]
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=60s --timeout=10s --retries=3 \
|
||||
CMD test -f /app/data/state.json || exit 1
|
||||
|
||||
# 启动
|
||||
CMD ["python3", "-u", "/app/scripts/scheduler.py"]
|
||||
Reference in New Issue
Block a user