Files
openclaw-trading/scripts/start.sh
OpenClaw Trading 4ae8061172 初始提交:纯信号量化交易系统 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
2026-04-05 16:59:50 +08:00

30 lines
850 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 交易系统启动脚本直接在host上运行
set -e
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
SCRIPTS_DIR="$BASE_DIR/scripts"
LOG_DIR="$BASE_DIR/logs"
DATA_DIR="$BASE_DIR/data"
mkdir -p "$LOG_DIR" "$DATA_DIR"
# 检查依赖
python3 -c "import tushare, numpy, pandas" 2>/dev/null || {
echo "安装依赖..."
pip3 install --break-system-packages tushare numpy pandas APScheduler
}
# 设置环境变量
export TZ=Asia/Shanghai
export TUSHARE_TOKEN="${TUSHARE_TOKEN:-4348b35f0b5c7a85b988264e4962be1ca57e0f46faf6148806e5ebd4}"
echo "========================================"
echo "🚀 启动纯信号交易系统"
echo "========================================"
echo "日志目录: $LOG_DIR"
echo "数据目录: $DATA_DIR"
echo "========================================"
exec python3 -u "$SCRIPTS_DIR/scheduler.py"