This commit is contained in:
dosangyoon
2021-10-04 13:14:49 +09:00
parent 563158e9ca
commit d33eb47785

View File

@@ -873,9 +873,8 @@ class HTS:
"low": [],
"vol": []}
toExist = False
print ("START...")
while datetime.strptime(given_day + " 083000", '%Y%m%d %H%M%S') < datetime.now() < datetime.strptime(given_day + " 152000", '%Y%m%d %H%M%S'):
while datetime.strptime(given_day + " 083000", '%Y%m%d %H%M%S') < datetime.now() < datetime.strptime(given_day + " 151500", '%Y%m%d %H%M%S'):
second = datetime.now().strftime('%Y%m%d %H%M%S')
if second in timecheck and not timecheck[second]:
@@ -936,11 +935,6 @@ class HTS:
for code in jangoDic:
TOTAL_BUY_AMT = jangoDic[code]['매입금액']
if jangoDic[code]['매도가능'] > 0:
if datetime.now() > datetime.strptime(given_day + " 151000", '%Y%m%d %H%M%S'):
self.requestOrder("1", stock_code, jangoDic[code]['매도가능'], result["close"])
toExist = True
break
# 장부가 가격의 마지막 자리를 0으로 만든다. (2090 -> 2090, 2092 -> 2090, 2098 -> 2090)
sell_price = int(jangoDic[code]['장부가'] / 10) * 10
# 장부가의 마지막 자리수를 가져온다.
@@ -955,9 +949,6 @@ class HTS:
# 장부가의 마지막 자리수가 7,8,9 라면 (2097, 2098, 2099 -> 2105 에 매도)
self.requestOrder("1", stock_code, jangoDic[code]['매도가능'], sell_price + 15)
if toExist:
break
time.sleep(0.9)
logFp.close()
@@ -971,7 +962,7 @@ if __name__ == "__main__":
RESOURCE_DIR = PROJECT_HOME + "/resources/analysis/"+today.strftime("%Y%m%d")
stock_codes = ["252670", "122630"]
stock_codes = ["252670"]
stock_codes = ["122630"]
given_days = ['20210901','20210902','20210903','20210906','20210907','20210908','20210909','20210910','20210913','20210914','20210915','20210916','20210917','20210923','20210924','20210927','20210928','20210929','20210930','20211001']
hts = HTS()