--- name: cron_timing description: Crontab timing strategy — 30s offset from candle close, avoid collisions between scripts type: project --- ## Crontab 排程 | 排程 | 腳本 | 用途 | |------|------|------| | `*/5 * * * *` (sleep 30) | main.py | 交易 cycle(LLM 分析 + 執行) | | `0 * * * *` (sleep 30) | hourly_trend_report.py | 每小時 Slack 1h 趨勢報告(多頭/空頭) | | `2,32 * * * *` | sync_cost_basis.py | 成本基礎同步 | | `7 * * * *` | check_errors.py | 錯誤監控 | **Why:** Bitfinex 5 分鐘 K 線在整點收盤(:00, :05, :10...),延遲 30 秒確保數據到位。sync_cost_basis 在 :02/:32 避免衝突。趨勢報告在 :00:30 發送。 **How to apply:** crontab 不支援秒,用 `sleep 30 &&` 實現。修改排程時維持此偏移策略,注意避免 Bitfinex API rate limit。