#!/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[@]}"