....
This commit is contained in:
parent
27d330677e
commit
8e145803d8
@ -637,7 +637,7 @@ object KisTradeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val body = response.body<StockBalanceResponse>()
|
val body = response.body<StockBalanceResponse>()
|
||||||
println("✅ [Step $pageCount] $markgetCode 수신 완료 - 종목 수: \n${body.output2}\n\n")
|
println("✅ [Step $pageCount] $markgetCode 수신 완료 - 종목 수: ${body.output1.size}\n${body.output2}\n\n")
|
||||||
// println("✅ [Step $pageCount] $markgetCode 수신 완료 - 종목 수: ${body.output1.size}")
|
// println("✅ [Step $pageCount] $markgetCode 수신 완료 - 종목 수: ${body.output1.size}")
|
||||||
|
|
||||||
allHoldings.addAll(body.output1)
|
allHoldings.addAll(body.output1)
|
||||||
|
|||||||
@ -119,7 +119,7 @@ object AutoTradingManager {
|
|||||||
val maxBudget = KisSession.config.getValues(ConfigIndex.MAX_BUDGET_INDEX) * gradeRate
|
val maxBudget = KisSession.config.getValues(ConfigIndex.MAX_BUDGET_INDEX) * gradeRate
|
||||||
|
|
||||||
TradingLogStore.addLog(decision,"BUY",decision.summary())
|
TradingLogStore.addLog(decision,"BUY",decision.summary())
|
||||||
var hasCodes = currentBalance?.getHoldings()?.any { it.code.equals(decision.stockCode) && it.quantity.toInt() > 2 && it.availOrderCount.toInt() > 0} ?: false
|
var hasCodes = KisSession.tradeConfig.lowerAveragePrice && currentBalance?.getHoldings()?.any { it.code.equals(decision.stockCode) && it.quantity.toInt() > 2 && it.availOrderCount.toInt() > 0} ?: false
|
||||||
if (hasCodes == true) {
|
if (hasCodes == true) {
|
||||||
TradingLogStore.addNotice(decision.stockName,decision.stockCode,"물타기 시도 1주 매수")
|
TradingLogStore.addNotice(decision.stockName,decision.stockCode,"물타기 시도 1주 매수")
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ object AutoTradingManager {
|
|||||||
(profitRate1 ?: KisSession.config.getValues(ConfigIndex.PROFIT_INDEX)) + tax
|
(profitRate1 ?: KisSession.config.getValues(ConfigIndex.PROFIT_INDEX)) + tax
|
||||||
try {
|
try {
|
||||||
var oldTarget = currentBalance?.getHoldings()?.first { it.availOrderCount.toInt() > 0 && it.code.equals(decision.stockCode) }
|
var oldTarget = currentBalance?.getHoldings()?.first { it.availOrderCount.toInt() > 0 && it.code.equals(decision.stockCode) }
|
||||||
if (hasCode && oldTarget != null) {
|
if (KisSession.tradeConfig.lowerAveragePrice && hasCode && oldTarget != null) {
|
||||||
var avgPrive = oldTarget.avgPrice.toDouble()
|
var avgPrive = oldTarget.avgPrice.toDouble()
|
||||||
var qty = oldTarget.quantity.toDouble()
|
var qty = oldTarget.quantity.toDouble()
|
||||||
basePrice = avgPrive * 1.5//((avgPrive * qty) + (decision.currentPrice * orderQty.toInt())).div(qty!!.toInt() + (orderQty.toInt()))
|
basePrice = avgPrive * 1.5//((avgPrive * qty) + (decision.currentPrice * orderQty.toInt())).div(qty!!.toInt() + (orderQty.toInt()))
|
||||||
@ -352,7 +352,7 @@ object AutoTradingManager {
|
|||||||
// 💡 [수정] 매수 주문(orderNo)에 대해 '진짜 산 가격'을 기록해야 합니다.
|
// 💡 [수정] 매수 주문(orderNo)에 대해 '진짜 산 가격'을 기록해야 합니다.
|
||||||
// 기존에는 여기에 finalTargetPrice를 넣으셨는데, 그러면 매수 단가가 오염됩니다.
|
// 기존에는 여기에 finalTargetPrice를 넣으셨는데, 그러면 매수 단가가 오염됩니다.
|
||||||
TradingReportManager.updateExecution(orderNo, actualBuyPrice, dbItem.quantity)
|
TradingReportManager.updateExecution(orderNo, actualBuyPrice, dbItem.quantity)
|
||||||
var hasCodes = currentBalance?.getHoldings()?.any { it.code.equals(dbItem.code) && it.quantity.toInt() > 2 && dbItem.quantity == KisSession.tradeConfig.lowerAverageStockCount } ?: false
|
var hasCodes = KisSession.tradeConfig.lowerAveragePrice && currentBalance?.getHoldings()?.any { it.code.equals(dbItem.code) && it.quantity.toInt() > 2 && dbItem.quantity == KisSession.tradeConfig.lowerAverageStockCount } ?: false
|
||||||
if (hasCodes) {
|
if (hasCodes) {
|
||||||
actualBuyPrice = actualBuyPrice * 1.1
|
actualBuyPrice = actualBuyPrice * 1.1
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user