#!/bin/bash
set -euo pipefail
cd /home/hoon/kis_bot
mkdir -p logs
TS=$(date +%Y%m%d_%H%M%S)
STUDY="breakout_wide_20260715_${TS}"
LOG="logs/param_search_optuna_breakout_wide_${TS}.log"
echo "$LOG" > logs/param_search_optuna_breakout_wide_latest.logpath
echo "$STUDY" > logs/param_search_optuna_breakout_wide_latest.study
# wide 축 스크리닝 — apply 없음. 아침 fine/최빈은 wide Top 확인 후.
nohup python3 -u kis_trader/backtest/param_search_optuna.py \
  --strategy breakout \
  --mode wide \
  --start 2026-07-15 \
  --end 2026-07-15 \
  --trials 100 \
  --min_trades 1 \
  --min_win_rate 0 \
  --min_pf 0 \
  --sort-by pnl \
  --orderbook-filter off \
  --no-progress \
  --study-name "$STUDY" \
  > "$LOG" 2>&1 &
echo "PID=$!"
echo "STUDY=$STUDY"
echo "LOG=/home/hoon/kis_bot/$LOG"
echo "tail -f /home/hoon/kis_bot/$LOG"
