#!/bin/bash
# [2026-10-04] after the flow history finishes: build library v3, then replay the Star bot design (24 days)
L=/var/www/screener/premarket/data/after_flows.log
while pgrep -f "^python3 history_flows.py|^/usr/bin/python3 history_flows.py" >/dev/null; do sleep 120; done
echo "flows done $(date +%T)" >> $L
cd /var/www/screener/trade/reports/playbook && nice -n 5 python3 lib_v3.py >> $L 2>&1
echo "lib_v3 built $(date +%T)" >> $L
cd /var/www/screener/premarket && nice -n 5 python3 star_replay.py --sim 0.90 --refs 30 > data/star_replay_90_30.log 2>&1
echo "REPLAY_DONE $(date +%T)" >> $L
