[2026-05-18] 장 전 재시작(08:30~09:00) AI 컨텍스트 즉시 로드 처리 추가
This commit is contained in:
+17
-1
@@ -428,12 +428,28 @@ async def run():
|
|||||||
|
|
||||||
now = datetime.now().strftime("%H:%M")
|
now = datetime.now().strftime("%H:%M")
|
||||||
if "09:00" <= now <= "14:30":
|
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.update_universe()
|
||||||
await bot.calc_targets()
|
await bot.calc_targets()
|
||||||
await bot.trading_loop() # 바로 매매루프 진입
|
await bot.trading_loop() # 바로 매매루프 진입
|
||||||
return
|
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:
|
while True:
|
||||||
now = datetime.now().strftime("%H:%M")
|
now = datetime.now().strftime("%H:%M")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user