#!/bin/bash
# deploy_strategy.sh
# 策略部署脚本：从 Gitea 部署到 freqtrade Docker
# 用法：bash scripts/deploy_strategy.sh [策略版本]
# 示例：bash scripts/deploy_strategy.sh strategies/current/structure_flow_strategy_v2_2d.py

STRATEGY_FILE="${1:-strategies/current/structure_flow_strategy_v2_2d.py}"
FREQTRADE_DIR="/home/ubuntu/freqtrade"

echo "部署策略: ${STRATEGY_FILE}"
cp "${STRATEGY_FILE}" "${FREQTRADE_DIR}/user_data/strategies/"
echo "已复制到 freqtrade user_data/strategies/"

echo "重启 Docker..."
cd "${FREQTRADE_DIR}"
docker-compose down && docker-compose up -d
echo "部署完成"
