This commit is contained in:
dosangyoon
2021-10-17 22:35:55 +09:00
parent cb60a54f3f
commit 20268151a5
2 changed files with 24 additions and 6 deletions

View File

@@ -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)