diff --git a/hts/HTS_122630.py b/hts/HTS_122630.py index af9b5ff..3e77474 100644 --- a/hts/HTS_122630.py +++ b/hts/HTS_122630.py @@ -619,13 +619,22 @@ class HTS_122630: if datetime.strptime(GIVEN_DAY + " 151500", '%Y%m%d %H%M%S') < THIS_TIME: # 주문 리스트를 가져온다. orderList = self.requestOrderList() - # 15:10:00 이후라면 모든 미체결 취소한다. + # 15:15:00 이후라면 모든 미체결 취소한다. self.cancelOrderList(orderList) + + # 데이터를 가지고 온다. + self.getRealTime(stock_code, GIVEN_DAY, result) + + # 분석을 통해서 볼린저밴드 상/하단을 계산한다. + data = self.buySellChecker.analyze(result) + data_size = len(data["Close"]) + final_price = data["Close"][data_size - 1] + # 매도 가격을 가져온다. selling_count, selling_price = self.getSellingPrice(final_price) # 분석되 가격으로 매도 요청한다. - if selling_count != 0 and selling_price !=0: - orderNum = self.requestOrder(OrderType.sell, stock_code, selling_count, selling_price) + if selling_count != 0 and selling_price != 0: + orderNum = self.requestOrder(OrderType.sell, stock_code, selling_count, final_price) # 로그 출력 print("SELL", THIS_TIME, selling_count, selling_price) diff --git a/hts/HTS_252670.py b/hts/HTS_252670.py index 6d57e01..2fc38a8 100644 --- a/hts/HTS_252670.py +++ b/hts/HTS_252670.py @@ -616,16 +616,25 @@ class HTS_252670: print("TIMECHECK", THIS_TIME, final_price, data["Low"][data_size-1], data["slow_k"][data_size-1], data["slow_d"][data_size-1]) timecheck[THIS_TIME] = True - if datetime.strptime(GIVEN_DAY + " 151500", '%Y%m%d %H%M%S') < THIS_TIME: + if datetime.strptime(GIVEN_DAY + " 151530", '%Y%m%d %H%M%S') < THIS_TIME: # 주문 리스트를 가져온다. orderList = self.requestOrderList() - # 15:10:00 이후라면 모든 미체결 취소한다. + # 15:15:00 이후라면 모든 미체결 취소한다. self.cancelOrderList(orderList) + + # 데이터를 가지고 온다. + self.getRealTime(stock_code, GIVEN_DAY, result) + + # 분석을 통해서 볼린저밴드 상/하단을 계산한다. + data = self.buySellChecker.analyze(result) + data_size = len(data["Close"]) + final_price = data["Close"][data_size - 1] + # 매도 가격을 가져온다. selling_count, selling_price = self.getSellingPrice(final_price) # 분석되 가격으로 매도 요청한다. if selling_count != 0 and selling_price !=0: - orderNum = self.requestOrder(OrderType.sell, stock_code, selling_count, selling_price) + orderNum = self.requestOrder(OrderType.sell, stock_code, selling_count, final_price) # 로그 출력 print("SELL", THIS_TIME, selling_count, selling_price)