"""
dashboard_refresh.py — regenerate dashboard/index.html without sending Telegram.
Runs every 5 min during market hours via cron.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))

from compute_perf import compute_daily_perf, get_open_positions, get_last_cycle_info, generate_html_dashboard

perf = compute_daily_perf()
open_positions = get_open_positions()
cycle_ts, cycle_status = get_last_cycle_info()
f = generate_html_dashboard(perf, open_positions, cycle_ts, cycle_status)
print(f"Dashboard refreshed: {f}")
