...
This commit is contained in:
@@ -366,7 +366,7 @@ object KisSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isMarketAnalyzerTime(now: LocalTime) : Boolean {
|
fun isMarketAnalyzerTime(now: LocalTime) : Boolean {
|
||||||
return now.isBefore(LocalTime.of(18,0)) && now.isAfter(LocalTime.of(8,0))
|
return now.isBefore(LocalTime.of(19,0)) && now.isAfter(LocalTime.of(8,0))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ object KisTradeService {
|
|||||||
header("appsecret", config.realSecretKey)
|
header("appsecret", config.realSecretKey)
|
||||||
header("tr_id", if (isDomestic) "FHKST03010100" else "HHDFS76240000")
|
header("tr_id", if (isDomestic) "FHKST03010100" else "HHDFS76240000")
|
||||||
header("custtype", "P")
|
header("custtype", "P")
|
||||||
|
|
||||||
parameter("FID_INPUT_DATE_1", startDate)
|
parameter("FID_INPUT_DATE_1", startDate)
|
||||||
parameter("FID_INPUT_DATE_2", endDate)
|
parameter("FID_INPUT_DATE_2", endDate)
|
||||||
parameter("FID_COND_MRKT_DIV_CODE", if(LocalTime.now(ZoneId.of("Asia/Seoul")).isAfter(LocalTime.of(16,0))) "UN" else "J")
|
parameter("FID_COND_MRKT_DIV_CODE", if(LocalTime.now(ZoneId.of("Asia/Seoul")).isAfter(LocalTime.of(16,0))) "UN" else "J")
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ object AutoTradingManager {
|
|||||||
TradingLogStore.addLog(decision, "BUY", it.message ?: "매수 실패")
|
TradingLogStore.addLog(decision, "BUY", it.message ?: "매수 실패")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!hasCode && KisSession.isAvailBuyTime(LocalTime.now())) {
|
} else if (!hasCode && KisSession.isAvailBuyTime(LocalTime.now()) == false) {
|
||||||
AutoTradingManager.addToReanalysis(
|
AutoTradingManager.addToReanalysis(
|
||||||
RankingStock(
|
RankingStock(
|
||||||
mksc_shrn_iscd = stockCode,
|
mksc_shrn_iscd = stockCode,
|
||||||
@@ -537,7 +537,7 @@ object AutoTradingManager {
|
|||||||
watchdogJob = scope.launch {
|
watchdogJob = scope.launch {
|
||||||
val activeTrades = DatabaseFactory.findAllMonitoringTrades()
|
val activeTrades = DatabaseFactory.findAllMonitoringTrades()
|
||||||
var now = LocalTime.now(ZoneId.of("Asia/Seoul"))
|
var now = LocalTime.now(ZoneId.of("Asia/Seoul"))
|
||||||
if (doStart && activeTrades.isNotEmpty() && !KisSession.isMarketOpenTime(now)) {
|
if (doStart && activeTrades.isNotEmpty() && !KisSession.isMarketAnalyzerTime(now)) {
|
||||||
executeClosingLiquidation(activeTrades)
|
executeClosingLiquidation(activeTrades)
|
||||||
}
|
}
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
@@ -1484,7 +1484,7 @@ object AutoTradingManager {
|
|||||||
|
|
||||||
val currentAtr = tempAnalyzer.calculateATR(dailyData)
|
val currentAtr = tempAnalyzer.calculateATR(dailyData)
|
||||||
if (!isProfitable || !isValidEntryTiming) {
|
if (!isProfitable || !isValidEntryTiming) {
|
||||||
print("-> [${stock.name}] 목표 수익 조건 미달 (물타기:$isWatering, 수익:$isProfitable, 타이밍:$isValidEntryTiming) | 기대 수익율 : ${expectedProfitRate}")
|
print("-> [${stock.name}] 목표 수익 조건 미달 (물타기:$isWatering, 수익:$isProfitable, 타이밍:$isValidEntryTiming) | 기대 수익율 : ${expectedProfitRate} || ${dailyStats.avgReboundAmplitude}")
|
||||||
return@withTimeout
|
return@withTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1509,7 +1509,7 @@ object AutoTradingManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println("\n💧 [검문소 통과 -> ${if (isWatering) "물타기 탈출 분석" else "신규 매수 분석"}] ${stock.name} (물타기:$isWatering, 수익:$isProfitable, 타이밍:$isValidEntryTiming) | 기대 수익율 : ${expectedProfitRate}")
|
println("\n💧 [검문소 통과 -> ${if (isWatering) "물타기 탈출 분석" else "신규 매수 분석"}] ${stock.name} (물타기:$isWatering, 수익:$isProfitable, 타이밍:$isValidEntryTiming) | 기대 수익율 : ${expectedProfitRate} || ${dailyStats.avgReboundAmplitude}")
|
||||||
|
|
||||||
// 멀티 타임프레임 및 AI 분석 진입
|
// 멀티 타임프레임 및 AI 분석 진입
|
||||||
val analyzer = coroutineScope {
|
val analyzer = coroutineScope {
|
||||||
|
|||||||
Reference in New Issue
Block a user