init
This commit is contained in:
@@ -37,6 +37,7 @@ class HTS_252670:
|
||||
|
||||
def all_stocks(self):
|
||||
# 종목코드 리스트 구하기
|
||||
|
||||
self.objCpCodeMgr = win32com.client.Dispatch("CpUtil.CpCodeMgr")
|
||||
codeList = self.objCpCodeMgr.GetStockListByMarket(1) # 거래소
|
||||
codeList2 = self.objCpCodeMgr.GetStockListByMarket(2) # 코스닥
|
||||
@@ -481,9 +482,9 @@ class HTS_252670:
|
||||
continue
|
||||
|
||||
open = objStockChart.GetDataValue(2, i)
|
||||
close = objStockChart.GetDataValue(5, i)
|
||||
high = objStockChart.GetDataValue(3, i)
|
||||
low = objStockChart.GetDataValue(4, i)
|
||||
close = objStockChart.GetDataValue(5, i)
|
||||
vol = objStockChart.GetDataValue(6, i)
|
||||
|
||||
if len(result["check"]) == 0:
|
||||
@@ -520,6 +521,7 @@ class HTS_252670:
|
||||
return -1, -1, -1
|
||||
|
||||
buy, weight, sell = self.buySellChecker.getPriceAndWeight1(data, i)
|
||||
#buy, weight, sell = self.buySellChecker.getPriceAndWeight_1minute(data, i)
|
||||
return buy, weight, sell
|
||||
|
||||
def getSellingPrice(self, final_price):
|
||||
@@ -549,7 +551,7 @@ class HTS_252670:
|
||||
|
||||
def buyRealTime(self, GIVEN_DAY):
|
||||
orderChecker = OrderChecker(self.stock_code)
|
||||
BASE_COUNT = 40
|
||||
BASE_COUNT = 190
|
||||
|
||||
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
|
||||
timecheck = {GIVEN_DAY + " " + str(second).zfill(6):False for second, check in timecheckList}
|
||||
@@ -617,10 +619,12 @@ class HTS_252670:
|
||||
print("SELL", THIS_TIME.strftime('%Y%m%d %H%M%S'), selling_count, selling_price, len(orderListToCancel), len(ORDER_LIST))
|
||||
"""
|
||||
# 로그 출력
|
||||
print("TIMECHECK: %s, price: %d, low: %d, lower: %.2f, avg5: %.2f, slow_k_1: %.2f, slow_d_1: %.2f, slow_k: %.2f, slow_d: %.2f, rsi: %.2f, rsis: %.2f" %
|
||||
(str(THIS_TIME), final_price, data["low"][data_size-1], data["lower"][data_size-1], data["avg5"][data_size-1],
|
||||
data["slow_k"][data_size-2], data["slow_d"][data_size-2], data["slow_k"][data_size-1], data["slow_d"][data_size-1],
|
||||
data["rsi"][data_size-1], data["rsis"][data_size-1]))
|
||||
print("TIMECHECK: %s, price: %d, \n\t\t\topen: %d, close: %d, low: %d, high: %d, lower: %.2f, upper: %.2f, \n\t\t\tavg2: %.2f, avg3: %.2f, avg5: %.2f, \n\t\t\tslow_k_1: %.2f, slow_k: %.2f, slow_d_1: %.2f, slow_d: %.2f, \n\t\t\trsi_1: %.2f, rsis_1: %.2f, rsi: %.2f, rsis: %.2f" %
|
||||
(str(THIS_TIME), final_price,
|
||||
data["open"][data_size-1], data["close"][data_size-1], data["low"][data_size-1], data["high"][data_size-1], data["lower"][data_size-1], data["upper"][data_size-1],
|
||||
data["avg2"][data_size-1], data["avg3"][data_size-1], data["avg5"][data_size-1],
|
||||
data["slow_k"][data_size-2], data["slow_k"][data_size-1], data["slow_d"][data_size-2], data["slow_d"][data_size-1],
|
||||
data["rsi"][data_size-2], data["rsis"][data_size-2], data["rsi"][data_size-1], data["rsis"][data_size-1]))
|
||||
timecheck[THIS_TIME] = True
|
||||
"""
|
||||
if datetime.strptime(GIVEN_DAY + " 151530", '%Y%m%d %H%M%S') < THIS_TIME:
|
||||
|
||||
Reference in New Issue
Block a user