This commit is contained in:
dsyoon
2021-10-15 10:08:22 +09:00
parent 6fea4e3453
commit b3b21c51e4
2 changed files with 4 additions and 5 deletions

View File

@@ -582,7 +582,6 @@ class HTS:
if datetime.strptime(given_day + " 090100", '%Y%m%d %H%M%S') < datetime.now() < datetime.strptime(given_day + " 151000", '%Y%m%d %H%M%S'):
if second in timecheck and not timecheck[second]:
print("TIMECHECK", second)
# 데이터를 가지고 온다.
self.getRealTime(stock_code, given_day, result)
@@ -591,7 +590,8 @@ class HTS:
data = self.bs.analyze(result)
# 사야 할 시점/가격과 팔아야 할 시점/가격을 체크한다.
bs_buy_price, bs_weight, bs_sell_price = self.checkTransaction(data)
final_price = data["Close"][len(data["Close"])-1]
data_size = len(data["Close"])
final_price = data["Close"][data_size-1]
if bs_buy_price > 0:
BUY_COUNT = int(200 * bs_weight)
@@ -610,6 +610,7 @@ class HTS:
self.requestOrder("1", stock_code, selling_count, selling_price)
print("SELL", second, selling_count, selling_price)
print("TIMECHECK", second, final_price, data["Low"][data_size-1], data["slow_k"][data_size-1], data["slow_d"][data_size-1])
timecheck[second] = True
if datetime.strptime(given_day + " 151000", '%Y%m%d %H%M%S') < datetime.now():