This commit is contained in:
dsyoon
2023-01-24 22:50:43 +09:00
parent 33a131ca43
commit 1827d6d8d1

View File

@@ -13,8 +13,6 @@ from hts.OrderChecker import OrderChecker
class HTS_DAILY (HTS):
RESOURCE_PATH = None
stock_code = None
buy_count = None
orderChecker = None
buySellChecker = None
labelChecker = None
@@ -44,11 +42,12 @@ class HTS_DAILY (HTS):
jangoDic = self.requstJango()
if jangoDic and len(jangoDic.keys()) > 0:
for code in jangoDic:
if code == "A" + stock_code:
if jangoDic[code]['매도가능'] > 0:
if check:
if jangoDic[code]['장부가']*0.05 < jangoDic[code]['장부가'] - final_price:
sell_price = jangoDic[code]['장부가']
if code == "A" + stock_code:
orderNum = self.requestOrder(OrderType.sell, stock_code, jangoDic[code]['매도가능'], sell_price)
print("ORDER_SELL", stock_code, log_time.strftime('%Y%m%d %H%M%S'), jangoDic[code]['매도가능'], sell_price)
else:
@@ -57,7 +56,7 @@ class HTS_DAILY (HTS):
max_price = int(jangoDic[code]['장부가'] * 1.10)
if max_price <= final_price:
sell_price = (int(max_price) - int(max_price) % 5)
if code == "A"+stock_code:
orderNum = self.requestOrder(OrderType.sell, stock_code, jangoDic[code]['매도가능'], sell_price)
print("ORDER_SELL", stock_code, log_time.strftime('%Y%m%d %H%M%S'), jangoDic[code]['매도가능'], sell_price)
return orderNum
@@ -140,7 +139,7 @@ class HTS_DAILY (HTS):
last_index = len(bsLine['sell']) - 1
if bsLine['sell'][last_index] > 0:
bs_sell_price = bsLine['sell'][last_index]
orderNum = self.getSellingPrice(THIS_TIME, self.stock_code, bs_sell_price)
orderNum = self.getSellingPrice(THIS_TIME, stock_code, bs_sell_price)
self.orderChecker.delete(today, stock_code)
# 로그 출력