...
This commit is contained in:
parent
510e19b2e8
commit
558a39e2d3
@ -818,10 +818,10 @@ object AutoTradingManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var loadedTops = mutableListOf<Pair<String, String>>()
|
var loadedTops = mutableListOf<Pair<String, String>>()
|
||||||
|
var defaultStockCount = 200
|
||||||
fun poll100Stocks(): List<Pair<String, String>> {
|
fun poll100Stocks(): List<Pair<String, String>> {
|
||||||
loadedTops.shuffle()
|
loadedTops.shuffle()
|
||||||
val count = minOf(loadedTops.size, 200)
|
val count = minOf(loadedTops.size, defaultStockCount)
|
||||||
if (count == 0) return emptyList()
|
if (count == 0) return emptyList()
|
||||||
|
|
||||||
// 앞의 100개를 복사
|
// 앞의 100개를 복사
|
||||||
@ -911,7 +911,7 @@ object AutoTradingManager {
|
|||||||
val pendingStocks = DatabaseFactory.findAllMonitoringTrades().map { it.code }
|
val pendingStocks = DatabaseFactory.findAllMonitoringTrades().map { it.code }
|
||||||
|
|
||||||
if (remainingCandidates.isEmpty()) {
|
if (remainingCandidates.isEmpty()) {
|
||||||
if (loadedTops.size < 200) {
|
if (loadedTops.size < defaultStockCount) {
|
||||||
loadedTops.addAll(StockUniverseLoader.loadUniverse())
|
loadedTops.addAll(StockUniverseLoader.loadUniverse())
|
||||||
loadedTops.shuffle()
|
loadedTops.shuffle()
|
||||||
println("✅ 총 ${loadedTops.size}개의 종목이 로드되있음.")
|
println("✅ 총 ${loadedTops.size}개의 종목이 로드되있음.")
|
||||||
@ -941,16 +941,17 @@ object AutoTradingManager {
|
|||||||
reanalysisList.clear()
|
reanalysisList.clear()
|
||||||
if (KisSession.tradeConfig.lowerAveragePrice) {
|
if (KisSession.tradeConfig.lowerAveragePrice) {
|
||||||
currentBalance?.getHoldings()?.map {
|
currentBalance?.getHoldings()?.map {
|
||||||
if(!it.isTodayEntry &&
|
if(
|
||||||
it.quantity.toInt() > KisSession.tradeConfig.lowerAverageTargetCount &&
|
it.quantity.toInt() > KisSession.tradeConfig.lowerAverageTargetCount &&
|
||||||
it.profitRate.toDouble() < (KisSession.tradeConfig.lowerAverageMaxRate * -1) &&
|
it.profitRate.toDouble() < (KisSession.tradeConfig.lowerAverageMaxRate * -1) &&
|
||||||
it.profitRate.toDouble() > (KisSession.tradeConfig.lowerAverageMinRate * -1) ) {
|
it.profitRate.toDouble() > (KisSession.tradeConfig.lowerAverageMinRate * -1) )
|
||||||
remainingCandidates.add(RankingStock(mksc_shrn_iscd = it.code, hts_kor_isnm = it.name))
|
{
|
||||||
|
candidates.add(RankingStock(mksc_shrn_iscd = it.code, hts_kor_isnm = it.name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
remainingCandidates.addAll(candidates.filter {
|
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 pendingStocks &&
|
||||||
it.code !in executionCache.values.map { it.code } &&
|
it.code !in executionCache.values.map { it.code } &&
|
||||||
it.code !in failList &&
|
it.code !in failList &&
|
||||||
|
|||||||
@ -53,6 +53,7 @@ import network.StockUniverseLoader
|
|||||||
import service.AutoTradingManager
|
import service.AutoTradingManager
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
import kotlin.math.abs
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterialApi::class)
|
@OptIn(ExperimentalMaterialApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
@ -509,7 +510,28 @@ fun TradingDecisionLog() {
|
|||||||
Spacer(Modifier.height(16.dp))
|
Spacer(Modifier.height(16.dp))
|
||||||
|
|
||||||
Text("⚙️ 기타 고급 설정", style = MaterialTheme.typography.h6, modifier = Modifier.padding(8.dp))
|
Text("⚙️ 기타 고급 설정", style = MaterialTheme.typography.h6, modifier = Modifier.padding(8.dp))
|
||||||
|
Row(horizontalArrangement = Arrangement.SpaceEvenly) {
|
||||||
|
SettingInputField(
|
||||||
|
modifier = Modifier.weight(1.0f, true),
|
||||||
|
label = "매수 분석 현 변동율 처저 기준",
|
||||||
|
initialValue = (tradeConfig.minusFilter * -1).toString(),
|
||||||
|
onSave = {
|
||||||
|
tradeConfig.minusFilter = abs(it.toDouble())
|
||||||
|
KisSession.saveTradeConfig()
|
||||||
|
},
|
||||||
|
helperText = "현제 변동율이 이것보다 커야 분석 함."
|
||||||
|
)
|
||||||
|
SettingInputField(
|
||||||
|
modifier = Modifier.weight(1.0f, true),
|
||||||
|
label = "매수 분석 현 변동율 최고 기준",
|
||||||
|
initialValue = (tradeConfig.plusFilter).toString(),
|
||||||
|
onSave = {
|
||||||
|
tradeConfig.plusFilter = it.toDouble()
|
||||||
|
KisSession.saveTradeConfig()
|
||||||
|
},
|
||||||
|
helperText = "현제 변동율이 이것보다 작아야 분석 함."
|
||||||
|
)
|
||||||
|
}
|
||||||
// Boolean 설정들
|
// Boolean 설정들
|
||||||
SettingSwitchField(
|
SettingSwitchField(
|
||||||
label = "미체결 자동 취소 (매수)",
|
label = "미체결 자동 취소 (매수)",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user