init
This commit is contained in:
@@ -547,7 +547,7 @@ class HTS_122630:
|
|||||||
|
|
||||||
def buyRealTime(self, stock_code, GIVEN_DAY):
|
def buyRealTime(self, stock_code, GIVEN_DAY):
|
||||||
orderChecker = OrderChecker(stock_code)
|
orderChecker = OrderChecker(stock_code)
|
||||||
BASE_COUNT = 250
|
BASE_COUNT = 10
|
||||||
|
|
||||||
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
|
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
|
||||||
timecheck = {GIVEN_DAY + " " + str(second).zfill(6): False for second, check in timecheckList}
|
timecheck = {GIVEN_DAY + " " + str(second).zfill(6): False for second, check in timecheckList}
|
||||||
@@ -563,13 +563,10 @@ class HTS_122630:
|
|||||||
final_price = 0
|
final_price = 0
|
||||||
print("START...")
|
print("START...")
|
||||||
THIS_TIME = datetime.now()
|
THIS_TIME = datetime.now()
|
||||||
while datetime.strptime(GIVEN_DAY + " 070000", '%Y%m%d %H%M%S') < THIS_TIME < datetime.strptime(
|
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'):
|
||||||
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(
|
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'):
|
||||||
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 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)
|
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("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],
|
print("TIMECHECK", THIS_TIME, final_price, data["Low"][data_size - 1], data["slow_k"][data_size - 1], data["slow_d"][data_size - 1])
|
||||||
data["slow_k"][data_size - 1], data["slow_d"][data_size - 1])
|
|
||||||
timecheck[THIS_TIME] = True
|
timecheck[THIS_TIME] = True
|
||||||
|
|
||||||
if datetime.strptime(GIVEN_DAY + " 151530", '%Y%m%d %H%M%S') < THIS_TIME:
|
if datetime.strptime(GIVEN_DAY + " 151530", '%Y%m%d %H%M%S') < THIS_TIME:
|
||||||
|
|||||||
Reference in New Issue
Block a user