This commit is contained in:
dosangyoon
2021-09-23 03:49:17 +09:00
parent 87f132830b
commit b529d4a261

View File

@@ -506,9 +506,9 @@ class HTS:
while datetime.strptime(given_day + " 085900", '%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')
print(second)
if second in timecheck and not timecheck[second]:
print("TIMECHECK", second)
# 데이터를 가지고 온다.
self.getRealTime(stock_code, given_day, result)
@@ -524,7 +524,7 @@ class HTS:
# 매수신청과 5원 높여서 매도신청
if price > 0:
print(second, price)
print("BUY", second, price)
count = 1
self.orderToBuy(stock_code, count, price)
@@ -534,6 +534,8 @@ class HTS:
self.write(given_day, result)
timecheck[second] = True
else:
print("NONE", second)
time.sleep(0.5)
@@ -572,8 +574,6 @@ if __name__ == "__main__":
hts.simulate(stock_code, given_day)
"""
given_day = '20210917'
#hts.simulate(stock_code, given_day)
hts.buyRealTime(stock_code, given_day)
print ("done...")