From b289b4d9a0ca2f69cededa966fa369753042d3b0 Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Thu, 26 Mar 2026 11:22:07 +0900 Subject: [PATCH] ... --- README.md | 13 +++ src/main/kotlin/Main.kt | 178 ++++++++++++++++++++-------------------- 2 files changed, 101 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index e69de29..b6c9ab0 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,13 @@ +분석용 llm + +https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B-gguf-Q4_K_M + +llama-3-Korean-Bllossom-8B-Q4_K_M.gguf + + +뉴스용 임베디드 llm + +https://huggingface.co/Jackrong/Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled + +bge-m3-q4_k_m.gguf + diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index 0331d0f..6b37551 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -118,102 +118,100 @@ fun main() = application { ) if (isWindowOpen) { - Window(onCloseRequest = { isWindowOpen = false }, title = "KIS AI 자동매매", state = windowState) { - var currentScreen by remember { mutableStateOf(AppScreen.Settings) } - var isLoaded by remember { mutableStateOf(false) } - val scope = rememberCoroutineScope() - - // 1. 앱 시작 시 DB에서 마지막 설정 로드 (KisSession에 주입) - LaunchedEffect(Unit) { - DatabaseFactory.init() - transaction { - ConfigTable.selectAll().lastOrNull()?.let { - KisSession.config = AppConfig( - realAppKey = it[ConfigTable.realAppKey], - realSecretKey = it[ConfigTable.realSecretKey], - realAccountNo = it[ConfigTable.realAccountNo], - vtsAppKey = it[ConfigTable.vtsAppKey], - vtsSecretKey = it[ConfigTable.vtsSecretKey], - vtsAccountNo = it[ConfigTable.vtsAccountNo], - nAppKey = it[ConfigTable.nAppKey], - nSecretKey = it[ConfigTable.nSecretKey], - dAppKey = it[ConfigTable.dAppKey], - isSimulation = it[ConfigTable.isSimulation], - htsId = it[ConfigTable.htsId], - modelPath = it[ConfigTable.modelPath], - embedModelPath = it[ConfigTable.embedModelPath], - FEES_AND_TAXRATE = it[ConfigTable.fees_and_taxrate], - MINIMUM_NET_PROFIT = it[ConfigTable.minimum_net_profit], - BUY_WEIGHT = it[ConfigTable.buy_weight], - MAX_BUDGET = it[ConfigTable.max_budget], - MAX_PRICE = it[ConfigTable.max_price], - MIN_PRICE = it[ConfigTable.min_price], - MIN_PURCHASE_SCORE = it[ConfigTable.min_purchase_score], - SELL_PROFIT = it[ConfigTable.sell_profit], - GRADE_5_BUY = it[grade_5_buy], - GRADE_5_PROFIT = it[grade_5_profit], - GRADE_4_BUY = it[grade_4_buy], - GRADE_4_PROFIT = it[grade_4_profit], - GRADE_3_BUY = it[grade_3_buy], - GRADE_3_PROFIT = it[grade_3_profit], - GRADE_2_BUY = it[grade_2_buy], - GRADE_2_PROFIT = it[grade_2_profit], - GRADE_1_BUY = it[grade_1_buy], - GRADE_1_PROFIT = it[grade_1_profit], - MAX_COUNT = it[max_count], - ) + Window(onCloseRequest = { isWindowOpen = false }, title = "KIS AI 자동매매", state = windowState) { + var currentScreen by remember { mutableStateOf(AppScreen.Settings) } + var isLoaded by remember { mutableStateOf(false) } + // 1. 앱 시작 시 DB에서 마지막 설정 로드 (KisSession에 주입) + LaunchedEffect(Unit) { + DatabaseFactory.init() + transaction { + ConfigTable.selectAll().lastOrNull()?.let { + KisSession.config = AppConfig( + realAppKey = it[ConfigTable.realAppKey], + realSecretKey = it[ConfigTable.realSecretKey], + realAccountNo = it[ConfigTable.realAccountNo], + vtsAppKey = it[ConfigTable.vtsAppKey], + vtsSecretKey = it[ConfigTable.vtsSecretKey], + vtsAccountNo = it[ConfigTable.vtsAccountNo], + nAppKey = it[ConfigTable.nAppKey], + nSecretKey = it[ConfigTable.nSecretKey], + dAppKey = it[ConfigTable.dAppKey], + isSimulation = it[ConfigTable.isSimulation], + htsId = it[ConfigTable.htsId], + modelPath = it[ConfigTable.modelPath], + embedModelPath = it[ConfigTable.embedModelPath], + FEES_AND_TAXRATE = it[ConfigTable.fees_and_taxrate], + MINIMUM_NET_PROFIT = it[ConfigTable.minimum_net_profit], + BUY_WEIGHT = it[ConfigTable.buy_weight], + MAX_BUDGET = it[ConfigTable.max_budget], + MAX_PRICE = it[ConfigTable.max_price], + MIN_PRICE = it[ConfigTable.min_price], + MIN_PURCHASE_SCORE = it[ConfigTable.min_purchase_score], + SELL_PROFIT = it[ConfigTable.sell_profit], + GRADE_5_BUY = it[grade_5_buy], + GRADE_5_PROFIT = it[grade_5_profit], + GRADE_4_BUY = it[grade_4_buy], + GRADE_4_PROFIT = it[grade_4_profit], + GRADE_3_BUY = it[grade_3_buy], + GRADE_3_PROFIT = it[grade_3_profit], + GRADE_2_BUY = it[grade_2_buy], + GRADE_2_PROFIT = it[grade_2_profit], + GRADE_1_BUY = it[grade_1_buy], + GRADE_1_PROFIT = it[grade_1_profit], + MAX_COUNT = it[max_count], + ) + } } + + isLoaded = true + } - isLoaded = true - - } - - if (!isLoaded) { - // 로딩 중 표시 - CircularProgressIndicator() - } else { - when (currentScreen) { - AppScreen.Settings -> { - AutoTradingManager.onMarketClosed = { - println("프로그램 초기화 실행됨") - currentScreen = AppScreen.Settings - isWindowOpen = false - } - SettingsScreen( - onAuthSuccess = { - - // 2. 설정 및 인증 완료 시점의 처리 - val config = KisSession.config - AutoTradingManager.isSystemReadyToday = true - AutoTradingManager.isSystemCleanedUpToday = false - - CoroutineScope(Dispatchers.Default).launch { - AutoTradingManager.startAutoDiscoveryLoop() - KisWebSocketManager.onExecutionReceived = AutoTradingManager.onExecutionReceived - KisWebSocketManager.connect() - } - - if (config.modelPath.isNotEmpty()) { - LlamaServerManager.startServer(binPath, config.modelPath,port = 8080) - } - if (config.embedModelPath.isNotEmpty()) { - LlamaServerManager.startServer(binPath, config.embedModelPath, port = 8081) - } - - // 대시보드로 화면 전환 - currentScreen = AppScreen.TradingDecision + if (!isLoaded) { + // 로딩 중 표시 + CircularProgressIndicator() + } else { + when (currentScreen) { + AppScreen.Settings -> { + AutoTradingManager.onMarketClosed = { + println("프로그램 초기화 실행됨") + currentScreen = AppScreen.Settings + isWindowOpen = false } - ) - } - AppScreen.Dashboard -> { - DashboardScreen() - } - AppScreen.TradingDecision -> { - TradingDecisionLog() + SettingsScreen( + onAuthSuccess = { + + // 2. 설정 및 인증 완료 시점의 처리 + val config = KisSession.config + AutoTradingManager.isSystemReadyToday = true + AutoTradingManager.isSystemCleanedUpToday = false + + CoroutineScope(Dispatchers.Default).launch { + AutoTradingManager.startAutoDiscoveryLoop() + KisWebSocketManager.onExecutionReceived = AutoTradingManager.onExecutionReceived + KisWebSocketManager.connect() + } + + if (config.modelPath.isNotEmpty()) { + LlamaServerManager.startServer(binPath, config.modelPath,port = 8080) + } + if (config.embedModelPath.isNotEmpty()) { + LlamaServerManager.startServer(binPath, config.embedModelPath, port = 8081) + } + + // 대시보드로 화면 전환 + currentScreen = AppScreen.TradingDecision + } + ) + } + AppScreen.Dashboard -> { + DashboardScreen() + } + AppScreen.TradingDecision -> { + TradingDecisionLog() + } } } } } - } } \ No newline at end of file