...
This commit is contained in:
parent
71fdabfc32
commit
27d330677e
@ -49,6 +49,7 @@ import java.util.concurrent.atomic.AtomicLong
|
||||
import kotlin.collections.List
|
||||
import kotlin.collections.filter
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
|
||||
// service/AutoTradingManager.kt
|
||||
typealias TradingDecisionCallback = (TradingDecision?, Boolean)->Unit
|
||||
@ -935,7 +936,8 @@ object AutoTradingManager {
|
||||
|
||||
suspend fun executeMarketLoop() {
|
||||
checkBalance()
|
||||
val myCash = currentBalance?.deposit?.replace(",", "")?.toLongOrNull() ?: KisSession.config.getValues(ConfigIndex.MAX_PRICE_INDEX).toLong()
|
||||
var myCash = currentBalance?.deposit?.replace(",", "")?.toLongOrNull() ?: KisSession.config.getValues(ConfigIndex.MAX_PRICE_INDEX).toLong()
|
||||
myCash = max(myCash,KisSession.config.getValues(ConfigIndex.MAX_PRICE_INDEX).toLong())
|
||||
val myHoldings = currentBalance?.getHoldings()?.filter { !it.isTodayEntry }?.map { it.code }?.toSet() ?: emptySet()
|
||||
val pendingStocks = DatabaseFactory.findAllMonitoringTrades().map { it.code }
|
||||
var now = LocalTime.now(ZoneId.of("Asia/Seoul"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user