...
This commit is contained in:
parent
af72ffae1c
commit
5a504ffa31
@ -368,8 +368,6 @@ object AutoTradingManager {
|
|||||||
"${if ("Y".equals(marketCode)) "시간외 단일가" else "대체거래소"} 시세로 ${holding.profitRate} 수익 예상"
|
"${if ("Y".equals(marketCode)) "시간외 단일가" else "대체거래소"} 시세로 ${holding.profitRate} 수익 예상"
|
||||||
)
|
)
|
||||||
|
|
||||||
targetPrice = MarketUtil.roundToTickSize(targetPrice + MarketUtil.getTickSize(targetPrice))
|
|
||||||
|
|
||||||
tradeService.postOrder(
|
tradeService.postOrder(
|
||||||
stockCode = holding.code,
|
stockCode = holding.code,
|
||||||
qty = holding.availOrderCount,
|
qty = holding.availOrderCount,
|
||||||
@ -383,14 +381,14 @@ object AutoTradingManager {
|
|||||||
holding.code,
|
holding.code,
|
||||||
targetPrice.toString(),
|
targetPrice.toString(),
|
||||||
"SELL",
|
"SELL",
|
||||||
"🎊 시간외 단일가 주식 재고털이 주문 완료"
|
"🎊 ${if(marketCode.equals("Y"))"시간외 단일가" else "대체거래소"} 주식 재고털이 주문 완료"
|
||||||
)
|
)
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
TradingLogStore.addSellLog(
|
TradingLogStore.addSellLog(
|
||||||
holding.code,
|
holding.code,
|
||||||
targetPrice.toString(),
|
targetPrice.toString(),
|
||||||
"SELL",
|
"SELL",
|
||||||
"🎊 시간외 단일가 주식 재고털이 주문 실패[${it.message}] "
|
"🎊 ${if(marketCode.equals("Y"))"시간외 단일가" else "대체거래소"} 주식 재고털이 주문 실패[${it.message}] "
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -405,7 +403,9 @@ object AutoTradingManager {
|
|||||||
suspend fun resumePendingSellOrders(tradeService: KisTradeService,balance : UnifiedBalance) {
|
suspend fun resumePendingSellOrders(tradeService: KisTradeService,balance : UnifiedBalance) {
|
||||||
val now = LocalTime.now()
|
val now = LocalTime.now()
|
||||||
val currentMinute = now.minute
|
val currentMinute = now.minute
|
||||||
// if (now.isBefore(H16) && now.isAfter(H08M35)) {
|
if (now.isBefore(H15M30) && now.isAfter(H08M45)) {
|
||||||
|
|
||||||
|
|
||||||
println("resumePendingSellOrders")
|
println("resumePendingSellOrders")
|
||||||
balance.holdings.forEach { holding ->
|
balance.holdings.forEach { holding ->
|
||||||
if (BLACKLISTEDSTOCKCODES.contains(holding.code)){
|
if (BLACKLISTEDSTOCKCODES.contains(holding.code)){
|
||||||
@ -455,7 +455,7 @@ object AutoTradingManager {
|
|||||||
delay(200) // API 호출 부하 방지
|
delay(200) // API 호출 부하 방지
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun analyzeDeepLossHoldingsAfterMarket(holding: UnifiedStockHolding) { // 💡 [신규 추가] 수익률이 크게 마이너스인 종목(-5.0% 이하) 심층 가이드 분석
|
private suspend fun analyzeDeepLossHoldingsAfterMarket(holding: UnifiedStockHolding) { // 💡 [신규 추가] 수익률이 크게 마이너스인 종목(-5.0% 이하) 심층 가이드 분석
|
||||||
@ -577,7 +577,7 @@ object AutoTradingManager {
|
|||||||
currentTimeMillis = System.currentTimeMillis()
|
currentTimeMillis = System.currentTimeMillis()
|
||||||
lastTickTime.set(System.currentTimeMillis()) // 생존 신고
|
lastTickTime.set(System.currentTimeMillis()) // 생존 신고
|
||||||
when {
|
when {
|
||||||
now.isAfter(H18) || now.isBefore(H08M00) -> {
|
now.isAfter(H18) || now.isBefore(H07M50) -> {
|
||||||
prepareMarketOpen(now)
|
prepareMarketOpen(now)
|
||||||
}
|
}
|
||||||
now.isBefore(H18) && now.isAfter(H08M00) -> {
|
now.isBefore(H18) && now.isAfter(H08M00) -> {
|
||||||
@ -601,11 +601,6 @@ object AutoTradingManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// //장외
|
|
||||||
// now.isAfter(H16) || now.isBefore(H08M35) -> {
|
|
||||||
// finalizeMarketClose(now)
|
|
||||||
// }
|
|
||||||
else ->{
|
else ->{
|
||||||
waitTime = 3.0
|
waitTime = 3.0
|
||||||
}
|
}
|
||||||
@ -722,7 +717,7 @@ object AutoTradingManager {
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
totalCount--
|
totalCount--
|
||||||
val stock = iterator.next()
|
val stock = iterator.next()
|
||||||
if (now.isBefore(H16) && now.isAfter(H08M45)) {
|
if (now.isBefore(H15M30) && now.isAfter(H08M45)) {
|
||||||
if (BLACKLISTEDSTOCKCODES.contains(stock.code)) {
|
if (BLACKLISTEDSTOCKCODES.contains(stock.code)) {
|
||||||
println("❌ 차단 처리된 주식 : ${stock.name}")
|
println("❌ 차단 처리된 주식 : ${stock.name}")
|
||||||
} else {
|
} else {
|
||||||
@ -746,7 +741,6 @@ object AutoTradingManager {
|
|||||||
|
|
||||||
val now = LocalTime.now()
|
val now = LocalTime.now()
|
||||||
val currentMinute = now.minute
|
val currentMinute = now.minute
|
||||||
println("매도 스케줄 체크")
|
|
||||||
if (now.hour == 9 && (currentMinute % 10 == 1 || currentMinute % 10 == 7)) {
|
if (now.hour == 9 && (currentMinute % 10 == 1 || currentMinute % 10 == 7)) {
|
||||||
if (lastForceCheckMinute != currentMinute) {
|
if (lastForceCheckMinute != currentMinute) {
|
||||||
TradingLogStore.addAnalyzer(" - ", " - ", "⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.", true)
|
TradingLogStore.addAnalyzer(" - ", " - ", "⏰ [강제 스케줄 실행] 오전 9시 ${currentMinute}분 - 보유주식 매도 체크를 시작합니다.", true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user