This commit is contained in:
dosangyoon
2021-10-20 00:10:04 +09:00
parent 0d615270ad
commit a3ee3a07e9

View File

@@ -547,7 +547,7 @@ class HTS_122630:
def buyRealTime(self, stock_code, GIVEN_DAY):
orderChecker = OrderChecker(stock_code)
BASE_COUNT = 250
BASE_COUNT = 10
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
timecheck = {GIVEN_DAY + " " + str(second).zfill(6): False for second, check in timecheckList}
@@ -563,13 +563,10 @@ class HTS_122630:
final_price = 0
print("START...")
THIS_TIME = datetime.now()
while datetime.strptime(GIVEN_DAY + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(
GIVEN_DAY + " 15200", '%Y%m%d %H%M%S'):
while datetime.strptime(GIVEN_DAY + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(GIVEN_DAY + " 15200", '%Y%m%d %H%M%S'):
if datetime.strptime(GIVEN_DAY + " 090100", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(
GIVEN_DAY + " 151500", '%Y%m%d %H%M%S'):
if THIS_TIME.strftime('%Y%m%d %H%M%S') in timecheck and not timecheck[
THIS_TIME.strftime('%Y%m%d %H%M%S')]:
if datetime.strptime(GIVEN_DAY + " 090100", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(GIVEN_DAY + " 151500", '%Y%m%d %H%M%S'):
if THIS_TIME.strftime('%Y%m%d %H%M%S') in timecheck and not timecheck[THIS_TIME.strftime('%Y%m%d %H%M%S')]:
# 데이터를 가지고 온다.
self.getRealTime(stock_code, GIVEN_DAY, result)
@@ -617,8 +614,7 @@ class HTS_122630:
print("SELL", THIS_TIME.strftime('%Y%m%d %H%M%S'), selling_count, selling_price, len(orderListToCancel), len(ORDER_LIST))
# 로그 출력
print("TIMECHECK", THIS_TIME, final_price, data["Low"][data_size - 1],
data["slow_k"][data_size - 1], data["slow_d"][data_size - 1])
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 + " 151530", '%Y%m%d %H%M%S') < THIS_TIME: