From 566ecd678e1140df485ec81f85130984a37c0dce Mon Sep 17 00:00:00 2001 From: jongjae Date: Mon, 18 May 2026 08:40:11 +0900 Subject: [PATCH] =?UTF-8?q?[2026-05-18]=20=EC=9E=A5=20=EC=A0=84=20?= =?UTF-8?q?=EC=9E=AC=EC=8B=9C=EC=9E=91(08:30~09:00)=20AI=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=A6=89=EC=8B=9C=20=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index c9b39c7..e560060 100644 --- a/app/main.py +++ b/app/main.py @@ -428,12 +428,28 @@ async def run(): now = datetime.now().strftime("%H:%M") if "09:00" <= now <= "14:30": - logger.info("장 중 재시작 감지 → 유니버스/목표가 즉시 계산") + logger.info("장 중 재시작 감지 → AI 컨텍스트 로드 + 유니버스/목표가 즉시 계산") + ctx = bot.strategy.load_ai_context() + await notify_ai_result( + ctx["market_sentiment"], + ctx["sentiment_score"], + ctx.get("hot_sectors", []), + ctx.get("avoid_sectors", []), + ctx.get("reason", ""), + ) + bot.risk.set_risk_level(ctx.get("risk_level", "보통")) await bot.update_universe() await bot.calc_targets() await bot.trading_loop() # 바로 매매루프 진입 return + # 08:30 이후~09:00 이전 시작 시 컨텍스트·유니버스 즉시 로드 + if "08:30" <= now < "09:00": + logger.info("장 전 재시작 감지(08:30~09:00) → AI 컨텍스트 로드 + 유니버스 즉시 갱신") + ctx = bot.strategy.load_ai_context() + bot.risk.set_risk_level(ctx.get("risk_level", "보통")) + await bot.update_universe() + while True: now = datetime.now().strftime("%H:%M")