...
This commit is contained in:
@@ -818,10 +818,10 @@ object AutoTradingManager {
|
||||
}
|
||||
}
|
||||
var loadedTops = mutableListOf<Pair<String, String>>()
|
||||
|
||||
var defaultStockCount = 200
|
||||
fun poll100Stocks(): List<Pair<String, String>> {
|
||||
loadedTops.shuffle()
|
||||
val count = minOf(loadedTops.size, 200)
|
||||
val count = minOf(loadedTops.size, defaultStockCount)
|
||||
if (count == 0) return emptyList()
|
||||
|
||||
// 앞의 100개를 복사
|
||||
@@ -911,7 +911,7 @@ object AutoTradingManager {
|
||||
val pendingStocks = DatabaseFactory.findAllMonitoringTrades().map { it.code }
|
||||
|
||||
if (remainingCandidates.isEmpty()) {
|
||||
if (loadedTops.size < 200) {
|
||||
if (loadedTops.size < defaultStockCount) {
|
||||
loadedTops.addAll(StockUniverseLoader.loadUniverse())
|
||||
loadedTops.shuffle()
|
||||
println("✅ 총 ${loadedTops.size}개의 종목이 로드되있음.")
|
||||
@@ -941,16 +941,17 @@ object AutoTradingManager {
|
||||
reanalysisList.clear()
|
||||
if (KisSession.tradeConfig.lowerAveragePrice) {
|
||||
currentBalance?.getHoldings()?.map {
|
||||
if(!it.isTodayEntry &&
|
||||
if(
|
||||
it.quantity.toInt() > KisSession.tradeConfig.lowerAverageTargetCount &&
|
||||
it.profitRate.toDouble() < (KisSession.tradeConfig.lowerAverageMaxRate * -1) &&
|
||||
it.profitRate.toDouble() > (KisSession.tradeConfig.lowerAverageMinRate * -1) ) {
|
||||
remainingCandidates.add(RankingStock(mksc_shrn_iscd = it.code, hts_kor_isnm = it.name))
|
||||
it.profitRate.toDouble() > (KisSession.tradeConfig.lowerAverageMinRate * -1) )
|
||||
{
|
||||
candidates.add(RankingStock(mksc_shrn_iscd = it.code, hts_kor_isnm = it.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
remainingCandidates.addAll(candidates.filter {
|
||||
if (KisSession.tradeConfig.lowerAveragePrice) { true } else {it.code !in myHoldings} &&
|
||||
(if (KisSession.tradeConfig.lowerAveragePrice) { true } else {it.code !in myHoldings}) &&
|
||||
it.code !in pendingStocks &&
|
||||
it.code !in executionCache.values.map { it.code } &&
|
||||
it.code !in failList &&
|
||||
|
||||
Reference in New Issue
Block a user