auto_trade_sys/scripts/apply_hybrid_whitelist.sh
薇薇安 013f8df750 1
2026-06-16 11:18:09 +08:00

39 lines
1007 B
Bash
Executable File
Raw 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.

#!/usr/bin/env bash
# 混合白名单档4 主流 + 4 高流动山寨,并开启 ranging 机会档
#
# 白名单BTC, ETH, BNB, SOL + LINK, DOGE, AVAX, XRP
# 山寨(LINK/DOGE/AVAX/XRP) 走 MANUAL_REDUCED仓位×0.5,信号+1
# 详见 config/my_batch_hybrid_whitelist.json
#
# 用法(项目根):
# ./scripts/apply_hybrid_whitelist.sh --dry-run
# ./scripts/apply_hybrid_whitelist.sh
#
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
PYTHON_BIN=""
for _py in \
"${ROOT}/.venv/bin/python" \
"${ROOT}/trading_system/.venv/bin/python" \
"${ROOT}/backend/.venv/bin/python"; do
if [ -x "$_py" ]; then
PYTHON_BIN="$_py"
break
fi
done
if [ -z "$PYTHON_BIN" ]; then
PYTHON_BIN="$(command -v python3)"
fi
DRY_RUN=()
if [[ "${1:-}" == "--dry-run" ]]; then
DRY_RUN=(--dry-run)
fi
exec "$PYTHON_BIN" "$ROOT/scripts/apply_config_patch_only.py" \
--from "$ROOT/config/my_batch_hybrid_whitelist.json" \
--updated-by "hybrid_whitelist" \
"${DRY_RUN[@]}"