This commit is contained in:
dosangyoon
2022-09-05 12:25:58 +09:00
parent 28a3e26421
commit 1fa51a9b6d
2 changed files with 3 additions and 12 deletions

View File

@@ -57,19 +57,10 @@ class HTS_122630 (HTS):
while datetime.strptime(today + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 153100", '%Y%m%d %H%M%S'): while datetime.strptime(today + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 153100", '%Y%m%d %H%M%S'):
"""
if datetime.strptime(today + " 090000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 151500", '%Y%m%d %H%M%S'): if datetime.strptime(today + " 090000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 151500", '%Y%m%d %H%M%S'):
# 3시 까지만 매수를 시도한다. # 3시 까지만 매수를 시도한다.
"""
if THIS_TIME.strftime('%S') in ("09", "19", "29", "39", "49", "59"):
if THIS_TIME.strftime('%S') in ("06", "16", "26", "36", "46", "56"):
# 데이터를 가지고 온다.
result = self.getRealTime(self.stock_code, today, LAST_DATA)
final_price = result["close"][len(result["close"]) - 1]
# 10초마다 체크하여 체결된 내역이 있으면 50원 높게 매도를 주문한다.
self.getSellingPrice(THIS_TIME, self.stock_code, final_price)
"""
if THIS_TIME.strftime('%S') == "05": if THIS_TIME.strftime('%S') == "05":
# 매분 5초마다 실행한다. # 매분 5초마다 실행한다.
@@ -157,7 +148,7 @@ class HTS_122630 (HTS):
time.sleep(0.9) time.sleep(0.9)
THIS_TIME = datetime.now() THIS_TIME = datetime.now()
"""
return return
def updteTodayStock(self, db_filename, stock_code, today_str): def updteTodayStock(self, db_filename, stock_code, today_str):

View File

@@ -179,7 +179,7 @@ if __name__ == "__main__":
# KODEX 인버스 * 2 # KODEX 인버스 * 2
stock_code = "252670" stock_code = "252670"
stock_name = "KODEX 200선물인버스2X" stock_name = "KODEX 200선물인버스2X"
buy_count = 300 buy_count = 500
hts = HTS_252670(RESOURCE_PATH, stock_code, buy_count) hts = HTS_252670(RESOURCE_PATH, stock_code, buy_count)
today_str = today.strftime('%Y%m%d') today_str = today.strftime('%Y%m%d')