Compare commits

...
20 Commits
Author SHA1 Message Date
KJG 488e4e72b3 Merge branch 'master' into g
* master:
  ...

# Conflicts:
#	src/main/kotlin/service/AutoTradingManager.kt
2026-05-19 13:35:00 +09:00
lun_admin 9af9f46748 ... 2026-05-18 17:56:26 +09:00
KJG e0fbe9a9a2 Merge branch 'master' into g
* master:
  ...
2026-05-18 13:04:26 +09:00
lun_admin 4c27d71701 ... 2026-05-18 13:03:10 +09:00
KJG 74abc6314d Merge branch 'master' into g
* master:
  ...

# Conflicts:
#	src/main/kotlin/service/AutoTradingManager.kt
2026-05-14 14:16:03 +09:00
KJG 92d0a84629 매입단가 손절 2026-05-14 13:29:51 +09:00
lun_admin b9ba8efc1a ... 2026-05-14 13:27:33 +09:00
KJG 27356f0fc2 Merge branch 'master' into g
* master:
  ...
2026-05-13 16:41:42 +09:00
lun_admin ad6d00ac39 ... 2026-05-13 11:37:57 +09:00
KJG b1d334a6cd bug fix 2026-05-11 09:57:39 +09:00
KJG 93907c2dac scrolling bug fix 2026-05-08 16:03:54 +09:00
KJG acd1b13760 스케줄로 안뜨게 2026-05-08 13:52:28 +09:00
KJG 81ce68e07b 버튼 눌러서 띄우기 2026-05-08 13:43:56 +09:00
KJG 95f43e105d 판매 로그 > 손절 처리 로그 수정 2026-05-08 10:59:13 +09:00
lun_admin 619407966e ... 2026-05-07 14:53:19 +09:00
lun_admin 6f98b0fde4 .. 2026-05-06 17:21:45 +09:00
lun_admin 5c00152de9 .. 2026-05-06 17:13:59 +09:00
lun_admin 07a66a3fa3 .. 2026-05-06 16:43:49 +09:00
lun_admin d7efc433bd .. 2026-05-06 15:53:55 +09:00
lun_admin 0413fa3e2e .. 2026-05-04 11:19:52 +09:00
15 changed files with 660 additions and 141 deletions
+8 -1
View File
@@ -88,7 +88,12 @@ fun getLlamaBinPath(): String {
}
// Windows NUC
os.contains("win") -> {
"$basePath/win-x64-n/llama-server.exe"
if (KisSession.tradeConfig.isLowPerformanceMonitoring) {
"$basePath/win-x64/llama-server.exe"
}
else {
"$basePath/win-x64-n/llama-server.exe"
}
}
else -> "$basePath/llama-server"
}
@@ -111,6 +116,7 @@ private var isAppStarted = false
fun main() = application {
if (!isAppStarted) {
initLogger(DETAILLOG)
KisSession.tradeConfig = KisSession.loadTradeConfig()
try {
val (port1, port2) = PortFinder.findAvailablePortPair(18080, false)
if (port1 > 18000 && port2 > port1) {
@@ -328,6 +334,7 @@ fun main() = application {
// DashboardScreen()
}
AppScreen.TradingDecision -> {
TradingDecisionLog()
}
}
+102 -6
View File
@@ -1,10 +1,17 @@
import androidx.compose.runtime.mutableStateListOf
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.serialization.Serializable
import model.AppConfig
import model.KisSession
import model.TradingDecision
import network.NewsService
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
import org.jetbrains.exposed.sql.javatime.datetime
import org.jetbrains.exposed.sql.transactions.experimental.suspendedTransactionAsync
import org.jetbrains.exposed.sql.transactions.transaction
import report.TradingReportManager
import report.TradingReportService
@@ -484,7 +491,18 @@ object TradingLogStore {
decision = decision.decision ?: "HOLD",
confidence = decision.confidence,
reason = decision.reason ?: ""
))
).apply {
if (KisSession.tradeConfig.useTagsShare.contains(this.decision) && KisSession.tradeConfig.useLogKeywordsShare.any {
reason.contains(
it
)
}) {
CoroutineScope(Dispatchers.Default).launch {
NewsService.sendTelegramMessage("${this@apply.decision}$stockName ${reason}")
}
}
}
)
}
}
@@ -498,26 +516,76 @@ object TradingLogStore {
decision = decision,
confidence = 100.0,
reason = log
)
).apply {
if (KisSession.tradeConfig.useTagsShare.contains(decision) && KisSession.tradeConfig.useLogKeywordsShare.any {
log.contains(
it
)
}) {
CoroutineScope(Dispatchers.Default).launch {
println("CALLED sendTelegramMessage")
NewsService.sendTelegramMessage("${this@apply.decision}$stockName ${log}")
}
}
}
)
}
}
fun addLog(tradingDecision: TradingDecision, decision: String, log: String) {
synchronized(this) {
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
decisionLogs.add(
LogEntry(
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
stockName = "${tradingDecision.stockName}[${tradingDecision.currentPrice}][]",
stockName = "${tradingDecision.stockName}[${tradingDecision.currentPrice}]",
decision = decision,
confidence = tradingDecision.confidence,
reason = log
)
).apply {
CoroutineScope(Dispatchers.Default).launch {
if (((tradingDecision.investmentGrade?.name?.length ?: 0) > 0 && KisSession.tradeConfig.useGradeShare.any {
tradingDecision.investmentGrade?.name?.contains(
it
) ?: false
})) {
NewsService.sendTelegramMessage("${this@apply.decision} ${tradingDecision.stockName}[${tradingDecision.currentPrice}] ${log}")
}
}
}
)
}
}
fun addWatchLog(tradingDecision: TradingDecision, decision: String, log: String) {
synchronized(this) {
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
decisionLogs.add(
LogEntry(
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
stockName = "${tradingDecision.stockName}[${tradingDecision.currentPrice}]",
decision = decision,
confidence = tradingDecision.confidence,
reason = log
).apply {
CoroutineScope(Dispatchers.Default).launch {
if (KisSession.tradeConfig.useTagsShare.contains(decision) && KisSession.tradeConfig.useLogKeywordsShare.any {
log.contains(
it
)
}) {
NewsService.sendTelegramMessage("${this@apply.decision} ${tradingDecision.stockName}[${tradingDecision.currentPrice}] ${log}")
}
}
}
)
}
}
fun addAnalyzer(name : String, code : String, log: String, positive : Boolean = false) {
synchronized(this) {
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
@@ -529,7 +597,17 @@ object TradingLogStore {
decision = if (positive) "ANALYZER" else "PASS",
confidence = 100.0,
reason = log
)
).apply {
if (KisSession.tradeConfig.useTagsShare.contains(decision) && KisSession.tradeConfig.useLogKeywordsShare.any {
log.contains(
it
)
}) {
CoroutineScope(Dispatchers.Default).launch {
NewsService.sendTelegramMessage("${this@apply.decision}$name[$code] ${log}")
}
}
}
)
}
}
@@ -545,11 +623,29 @@ object TradingLogStore {
decision = "NOTICE",
confidence = 100.0,
reason = log
)
).apply {
if (KisSession.tradeConfig.useTagsShare.contains(decision) && KisSession.tradeConfig.useLogKeywordsShare.any {
log.contains(
it
)
}) {
var current = System.currentTimeMillis()
var sendable = noticeFilter.filter { it.key.equals(code, true) && ((current - it.value) > 1000 * 60 * 30L)}.isNotEmpty()
if (sendable) {
CoroutineScope(Dispatchers.Default).launch {
NewsService.sendTelegramMessage("${this@apply.decision}$name[$code] ${log}")
}}
noticeFilter[code] = current
}
}
)
}
}
var noticeFilter = hashMapOf<String, Long>()
fun addNotice(name : String, code : String, log: String, qty: Int? = null) {
synchronized(this) {
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
+14
View File
@@ -240,6 +240,20 @@ class TradeConfig {
var start_buy_time : String = "08:55"
var end_buy_time : String = "15:10"
var enableOverSea : Boolean = false
var tlg_id : String = ""
var CYCLE_TIMEOUT = 15 * 60 * 1000L // 한 사이클 최대 10분
var WATCHDOG_CHECK_INTERVAL = 30 * 1000L // 30초마다 생존 확인
var STUCK_THRESHOLD = 7 * 60 * 1000L // 5분간 반응 없으면 'Stuck'으로 판단
var ONE_STOCK_ALYSIS_TIME = 180000L
var isLowPerformanceMonitoring: Boolean = false
var useGradeShare : List<String> = listOf("LEVEL_4","LEVEL_5")
var useTagsShare : List<String> = listOf("NOTICE", "WATCH")
var useLogKeywordsShare : List<String> = listOf("재분석")
var useAutoRepost : Boolean = false
var minusFilter : Double = 15.0
var plusFilter : Double = 15.0
var excuteCountOnMin : Int = 2
var autoSellOrder : Boolean = false
}
+24 -2
View File
@@ -17,6 +17,8 @@ import java.util.zip.ZipInputStream
import javax.xml.parsers.DocumentBuilderFactory
import kotlinx.serialization.encodeToString // 추가 필요
import java.nio.charset.Charset
@Serializable
data class StockItem(
val code: String,
@@ -29,6 +31,25 @@ object StockUniverseLoader {
private val json = Json { ignoreUnknownKeys = true; prettyPrint = true }
private const val DEFAULT_FILE_PATH = "stocks_universe.json"
fun readSafeLines(file: File): List<String> {
val eucKr = Charset.forName("EUC-KR")
val utf8 = Charsets.UTF_8
// 우선 EUC-KR로 읽어봄
val lines = file.readLines(eucKr)
// 첫 줄에서 한글이 깨졌는지 검사 (정규식 활용)
// 한글이 하나도 없고 깨진 특수문자만 있다면 UTF-8로 재시도
val hasKorean = lines.firstOrNull()?.any { it in '\uAC00'..'\uD7A3' } ?: false
return if (hasKorean) {
lines
} else {
println("⚠️ EUC-KR에서 한글 미검출. UTF-8로 재시도합니다.")
file.readLines(utf8)
}
}
fun loadUniverse(filePath: String = DEFAULT_FILE_PATH): List<Pair<String, String>> {
return try {
val file = File(filePath)
@@ -50,7 +71,8 @@ object StockUniverseLoader {
try {
val stockItems = items.map { StockItem(it.first, it.second) }
val jsonString = json.encodeToString(stockItems)
File(filePath).writeText(jsonString)
// File(filePath).writeText(jsonString)
File(filePath).writeText(jsonString, Charsets.UTF_8)
println("💾 [System] 유니버스 영구 저장 완료: 총 ${items.size}종목")
} catch (e: Exception) {
println("❌ 유니버스 저장 실패: ${e.message}")
@@ -61,7 +83,7 @@ object StockUniverseLoader {
fun parseAndMergeCsv(file: File, targetJsonPath: String = DEFAULT_FILE_PATH): List<Pair<String, String>> {
val newItems = mutableListOf<Pair<String, String>>()
try {
val lines = file.readLines()
val lines = readSafeLines(file)
if (lines.isEmpty()) return loadUniverse(targetJsonPath)
// 헤더 자동 추적
+62 -2
View File
@@ -45,7 +45,7 @@ object KisTradeService {
// [수정] 모든 로그(Headers + Body)를 찍도록 설정
install(Logging) {
logger = Logger.DEFAULT
level = LogLevel.NONE
level = LogLevel.ALL
}
}
@@ -331,7 +331,7 @@ object KisTradeService {
stockCode: String,
qty: String,
price: String,
isBuy: Boolean,
isBuy: Boolean = false,
orderDivision: String = "",
marketCode : String = "KRX"
): Result<String> {
@@ -766,4 +766,64 @@ object KisTradeService {
}
suspend fun reserveSell(stockCode: String,
qty: String,
price: String,
targetDate : String) :Result<String> {
val config = KisSession.config
val isDomestic = stockCode.length == 6 && stockCode.all { it.isDigit() }
val baseUrl = if (config.isSimulation) vtsUrl else prodUrl
// 계좌번호 처리: 8자리면 01 자동 추가
var pureAccount = config.accountNo.replace("-", "").trim()
if (pureAccount.length == 8) pureAccount += "01"
val cano = pureAccount.take(8)
val acntPrdtCd = pureAccount.takeLast(2)
val trId = "CTSC0008U"
return try {
val response = client.post("$baseUrl/uapi/${if(isDomestic) "domestic" else "overseas"}-stock/v1/trading/order-resv") {
header("authorization", "Bearer ${config.tradeToken}")
header("appkey", if (config.isSimulation) config.vtsAppKey else config.realAppKey)
header("appsecret", if (config.isSimulation) config.vtsSecretKey else config.realSecretKey)
header("tr_id", trId)
header("custtype", "P") // [해결] 필수 헤더 추가
header("Content-Type", "application/json")
setBody(mapOf(
"CANO" to cano,
"ACNT_PRDT_CD" to acntPrdtCd,
"PDNO" to stockCode,
"ORD_DVSN_CD" to "00",
"SLL_BUY_DVSN_CD" to "01",
"ORD_QTY" to qty,
"ORD_UNPR" to price,
"ORD_OBJT_CBLC_DVSN_CD" to "10",
"RSVN_ORD_END_DT" to targetDate
))
}
val body = response.body<JsonObject>() // [해결] Polymorphic 직렬화 에러 방지
val rtCd = body["rt_cd"]?.jsonPrimitive?.content
val msg = body["msg1"]?.jsonPrimitive?.content ?: "메시지 없음"
if (rtCd == "0") {
// 응답의 output 객체에서 주문 번호(ODNO) 추출
val orderNo = body["output"]?.jsonObject?.get("ODNO")?.jsonPrimitive?.content
?: body["output"]?.jsonObject?.get("odno")?.jsonPrimitive?.content // API마다 대소문자가 다를 수 있음
?: ""
Result.success(orderNo) // 성공 시 주문 번호 반환
} else {
val msg = body["msg1"]?.jsonPrimitive?.content ?: "메시지 없음"
Result.failure(Exception("❌ 오류 ($rtCd): $msg"))
}
} catch (e: Exception) { Result.failure(e) }
}
}
+68
View File
@@ -17,10 +17,14 @@ import io.ktor.client.request.post
import io.ktor.client.request.setBody
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.bodyAsText
import io.ktor.http.ContentType
import io.ktor.http.ContentType.Application.Json
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpStatusCode
import io.ktor.http.Parameters
import io.ktor.http.Url
import io.ktor.http.contentType
import io.ktor.network.tls.TLSConfigBuilder
import io.ktor.serialization.kotlinx.json.json
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
@@ -29,10 +33,16 @@ import model.KisSession
import model.NaverNewsResponse
import service.SafeScraper
import service.UrlCacheManager
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.URL
import java.net.URLEncoder
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoUnit
import java.util.Locale
import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLContext
import kotlin.Double
object NewsService {
@@ -122,4 +132,62 @@ object NewsService {
return ""
}
}
suspend fun sendTelegramMessage(data: String) {
Thread {
try {
var chatId = KisSession.tradeConfig.tlg_id
println("sendTelegramMessage $chatId")
sendViaSystemCurl("https://lunaticbum.kr/tlg/sendToMe.bjx",chatId,data)
} catch (e: Exception) {
e.printStackTrace()
}
}.start()
}
fun sendViaSystemCurl(url : String, chatId: String, message: String) {
try {
// 메시지 내 공백이나 한글이 깨지지 않도록 인코딩 (필수)
val encodedMessage = URLEncoder.encode(message, "UTF-8")
// OS 확인
val isWindows = System.getProperty("os.name").lowercase().contains("win")
val command = if (isWindows) {
// 윈도우용: 큰따옴표 이스케이프에 주의해야 합니다.
val jsonBody = "{\"id\":\"$chatId\",\"message\":\"$encodedMessage\"}"
listOf("cmd", "/c", "curl -s -X POST $url -H \"Content-Type: application/json\" -d \"$jsonBody\"")
} else {
// 맥/리눅스용: 홑따옴표를 사용하여 JSON 구조를 보호합니다.
val jsonBody = "{\"id\":\"$chatId\",\"message\":\"$encodedMessage\"}"
listOf("curl", "-s", "-X", "POST", url, "-H", "Content-Type: application/json", "-d", jsonBody)
}
val process = ProcessBuilder(command)
.redirectErrorStream(true) // 에러 출력(stderr)을 표준 출력(stdout)으로 합침
.start()
// 프로세스의 출력을 읽어오는 블록
BufferedReader(InputStreamReader(process.inputStream)).use { reader ->
val output = StringBuilder()
var line: String?
while (reader.readLine().also { line = it } != null) {
output.append(line).append("\n")
}
val exitCode = process.waitFor() // 프로세스가 종료될 때까지 대기
println("--- Telegram Curl Log Start ---")
println("Exit Code: $exitCode") // 0이면 성공, 그 외는 curl 에러 코드
println("Response:\n$output")
println("--- Telegram Curl Log End ---")
}
} catch (e: Exception) {
println("시스템 명령어 실행 중 예외 발생: ${e.message}")
e.printStackTrace()
}
}
}
-3
View File
@@ -671,9 +671,6 @@ object RagService {
val alignmentBonus = if (s.ultraShort > s.shortTerm && s.shortTerm > s.midTerm) 3.0 else 0.0
return (base + alignmentBonus).coerceIn(0.0, 25.0)
}
}
@@ -103,6 +103,32 @@ object LocalReportGenerator {
}
}
fun generateAndOpenAsyncDirectly(
summary: RawSummaryData,
rawHoldings: List<RawHoldingData>,
rawTrades: List<RawTradeData>
) {
reportScope.launch {
try {
// 1. [핵심] 대시보드 통계 지표 추출 (Generator가 직접 계산)
val stats = calculateDashboardStats(rawHoldings, rawTrades)
// 2. 탭 2 & 3 HTML 가공
val holdingsHtml = processHoldings(rawHoldings)
val tradesHtml = processTrades(rawTrades)
// 3. 전체 HTML 조립
val htmlContent = buildHtml(summary, stats, holdingsHtml, tradesHtml)
if (summary.type.equals("END", true) || summary.type.equals("MIDDLE", true)) {
saveAndOpen(summary.type, htmlContent)
}
} catch (e: Exception) {
println("❌ [Report] 리포트 비동기 생성 중 오류 발생: ${e.message}")
e.printStackTrace()
}
}
}
// --- [새로운 통계 계산 로직] ---
private fun calculateDashboardStats(holdings: List<RawHoldingData>, trades: List<RawTradeData>): DashboardStats {
val tradesByStock = trades.groupBy { it.stockCode }
@@ -59,7 +59,11 @@ object TradingReportManager : TradingReportService {
private val activePositions = mutableMapOf<String, String>()
override fun recordAssetSnapshot(type: SnapshotType, balance: UnifiedBalance, remark: String?) {
// if (!KisSession.tradeConfig.useAutoRepost) {
// return
// }
CoroutineScope(Dispatchers.IO).launch {
println("❌ [Report] 리포트 비동기 생성 중 오류 발생: gggg")
val todayDate = LocalDate.now().toString()
// 1. 중복 없는 전체 종목 코드 리스트 추출
@@ -229,7 +233,7 @@ object TradingReportManager : TradingReportService {
}
// 6. 코루틴 기반 제너레이터 호출
LocalReportGenerator.generateAndOpenAsync(summaryData, holdingLogs, tradeLogs)
LocalReportGenerator.generateAndOpenAsyncDirectly(summaryData, holdingLogs, tradeLogs)
}
}
}
+153 -88
View File
@@ -61,10 +61,10 @@ object AutoTradingManager {
private val lastTickTime = AtomicLong(System.currentTimeMillis())
private var watchdogJob: Job? = null
private const val CYCLE_TIMEOUT = 15 * 60 * 1000L // 한 사이클 최대 10분
private const val WATCHDOG_CHECK_INTERVAL = 30 * 1000L // 30초마다 생존 확인
private const val STUCK_THRESHOLD = 7 * 60 * 1000L // 5분간 반응 없으면 'Stuck'으로 판단
private const val ONE_STOCK_ALYSIS_TIME = 180000L
var CYCLE_TIMEOUT = KisSession.tradeConfig.CYCLE_TIMEOUT
var WATCHDOG_CHECK_INTERVAL = KisSession.tradeConfig.WATCHDOG_CHECK_INTERVAL
var STUCK_THRESHOLD = KisSession.tradeConfig.STUCK_THRESHOLD
var ONE_STOCK_ALYSIS_TIME = KisSession.tradeConfig.ONE_STOCK_ALYSIS_TIME
fun isRunning(): Boolean = discoveryJob?.isActive == true
private var remainingCandidates = mutableListOf<RankingStock>()
// private val processedCodes = mutableSetOf<String>() // 중복 처리 방지용 (선택 사항)
@@ -216,8 +216,8 @@ object AutoTradingManager {
println("🚫 [안전 장치 작동] 현재 포지션이 가득 찼습니다. (최대 ${myOredsAndBalanceCodes.size}/${maxStocks}종목). 신규 매수를 일시 중단하고 매도에 집중합니다.")
TradingLogStore.addNotice("SYSTEM", "LIMIT", "최대 보유 종목 도달로 신규 매수 일시 중단")
AutoTradingManager.addToReanalysis(RankingStock(mksc_shrn_iscd = stockCode,hts_kor_isnm = stockName))
TradingLogStore.addLog(decision,"WATCH","매수 실패 : 최대 보유 종목 도달로 신규 매수 일시 중단 => 재분석 대기열에 추가")
} else {
TradingLogStore.addWatchLog(decision,"WATCH","매수 실패 : 최대 보유 종목 도달로 신규 매수 일시 중단 => 재분석 대기열에 추가")
} else if (KisSession.isAvailBuyTime(LocalTime.now())){
println("basePrice : $basePrice, oneTickLowerPrice : $oneTickLowerPrice, finalPrice : $finalPrice")
KisTradeService.postOrder(stockCode, orderQty, finalPrice.toLong().toString(), isBuy = true)
@@ -266,11 +266,22 @@ object AutoTradingManager {
if (it.message?.contains("주문가능금액을 초과") == true) {
AutoTradingManager.addToReanalysis(RankingStock(mksc_shrn_iscd = stockCode,hts_kor_isnm = stockName))
TradingLogStore.addLog(decision,"WATCH","${it.message ?: " 매수 실패"} => 재분석 대기열에 추가")
TradingLogStore.addWatchLog(decision,"WATCH","${it.message ?: " 매수 실패"} => 재분석 대기열에 추가")
} else {
TradingLogStore.addLog(decision,"BUY",it.message ?: "매수 실패")
}
}
} else {
val unfilledResult = KisTradeService.fetchUnfilledOrders()
unfilledResult.onSuccess { response ->
response.filter { it.sll_buy_dvsn_cd == "02" }.forEach { order ->
TradingLogStore.addNotice(order.prdt_name,order.pdno,"[주문 취소] 매수시간 종료 후 모든 매수 취소")
KisTradeService.cancelOrder(
order.ord_no, // 원주문번호
order.pdno
)
}
}
}
}
}
@@ -442,11 +453,32 @@ object AutoTradingManager {
&& holding.valuationProfitAmount.toDouble() >= KisSession.config.getValues(ConfigIndex.LOSS_MAX_MONEY)) {
println("${holding.name} ${holding.profitRate.toDouble()} ${holding.valuationProfitAmount.toDouble()} ${KisSession.config.getValues(ConfigIndex.LOSS_MAX_MONEY)} , ${KisSession.config.getValues(ConfigIndex.LOSS_MINRATE)} , ${KisSession.config.getValues(ConfigIndex.STOP_LOSS)}")
val profit = holding.profitRate.toDouble()
TradingLogStore.addNotice(
"보유주식[${holding.name}]",
holding.code,
"수익률($profit%) -> ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함."
)
// TradingLogStore.addNotice(
// "보유주식[${holding.name}]",
// holding.code,
// "수익률($profit%) -> ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함."
// )
var targetPrice = holding.avgPrice.toDouble()
tradeService.postOrder(
stockCode = holding.code,
qty = holding.availOrderCount,
price = targetPrice.toInt().toString(),
isBuy = false,
orderDivision = if (marketCode.equals("Y")) "07" else "",
marketCode = if (marketCode.equals("Y")) "KRX" else "NXT"
).onSuccess { newOrderNo ->
println("✅ [${if(marketCode.equals("Y"))"시간외 단일가" else "대체거래소"} 손절가이드에 따라 매매 주문 완료] ${holding.name}: $newOrderNo")
TradingLogStore.addSellLog(
holding.code,
targetPrice.toString(),
"SELL",
"☠️ 보유 주식 손절 처리 [수익률 : ${profit}%] ${holding.valuationProfitAmount} 손해 중이며 ${if(marketCode.equals("Y"))"시간외 단일가" else "대체거래소"}에 손절가이드에 따라 매매 주문 완료."
)
}.onFailure { err->
println("✅ [${if(marketCode.equals("Y"))"시간외 단일가" else "대체거래소"} 손절가이드에 따라 매매 주문 실패] ${holding.name}: $err")
}
}
analyzeDeepLossHoldingsAfterMarket(holding)
}
@@ -482,7 +514,9 @@ object AutoTradingManager {
targetPrice = targetPrice
isBefore930 = true
} else {
targetPrice = MarketUtil.roundToTickSize(targetPrice + MarketUtil.getTickSize(targetPrice))
targetPrice = MarketUtil.roundToTickSize(
targetPrice + MarketUtil.getTickSize(targetPrice)
)
}
println("🔄 [보유 주식 주문] ${holding.name} (${holding.code}) 매도 목표 ${targetPrice} 미체결 매도 건 재주문 시도")
tradeService.postOrder(
@@ -498,18 +532,20 @@ object AutoTradingManager {
"SELL",
"🎊 보유 주식[예상수익 : ${holding.profitRate}] ${if (isBefore930) "09:30 이전 현시세{${holding.currentPrice}}로 매도[$targetPrice] 주문" else "09:30 이후 시세{${holding.currentPrice}} 기준 호가 위 매도[$targetPrice] 주문"} 완료"
)
DatabaseFactory.saveAutoTrade(AutoTradeItem(
orderNo = newOrderNo,
code = holding.code,
name = holding.name,
quantity = holding.quantity.toInt(),
profitRate = 0.0,
stopLossRate = 0.0,
targetPrice = targetPrice.toDouble(),
stopLossPrice = 0.0,
status = "SELLING",
isDomestic = true
))
DatabaseFactory.saveAutoTrade(
AutoTradeItem(
orderNo = newOrderNo,
code = holding.code,
name = holding.name,
quantity = holding.quantity.toInt(),
profitRate = 0.0,
stopLossRate = 0.0,
targetPrice = targetPrice.toDouble(),
stopLossPrice = 0.0,
status = "SELLING",
isDomestic = true
)
)
syncAndExecute(newOrderNo)
}.onFailure {
TradingLogStore.addSellLog(
@@ -528,20 +564,32 @@ object AutoTradingManager {
&& holding.valuationProfitAmount.toDouble() >= KisSession.config.getValues(ConfigIndex.LOSS_MAX_MONEY)) {
println("${holding.name} ${holding.profitRate.toDouble()} ${holding.valuationProfitAmount.toDouble()} ${KisSession.config.getValues(ConfigIndex.LOSS_MAX_MONEY)} , ${KisSession.config.getValues(ConfigIndex.LOSS_MINRATE)} , ${KisSession.config.getValues(ConfigIndex.STOP_LOSS)}")
val profit = holding.profitRate.toDouble()
var targetPrice = if (KisSession.tradeConfig.autoSellOrder ) holding.avgPrice.toDouble() else holding.currentPrice.toDouble()
targetPrice = MarketUtil.roundToTickSize(targetPrice + MarketUtil.getTickSize(targetPrice) * 3.0)
tradeService.postOrder(
stockCode = holding.code,
qty = holding.availOrderCount,
price = "0",
price = targetPrice.toInt().toString(),
isBuy = false,
).onSuccess { newOrderNo ->
println("✅ [보유 주식 손절 처리] 수익률($profit%) -> ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함 시장가 매도.")
}.onFailure {
TradingLogStore.addSellLog(
holding.code,
targetPrice.toString(),
"SELL",
"☠️ 보유 주식 손절 처리 [수익률 : ${profit}%] ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함 시장가 매도."
)
}.onFailure { err->
println("✅ [보유 주식 손절 처리] 실패 ${err.message}")
}
TradingLogStore.addNotice(
"보유주식[${holding.name}]",
holding.code,
"수익률($profit%) -> ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함 시장가 매도."
)
// TradingLogStore.addNotice(
// "보유주식[${holding.name}]",
// holding.code,
// "수익률($profit%) -> ${holding.valuationProfitAmount} 손해 중이며 현제 손절 가이드에 적합함 시장가 매도."
// )
}
analyzeDeepLossHoldingsAfterMarket(holding , true)
}
@@ -554,7 +602,9 @@ object AutoTradingManager {
private suspend fun analyzeDeepLossHoldingsAfterMarket(holding: UnifiedStockHolding, isForce : Boolean = false) { // 💡 [신규 추가] 수익률이 크게 마이너스인 종목(-5.0% 이하) 심층 가이드 분석
val now = LocalTime.now()
val currentMinute = now.minute
if ((!isForce && (now.hour == 8 || now.hour == 16 || now.hour == 17)) || (isForce && (currentMinute % 5 == 0))) {
if ((holding.availOrderCount.toInt()
?: 0) > 0 && ((!isForce && (now.hour == 8 || now.hour == 16 || now.hour == 17)) || (isForce && (currentMinute % 5 == 0)))
) {
val profit = holding.profitRate.toDouble()
val lossThreshold = -5.0 // 가이드를 작동시킬 손실 기준선 (필요시 ConfigIndex 로 빼셔도 좋습니다)
if (profit <= lossThreshold) {
@@ -707,7 +757,7 @@ object AutoTradingManager {
println("⏳ [Cycle Timeout] 사이클이 너무 길어져 초기화 후 재시작합니다.")
} catch (e: Exception) {
println("⚠️ [Loop Error] ${e.message}")
delay(1500)
delay(1000)
}
waitForNextCycle(waitTime)
}
@@ -757,19 +807,8 @@ object AutoTradingManager {
suspend fun checkBalance(isMorning: Boolean = true) {
if (isMorning) {
currentBalance = KisTradeService.fetchIntegratedBalance().getOrNull()
currentBalance?.let { currentBalance ->
if (LocalTime.now().isBefore(LocalTime.of(18,1))) {
TradingReportManager.recordAssetSnapshot(
if (LocalTime.now().isAfter(LocalTime.of(18, 0))
) SnapshotType.END else SnapshotType.MIDDLE, currentBalance, ""
)
}
}
if (KisSession.config.take_profit) currentBalance?.let { resumePendingSellOrders(KisTradeService, it) }
if (KisSession.tradeConfig.auto_cancel_pending_buy) {
checkAndCancelPendingBuyOrders()
}
if (KisSession.tradeConfig.auto_cancel_pending_buy) { checkAndCancelPendingBuyOrders() }
} else {
}
}
@@ -786,19 +825,15 @@ object AutoTradingManager {
val orderTimeMillis = parseOrderTime(order.ord_tmd)
val elapsedMillis = currentTime - orderTimeMillis
// 조건 A: 설정된 대기 시간 경과 여부
if (elapsedMillis >= KisSession.tradeConfig.auto_cancel_pending_time) {
if (elapsedMillis >= KisSession.tradeConfig.auto_cancel_pending_time ) {
// 2. 현재가 조회 (가격을 비교하기 위해)
val currentPrice = KisTradeService.fetchCurrentPrice(order.pdno).getOrNull()?.stck_prpr?.toDouble() ?: 0.0
val orderedPrice = order.ord_unpr.toDoubleOrNull() ?: 0.0
// 조건 B: 현재가와 주문가의 괴리율 체크 (현재가가 너무 올라갔거나 내려갔을 때)
val priceGap = Math.abs(currentPrice - orderedPrice) / orderedPrice
println("checkAndCancelPendingBuyOrders order $order ${elapsedMillis / 1000L}${priceGap}% 차이")
if (priceGap >= KisSession.tradeConfig.auto_cancel_pending_rate) {
TradingLogStore.addNotice(order.prdt_name,order.pdno,"[주문 취소] ${order.prdt_name} (${order.pdno}) - 시간경과 및 가격괴리(${String.format("%.2f", priceGap * 100)}%)로 취소 시도")
TradingLogStore.addNotice(order.prdt_name,order.pdno,"[주문 취소] ${order.prdt_name} (${order.pdno}) - 시간경과 및 가격괴리(${String.format("%.2f", priceGap)}%)로 취소 시도")
KisTradeService.cancelOrder(
order.ord_no, // 원주문번호
order.pdno
@@ -809,6 +844,21 @@ object AutoTradingManager {
}
}
suspend fun cancelAllPendingSellOrders(
) {
// 1. 미체결 내역 조회
val unfilledResult = KisTradeService.fetchUnfilledOrders()
unfilledResult.onSuccess { response ->
response.filter { it.sll_buy_dvsn_cd == "01" }.forEach { order ->
TradingLogStore.addNotice(order.prdt_name,order.pdno,"[주문 취소] 정규장 시작전 모든 매도 주문 취소")
KisTradeService.cancelOrder(
order.ord_no, // 원주문번호
order.pdno
)
}
}
}
// 주문 시간 문자열을 Millis로 변환하는 유틸리티 (당일 주문 기준)
fun parseOrderTime(ordTmd: String): Long {
return try {
@@ -850,7 +900,7 @@ object AutoTradingManager {
}.filter {
val rate = it.prdy_ctrt.toDouble()
val corpInfo = DartCodeManager.getCorpCode(it.code)
val isOk = (rate > 0 && rate < 15) || (rate < 0 && rate > -15)
val isOk = (rate > 0 && rate < KisSession.tradeConfig.plusFilter) || (rate < 0 && rate > (KisSession.tradeConfig.minusFilter * -1))
if (corpInfo?.cName.isNullOrEmpty()) {
false
} else {
@@ -896,47 +946,62 @@ object AutoTradingManager {
}
println("⏱️ [Cycle End] ${LocalTime.now()}")
}
private var lastForceCheckMinute = -1 // 마지막으로 강제 체크를 수행한 '분'을 저장
// private var lastForceCheckMinute = -1 // 마지막으로 강제 체크를 수행한 '분'을 저장
private val executionCountMap = mutableMapOf<String, Int>()
suspend fun sellSchedule() {
if (KisSession.config.take_profit == false) {
if (KisSession.config.take_profit == false) return
val now = LocalTime.now()
val timeKey = String.format("%02d:%02d", now.hour, now.minute) // 예: "09:05"
val currentCount = executionCountMap.getOrDefault(timeKey, 0)
if (currentCount >= KisSession.tradeConfig.excuteCountOnMin) { return }
} else {
val now = LocalTime.now()
val currentMinute = now.minute
if (now.hour == 9 && currentMinute % 2 == 1
) {
if (lastForceCheckMinute != currentMinute) {
TradingLogStore.addAnalyzer(
" - ",
" - ",
"⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.",
true
var isExecuted = false
val currentMinute = now.minute
if (now.isBefore(LocalTime.of(8,50)) && now.isAfter(LocalTime.of(8,45))) {
cancelAllPendingSellOrders()
isExecuted = true
} else if ( (now.isBefore(LocalTime.of(16,0)) && now.isAfter(KisSession.endBuyTime())) ) {
val unfilledResult = KisTradeService.fetchUnfilledOrders()
unfilledResult.onSuccess { response ->
response.filter { it.sll_buy_dvsn_cd == "02" }.forEach { order ->
TradingLogStore.addNotice(order.prdt_name,order.pdno,"[주문 취소] 정규장 후 모든 매수 취소")
KisTradeService.cancelOrder(
order.ord_no, // 원주문번호
order.pdno
)
println("⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.")
checkBalance()
lastForceCheckMinute = currentMinute // 실행 완료 기록
}
} else if (((now.hour == 8 && KisSession.tradeConfig.before_nxt) || (now.hour >= 16 && now.hour < 20 && KisSession.tradeConfig.after_nxt)) && (currentMinute % 2 == 1)) {
if (lastForceCheckMinute != currentMinute) {
TradingLogStore.addAnalyzer(
" - ",
" - ",
"⏰ [강제 스케줄 실행] 오후 ${now.hour}${currentMinute}분 - 보유주식 시간외 단일가 또는 대체마켓 체크를 시작합니다.",
true
)
var list = mutableListOf<String>("X")
if (now.hour != 8 && now.hour < 18) {
list.add("Y")
}
list.forEach { code ->
KisTradeService.fetchIntegratedBalance(code).getOrNull()?.let {
sellingAfterMarketOnePrice(KisTradeService, it, code)
}
}
lastForceCheckMinute = currentMinute // 실행 완료 기록
}
}
isExecuted = true
} else if (now.hour == 9) {
TradingLogStore.addAnalyzer(
" - ",
" - ",
"⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.",
true
)
println("⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.")
checkBalance()
isExecuted = true
} else if (((now.hour == 8 && KisSession.tradeConfig.before_nxt && currentMinute < 45) || (now.hour >= 16 && now.hour < 20 && KisSession.tradeConfig.after_nxt)) && (currentMinute % 2 == 1)) {
TradingLogStore.addAnalyzer(
" - ",
" - ",
"⏰ [강제 스케줄 실행] 오후 ${now.hour}${currentMinute}분 - 보유주식 시간외 단일가 또는 대체마켓 체크를 시작합니다.",
true
)
var list = mutableListOf<String>("X")
if (now.hour != 8 && now.hour < 18) {
list.add("Y")
}
list.forEach { code ->
KisTradeService.fetchIntegratedBalance(code).getOrNull()?.let {
sellingAfterMarketOnePrice(KisTradeService, it, code)
}
}
isExecuted = true
}
if (isExecuted) { executionCountMap[timeKey] = currentCount + 1 }
if (now.hour >= 20) { executionCountMap.clear() }
}
@@ -291,7 +291,7 @@ object SafeScraper {
private val totalRam = HardwareDetector.getTotalRamGb()
// RAM 8GB당 1개 수준으로 설정하되, 최대 10~12개로 제한 (CPU 부하 방지)
private val maxParallel = totalRam.div(6).toInt()
private val maxParallel = totalRam.div(4).toInt()
// 동시 처리를 1개로 줄여서 안정성을 극대화 (추천)
// Playwright는 여러 페이지를 띄울 때 CPU/메모리 점유율이 매우 높습니다.
@@ -82,22 +82,12 @@ object SystemSleepPreventer {
}
if (process?.isAlive == true) return
if (!isWin) {
// try {
// // -i: 시스템 절전 방지, -d: 디스플레이 취침 방지, -m: 디스크 유휴 상태 방지
// val command = listOf("caffeinate", "-i", "-d", "-m")
// process = ProcessBuilder(command).start()
// println("☕ [System] caffeinate 실행됨: 앱이 켜져 있는 동안 절전 모드가 방지됩니다.")
// } catch (e: Exception) {
// println("⚠️ [System] caffeinate 실행 실패: ${e.message}")
// }
}
start2()
}
fun start2() {
println("🚀 화면 잠금 방지 프로그램이 시작되었습니다. (작동 시간: $startTime ~ $endTime)")
// 1분(60초)마다 체크
scheduler.scheduleAtFixedRate({
if (isWorkingTime()) {
@@ -105,7 +95,7 @@ object SystemSleepPreventer {
} else {
println("💤 현재는 휴식 시간입니다. (${LocalTime.now().withNano(0)})")
}
}, 0, 60 * 2, TimeUnit.SECONDS)
}, 0, 150, TimeUnit.SECONDS)
}
private fun isWorkingTime(): Boolean {
@@ -136,21 +126,6 @@ object SystemSleepPreventer {
private val osName = System.getProperty("os.name").lowercase()
// 설정 시간
private val dimTime = LocalTime.of(16, 0) // 오후 4시 이후 최저 밝기
fun start3() {
scheduler.scheduleAtFixedRate({
val now = LocalTime.now()
// 16:00 이후라면 밝기를 낮춤
if (now.isAfter(dimTime) || now.isBefore(LocalTime.of(8, 30))) {
setBrightness(0)
} else {
setBrightness(100) // 업무 시간에는 다시 밝게 (80%)
}
}, 0, 10, TimeUnit.MINUTES) // 10분마다 체크
}
private fun setBrightness(level: Int) {
try {
+2
View File
@@ -45,6 +45,7 @@ import java.awt.Toolkit
import java.awt.datatransfer.DataFlavor
import java.io.File
import androidx.compose.ui.input.key.*
import network.NewsService
fun getPastedPathFromClipboard(): String? {
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
@@ -138,6 +139,7 @@ fun SettingsScreen(onAuthSuccess: () -> Unit) {
SystemSleepPreventer.wakeDisplay() // 모니터 켜기
statusMessage = "⏰ 자동 실행 시간(08:30)입니다. 시스템을 가동합니다."
authenticateAndStart()
break // 성공하면 루프 탈출
}
}
+53 -10
View File
@@ -42,14 +42,21 @@ import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import model.ConfigIndex
import model.KisSession
import network.KisTradeService
import network.NewsService
import network.StockUniverseLoader
import report.SnapshotType
import report.TradingReportManager
import service.AutoTradingManager
import service.AutoTradingManager.currentBalance
import java.io.File
import java.net.URI
import java.time.LocalTime
@OptIn(ExperimentalMaterialApi::class)
@Composable
@@ -61,8 +68,13 @@ fun TradingDecisionLog() {
val filterOptions = listOf("전체", "BUY", "SELL", "SETTING","ANALYZER","WATCH","AFTER","NOTICE")//"PASS",,"RETRY""HOLD",
var llmAnalyser by remember { mutableStateOf(AutoTradingManager.llmAnalyser) }
val tradeConfig by remember {
KisSession.tradeConfig = KisSession.loadTradeConfig()
CoroutineScope(Dispatchers.Default).launch {
println("CALLED sendTelegramMessage -1")
val now = java.time.LocalTime.now(java.time.ZoneId.of("Asia/Seoul"))
NewsService.sendTelegramMessage("⏰ 자동 실행 시간(${now.hour}:${now.minute})입니다. 시스템을 가동합니다.")
}
mutableStateOf(KisSession.tradeConfig)
}
LaunchedEffect(AutoTradingManager.llmAnalyser) {
llmAnalyser = AutoTradingManager.llmAnalyser
@@ -96,14 +108,34 @@ fun TradingDecisionLog() {
Row(modifier = Modifier.fillMaxSize().background(Color(0xFFF2F2F2))) {
Column(modifier = Modifier.weight(1f).padding(8.dp).fillMaxHeight().background(Color.White)) {
Button(
onClick = {
coroutineScope.launch {
// index 0으로 부드럽게 스크롤 (즉시 이동은 scrollToItem(0))
listState.animateScrollToItem(filteredLogs.size - 1)
Row(modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(4.dp),
) {
Button(
onClick = {
coroutineScope.launch {
// index 0으로 부드럽게 스크롤 (즉시 이동은 scrollToItem(0))
listState.animateScrollToItem(if (filteredLogs.size - 1 >= 0) filteredLogs.size - 1 else 0)
}
}
}
) { Text("AI 자동매매 실시간 로그", style = MaterialTheme.typography.h6) }
) { Text("AI 자동매매 실시간 로그", style = MaterialTheme.typography.h6) }
Button(
onClick = {
coroutineScope.launch {
currentBalance = KisTradeService.fetchIntegratedBalance().getOrNull()
currentBalance?.let { currentBalance ->
if (LocalTime.now().isBefore(LocalTime.of(18,1))) {
TradingReportManager.recordAssetSnapshot(
if (LocalTime.now().isAfter(LocalTime.of(18, 0))
) SnapshotType.END else SnapshotType.MIDDLE, currentBalance, ""
)
}
}
}
}
) { Text("Open the report", style = MaterialTheme.typography.body2) }
}
Row(
modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
@@ -215,9 +247,9 @@ fun TradingDecisionLog() {
Text(
text = log.decision,
color = when (log.decision) {
"BUY" -> Color.Red
"BUY" -> Color(0xFF800080)
"SETTING" -> Color(0xFFFFA500)
"SELL" -> Color(0xFF800080)
"SELL" -> if (log.reason.contains("손절 처리")) Color.Blue else Color.Red
"HOLD" -> Color.DarkGray
"ANALYZER" -> Color.Green
"PASS" -> Color.Yellow
@@ -553,6 +585,17 @@ fun TradingDecisionLog() {
onCheckedChange = { tradeConfig.enableOverSea = it
KisSession.saveTradeConfig() }
)
SettingInputField(
label = "특정 메시지를 수신하려면 텔레그램 아뒤 입력",
initialValue = (tradeConfig.tlg_id).toString(),
onSave = {
tradeConfig.tlg_id = it
KisSession.saveTradeConfig()
},
helperText = "본인의 텔레그램 아뒤"
)
}
}
}
+140
View File
@@ -11238,5 +11238,145 @@
{
"code": "238490",
"name": "힘스"
},
{
"code": "000980",
"name": "교보19호스팩"
},
{
"code": "001320",
"name": "교보20호스팩"
},
{
"code": "478340",
"name": "나라스페이스테크놀로지"
},
{
"code": "403850",
"name": "더핑크퐁컴퍼니"
},
{
"code": "000010",
"name": "덕양에너젠"
},
{
"code": "491000",
"name": "리브스메드"
},
{
"code": "394420",
"name": "리센스메디컬"
},
{
"code": "000930",
"name": "미래에셋비전스팩8호"
},
{
"code": "000960",
"name": "미래에셋비전스팩9호"
},
{
"code": "488900",
"name": "비츠로넥스텍"
},
{
"code": "001150",
"name": "삼성스팩13호"
},
{
"code": "000130",
"name": "삼진식품"
},
{
"code": "061090",
"name": "세나테크놀로지"
},
{
"code": "490470",
"name": "세미파이브"
},
{
"code": "001300",
"name": "신한제17호스팩"
},
{
"code": "388210",
"name": "씨엠티엑스"
},
{
"code": "493280",
"name": "아이엠바이오로직스"
},
{
"code": "476830",
"name": "알지노믹스"
},
{
"code": "459550",
"name": "알트"
},
{
"code": "000110",
"name": "액스비스"
},
{
"code": "458350",
"name": "에스팀"
},
{
"code": "000090",
"name": "에임드바이오"
},
{
"code": "001050",
"name": "유진스팩12호"
},
{
"code": "469610",
"name": "이노테크"
},
{
"code": "261520",
"name": "이지스"
},
{
"code": "493330",
"name": "지에프아이"
},
{
"code": "000820",
"name": "카나프테라퓨틱스"
},
{
"code": "439960",
"name": "코스모로보틱스"
},
{
"code": "464490",
"name": "쿼드메디슨"
},
{
"code": "494120",
"name": "큐리오시스"
},
{
"code": "466690",
"name": "키움히어로제1호스팩"
},
{
"code": "001310",
"name": "키움히어로제2호스팩"
},
{
"code": "487580",
"name": "폴레드"
},
{
"code": "001010",
"name": "하나36호스팩"
},
{
"code": "408470",
"name": "한패스"
}
]