init
This commit is contained in:
@@ -438,7 +438,7 @@ class HTS_etf(HTS):
|
|||||||
|
|
||||||
if 'buy_price' in bsLine1:
|
if 'buy_price' in bsLine1:
|
||||||
buy_price = bsLine1['buy_price'][-1]
|
buy_price = bsLine1['buy_price'][-1]
|
||||||
buy_count = bsLine1['buy_count'][-1]
|
buy_count = int(bsLine1['buy_count'][-1])
|
||||||
if buy_price > 0:
|
if buy_price > 0:
|
||||||
# 매수를 요청 한다.
|
# 매수를 요청 한다.
|
||||||
orderNum = self.requestOrder(OrderType.buy, self.stock_code, buy_count, buy_price)
|
orderNum = self.requestOrder(OrderType.buy, self.stock_code, buy_count, buy_price)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if __name__ == "__main__":
|
|||||||
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
||||||
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
||||||
|
|
||||||
MAX_PRICE = 300000
|
MAX_PRICE = 500000
|
||||||
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
||||||
|
|
||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if __name__ == "__main__":
|
|||||||
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
||||||
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
||||||
|
|
||||||
MAX_PRICE = 300000
|
MAX_PRICE = 500000
|
||||||
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
||||||
|
|
||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if __name__ == "__main__":
|
|||||||
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
||||||
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
||||||
|
|
||||||
MAX_PRICE = 300000
|
MAX_PRICE = 500000
|
||||||
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
||||||
|
|
||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if __name__ == "__main__":
|
|||||||
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
if not os.path.exists(os.path.join(RESOURCE_PATH, "log")):
|
||||||
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
os.mkdir(os.path.join(RESOURCE_PATH, "log"))
|
||||||
|
|
||||||
MAX_PRICE = 300000
|
MAX_PRICE = 500000
|
||||||
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
hts.buyRealTime(today_str, MAX_PRICE=MAX_PRICE)
|
||||||
|
|
||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
|
|||||||
12
hts/HTS.py
12
hts/HTS.py
@@ -649,7 +649,17 @@ class HTS:
|
|||||||
# 주식 현재가 조회
|
# 주식 현재가 조회
|
||||||
def getRealTime(self, stock_code, today, LAST_DATA=None):
|
def getRealTime(self, stock_code, today, LAST_DATA=None):
|
||||||
if LAST_DATA is not None:
|
if LAST_DATA is not None:
|
||||||
result = copy.deepcopy(LAST_DATA)
|
#result = copy.deepcopy(LAST_DATA)
|
||||||
|
|
||||||
|
result = {"check": set(), "ymd": [], "open": [], "close": [], "high": [], "low": [], "volume": [], "label": []}
|
||||||
|
for i in range(len(LAST_DATA['ymd'])):
|
||||||
|
result["ymd"].append(LAST_DATA['ymd'][i])
|
||||||
|
result["open"].append(LAST_DATA['open'][i])
|
||||||
|
result["close"].append(LAST_DATA['close'][i])
|
||||||
|
result["high"].append(LAST_DATA['high'][i])
|
||||||
|
result["low"].append(LAST_DATA['low'][i])
|
||||||
|
result["volume"].append(LAST_DATA['volume'][i])
|
||||||
|
result["label"].append(LAST_DATA['label'][i])
|
||||||
else:
|
else:
|
||||||
result = {"check": set(), "ymd": [], "open": [], "close": [], "high": [], "low": [], "volume": [], "label": []}
|
result = {"check": set(), "ymd": [], "open": [], "close": [], "high": [], "low": [], "volume": [], "label": []}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user