fix: привязать scheduler к закрытию свечей (cron :05 UTC)
Было: interval каждые 2h с момента старта (случайное время). Стало: cron 0:05,2:05,4:05... — 5 мин после закрытия свечи, чтобы данные были полностью сформированы. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -234,8 +234,11 @@ def daemon():
|
||||
scheduler.add_job(scheduled_cycle, "cron", hour=hour, minute=minute)
|
||||
click.echo(f"Scheduled: daily at {cfg.check_time}")
|
||||
else:
|
||||
scheduler.add_job(scheduled_cycle, "interval", hours=min_hours)
|
||||
click.echo(f"Scheduled: every {min_hours} hours (fastest TF: {min_tf})")
|
||||
# Align to candle close times (UTC): e.g. 2H → 0,2,4,6...
|
||||
# +5 min offset to ensure candle is fully closed on exchange
|
||||
cron_hours = ",".join(str(h) for h in range(0, 24, min_hours))
|
||||
scheduler.add_job(scheduled_cycle, "cron", hour=cron_hours, minute=5)
|
||||
click.echo(f"Scheduled: every {min_hours}h at :05 UTC (hours: {cron_hours})")
|
||||
|
||||
scheduler.start()
|
||||
click.echo("Daemon started. Web dashboard + scheduler running.")
|
||||
|
||||
Reference in New Issue
Block a user