auto_trade_sys/scripts/apply_mainstream_opportunity.sh
薇薇安 44d1a51001 1
2026-06-16 11:09:20 +08:00

38 lines
1005 B
Bash
Executable File
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.

#!/usr/bin/env bash
# 主流币机会档:解决「白名单内长期 ranging → 零下单」
#
# 核心AUTO_TRADE_ALLOW_RANGING=true震荡市仍靠 RANGING_MARKET_SIGNAL_BOOST(+2) 抬高门槛
# 详见 config/my_batch_mainstream_opportunity.json
#
# 用法(项目根):
# ./scripts/apply_mainstream_opportunity.sh
# ./scripts/apply_mainstream_opportunity.sh --dry-run
#
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_mainstream_opportunity.json" \
--updated-by "mainstream_opportunity" \
"${DRY_RUN[@]}"