#!/bin/bash
set -euo pipefail
cd /home/hoon/kis_bot
mkdir -p logs
TS=$(date +%Y%m%d_%H%M%S)
STUDY="tail_wide_20260715_${TS}"
LOG="logs/param_search_optuna_tail_wide_${TS}.log"
echo "$LOG" > logs/param_search_optuna_tail_wide_latest.logpath
echo "$STUDY" > logs/param_search_optuna_tail_wide_latest.study
# 7/15 축 스크리닝 — apply 없음. 새 study-name 필수(wide 그리드 신규).
nohup python3 -u kis_trader/backtest/param_search_optuna.py \
  --strategy tail \
  --mode wide \
  --start 2026-07-15 \
  --end 2026-07-15 \
  --trials 100 \
  --min_trades 1 \
  --orderbook-filter off \
  --no-progress \
  --study-name "$STUDY" \
  > "$LOG" 2>&1 &
echo "PID=$!"
echo "STUDY=$STUDY"
echo "LOG=$LOG"
echo "tail -f /home/hoon/kis_bot/$LOG"
