From 16fb6ba2af76e964f28318aa6e5ad661cd8cdee9 Mon Sep 17 00:00:00 2001 From: "dosang.yoon" Date: Fri, 8 Jul 2022 15:31:20 +0900 Subject: [PATCH] init --- hts/HTS_122630.py | 12 ++++++++---- hts/HTS_252670.py | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hts/HTS_122630.py b/hts/HTS_122630.py index bc4730e..35c4111 100644 --- a/hts/HTS_122630.py +++ b/hts/HTS_122630.py @@ -69,9 +69,10 @@ class HTS_122630 (HTS): print ("START...") THIS_TIME = datetime.now() - while datetime.strptime(today + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 15200", '%Y%m%d %H%M%S'): + final_sell_check = False + 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 + " 090100", '%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'): if THIS_TIME.strftime('%Y%m%d %H%M%S') in timecheck and not timecheck[THIS_TIME.strftime('%Y%m%d %H%M%S')]: # 데이터를 가지고 온다. @@ -135,7 +136,10 @@ class HTS_122630 (HTS): data["rsi"][data_size - 1], data["rsis"][data_size - 1])) timecheck[THIS_TIME] = True - if datetime.strptime(today + " 151530", '%Y%m%d %H%M%S') < THIS_TIME: + elif datetime.strptime(today + " 151530", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 151600", '%Y%m%d %H%M%S'): + if final_sell_check: + continue + #### # 손해 보지 않는 가격에 매도한다. #### @@ -155,7 +159,7 @@ class HTS_122630 (HTS): # 로그 출력 print("SELL", THIS_TIME, selling_count, selling_price) - break + final_sell_check = True time.sleep(0.9) THIS_TIME = datetime.now() diff --git a/hts/HTS_252670.py b/hts/HTS_252670.py index 83e9ad5..bb853e3 100644 --- a/hts/HTS_252670.py +++ b/hts/HTS_252670.py @@ -69,9 +69,10 @@ class HTS_252670 (HTS): print ("START...") THIS_TIME = datetime.now() - while datetime.strptime(today + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 15200", '%Y%m%d %H%M%S'): + final_sell_check = False + 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 + " 090100", '%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'): if THIS_TIME.strftime('%Y%m%d %H%M%S') in timecheck and not timecheck[THIS_TIME.strftime('%Y%m%d %H%M%S')]: # 데이터를 가지고 온다. @@ -136,7 +137,10 @@ class HTS_252670 (HTS): timecheck[THIS_TIME] = True - if datetime.strptime(today + " 151530", '%Y%m%d %H%M%S') < THIS_TIME: + elif datetime.strptime(today + " 151530", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(today + " 151600", '%Y%m%d %H%M%S'): + if final_sell_check: + continue + #### # 손해 보지 않는 가격에 매도한다. #### @@ -156,7 +160,7 @@ class HTS_252670 (HTS): # 로그 출력 print("SELL", THIS_TIME, selling_count, selling_price) - break + final_sell_check = True time.sleep(0.9) THIS_TIME = datetime.now()