fix: restore positions on restart and fix notify env loading
- restore_positions(): read Upbit balances on startup to prevent double-buying after restart - notify.py: read TOKEN/CHAT_ID inside _send() to avoid empty values when module is imported before load_dotenv() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
4
main.py
4
main.py
@@ -17,10 +17,14 @@ logging.basicConfig(
|
||||
)
|
||||
|
||||
from core.monitor import run_monitor
|
||||
from core.trader import restore_positions
|
||||
from daemon.runner import run_scanner
|
||||
|
||||
|
||||
def main() -> None:
|
||||
# 재시작 시 기존 잔고 복원 (이중 매수 방지)
|
||||
restore_positions()
|
||||
|
||||
# 트레일링 스탑 감시 스레드 (10초 주기)
|
||||
monitor_thread = threading.Thread(
|
||||
target=run_monitor, args=(10,), daemon=True, name="monitor"
|
||||
|
||||
Reference in New Issue
Block a user