...
This commit is contained in:
@@ -374,8 +374,6 @@ object AutoTradingManager {
|
||||
}
|
||||
|
||||
suspend fun sellingAfterMarketOnePrice(tradeService: KisTradeService,balance : UnifiedBalance,marketCode : String = "Y") {
|
||||
|
||||
// if (true) return
|
||||
balance.holdings.forEach { holding ->
|
||||
if (BLACKLISTEDSTOCKCODES.contains(holding.code)){
|
||||
println("❌ 차단 처리된 주식 : ${holding.name}")
|
||||
@@ -641,19 +639,27 @@ object AutoTradingManager {
|
||||
if (AUTOSELL) balance?.let { resumePendingSellOrders(KisTradeService, it) }
|
||||
return balance
|
||||
} else {
|
||||
// listOf<String>("Y","X").forEach { code ->
|
||||
// val now = LocalTime.now()
|
||||
// val currentMinute = now.minute
|
||||
// if((now.hour == 16 || now.hour == 17) && (currentMinute % 10 == 3 || currentMinute % 10 == 9)) {
|
||||
// if (lastForceCheckMinute != currentMinute) {
|
||||
// listOf<String>("Y","X").forEach { code ->
|
||||
// KisTradeService.fetchIntegratedBalance(code).getOrNull()?.let {
|
||||
// sellingAfterMarketOnePrice(KisTradeService, it, code)
|
||||
// }
|
||||
// delay(1000)
|
||||
// }
|
||||
// lastForceCheckMinute = currentMinute // 실행 완료 기록
|
||||
// }
|
||||
// }
|
||||
//
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
suspend fun executeMarketLoop() {
|
||||
val balance = checkBalance()
|
||||
if (AUTOSELL) balance?.let { resumePendingSellOrders(KisTradeService, it) }
|
||||
// if (AUTOSELL) balance?.let { resumePendingSellOrders(KisTradeService, it) }
|
||||
|
||||
val myCash = balance?.deposit?.replace(",", "")?.toLongOrNull() ?: 0L
|
||||
val myHoldings = balance?.holdings?.filter { it.quantity.toInt() > 0 }?.map { it.code }?.toSet() ?: emptySet()
|
||||
@@ -733,16 +739,20 @@ object AutoTradingManager {
|
||||
}
|
||||
}
|
||||
else if((now.hour == 16 || now.hour == 17) && (currentMinute % 10 == 3 || currentMinute % 10 == 9)) {
|
||||
// if (lastForceCheckMinute != currentMinute) {
|
||||
// TradingLogStore.addAnalyzer(
|
||||
// " - ",
|
||||
// " - ",
|
||||
// "⏰ [강제 스케줄 실행] 오후 ${now.hour}시 ${currentMinute}분 - 보유주식 시간외 단일가 또는 대체마켓 체크를 시작합니다.",
|
||||
// true
|
||||
// )
|
||||
// checkBalance(false)
|
||||
// lastForceCheckMinute = currentMinute // 실행 완료 기록
|
||||
// }
|
||||
if (lastForceCheckMinute != currentMinute) {
|
||||
TradingLogStore.addAnalyzer(
|
||||
" - ",
|
||||
" - ",
|
||||
"⏰ [강제 스케줄 실행] 오후 ${now.hour}시 ${currentMinute}분 - 보유주식 시간외 단일가 또는 대체마켓 체크를 시작합니다.",
|
||||
true
|
||||
)
|
||||
listOf<String>("Y","X").forEach { code ->
|
||||
KisTradeService.fetchIntegratedBalance(code).getOrNull()?.let {
|
||||
sellingAfterMarketOnePrice(KisTradeService, it, code)
|
||||
}
|
||||
}
|
||||
lastForceCheckMinute = currentMinute // 실행 완료 기록
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1155,7 +1165,7 @@ class TechnicalAnalyzer {
|
||||
val disparityDaily = (currentPrice / ma20Daily) * 100
|
||||
|
||||
if (disparityDaily > 115.0) { // 20일선보다 15% 이상 떠 있으면 감점 시작
|
||||
val penalty = ((disparityDaily - 115.0) * 0.5).toInt() // 초과분 1%당 2점 감점
|
||||
val penalty = ((disparityDaily - 115.0) * 0.3).toInt() // 초과분 1%당 2점 감점
|
||||
short -= penalty
|
||||
ultra -= (penalty / 2) // 초단기에도 영향
|
||||
println("⚠️ [과열 감점] 일봉 이격도(${String.format("%.1f", disparityDaily)}%): -${penalty}점")
|
||||
@@ -1166,8 +1176,8 @@ class TechnicalAnalyzer {
|
||||
if (weekly.size >= 3) {
|
||||
val weeklyChange = calculateChange(weekly.takeLast(3))
|
||||
if (weeklyChange > 30.0) { // 3주간 30% 이상 급등 시
|
||||
mid -= 10
|
||||
short -= 5
|
||||
mid -= 6
|
||||
short -= 3
|
||||
println("⚠️ [과열 감점] 주봉 급등(${String.format("%.1f", weeklyChange)}%): -10점")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user