This commit is contained in:
dsyoon
2021-10-16 15:22:22 +09:00
parent c1eb4c8fc8
commit c3ecc09239
2 changed files with 4 additions and 4 deletions

View File

@@ -161,7 +161,7 @@ class HTS:
# acc = "782446178"
# accFlag[0] = "01"
objStockOrder = win32com.client.Dispatch("CpTrade.CpTd0311")
objStockOrder.SetInputValue(0, type) # 1: 매도, 2: 매수
objStockOrder.SetInputValue(0, type.value) # 1: 매도, 2: 매수
objStockOrder.SetInputValue(1, acc) # 계좌번호
objStockOrder.SetInputValue(2, accFlag[0]) # 상품구분 - 주식 상품 중 첫번째
objStockOrder.SetInputValue(3, "A"+stock_code) # 종목코드
@@ -588,7 +588,7 @@ class HTS:
# 미체결 기록을 가져온다.
orderList = self.requestOrderList()
# 매수 주문을 기록한다.
orderListToCancel = orderChecker.add("2", orderNum, BUY_COUNT, bs_buy_price, orderList)
orderListToCancel = orderChecker.add(OrderType.buy, orderNum, BUY_COUNT, bs_buy_price, orderList)
# 두 시간 이전 미체결을 취소한다.
self.cancelOrderList(orderListToCancel)
# 로그 출력